%# One way to stop a runaway horse is to bet on him.

            <table width="100%" border="0" cellspacing="0" cellpadding="0">
	    <tr> 
		<td><& /Edit/Elements/Tabs, Map => $Map, URL => $url &></td>
              </tr>
			  <tr> 
			    <td class="poptable" bgcolor="#C4E1F0">
% $m->call_next if $ACL{$Function} or $Function eq 'Stats';
			    </td>
			  </tr>
			</table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  </td>
</tr>
</table>
<br>
<& /Foundry/Elements/Footer &>
<%INIT>
my $prefix = '/Foundry/Project/Admin/';
my $Map = [
    ''			    => 'Queue=' . $QueueObj->Id,
];

my @items = $QueueObj->FunctionsMap;
my %ACL = map { ($_ => 1) } $QueueObj->FunctionsACL($ProjectRole);
$ACL{ACL} = ($ProjectRole eq 'admin');

foreach my $item (@items) {
    my $link = $prefix . (($item->[0] eq 'Basics') ? '' : $item->[0]);
    push @$Map, ($link => $item->[1]) if $ACL{$item->[0]};
}

push @$Map, (
    $prefix . "ACL/"      => 'Access control',		# loc
) if ($ProjectRole eq 'admin');

push @$Map, (
    $prefix . "Stats/"      => 'Statistics',		# loc
);

my $url = $r->uri;
$url =~ s/\w+\.html$//;
if ($url =~ m{List\.html/wws/\w+/(.*)}) {
    push @$Map, $1 => $1;
    $url = $1;
}

my $Function = 'Basics';
if ($r->uri =~ m{/Project/Admin/(\w+)}) {
    $Function = $1;
}

</%INIT>
<%ATTR>
Tab2	=> 'Project Admin'
</%ATTR>
<%ARGS>
$QueueObj
$ProjectRole
</%ARGS>
