1. Include the following subroutines just before the comment #END_OF_BROWSE_CODE (see /Where, heading 3)
sub GetLockLink {
my ($id, $name) = @_;
if ($FreeLinks) {
$id = &FreeToNormal($id);
$name =~ s/_/ /g;
}
return &ScriptLink("action=pagelock&set=1&id=$id", $name);
}
sub GetUnLockLink {
my ($id, $name) = @_;
if ($FreeLinks) {
$id = &FreeToNormal($id);
$name =~ s/_/ /g;
}
return &ScriptLink("action=pagelock&set=0&id=$id", $name);
}
sub GetAdminBar {
my ($id) = @_;
my ($main, $result);
my ($fname);
$result .= 'Administration: ';
if (-f &GetLockedPageFile($id)) {
$result .= &GetUnLockLink($id,T('Unlock page'));
}
else {
$result .= &GetLockLink($id,T('Lock page'));
}
$result .=" ";
$result .= &ScriptLink("action=editbanned",T("Edit Banned List"));
$result .=" "; $result .= &ScriptLink("action=maintain",T("Run Maintenance"));
$result .=" "; $result .= &ScriptLink("action=editlinks",T("Edit/Rename pages"));
$fname = "$DataDir/noedit";
if (-f $fname) {
$result .=" "; $result .= &ScriptLink("action=editlock&set=0",T("Unlock site"));
} else {
$result .=" "; $result .= &ScriptLink("action=editlock&set=1",T("Lock site"));
}
return $result;
}
2. The previous code will not actually do anything to your output. To see an admin link bar you may want to include the four lines below between ####begin and ###end almost at the end of sub GetFooterText between
$result .= '<TR><TD>' . &GetSearchForm() ;and before
if ($DataDir =~ m|/tmp/|) {
(This will put your adminbar at the bottom of the page below the search form. Note you don't have to include them exactly there)
##### begin
if (&UserIsAdmin()) {
$result .= '<BR>';
$result .= &GetAdminBar($id);
}
##### End
Cheers! -[Trav]
sub GetAdminBar {
my ($id) = @_;
my ($main, $result);
my ($fname);
$result .= 'Administration: ';
if (-f &GetLockedPageFile($id)) {
$result .= &GetUnLockLink($id,T('Unlock page'));
}
else {
$result .= &GetLockLink($id,T('Lock page'));
}
$fname = "$DataDir/noedit";
if (-f $fname) {
} else {
}
return $result;
}
-- Ralf Baerwaldt