[Home]GetGotoBar

UseModWiki | RecentChanges | Preferences

Returns text with URLs for use as gotobar at top and bottom of wiki-page,

e.g.

 UseModWiki | RecentChanges | Preferences


Here is a cleaner version of the function using join. It also doesn't print the home page link if a logo is in use

sub GetGotoBar {
  my ($id) = @_;
  my ($main);
  my (@links) = ();

  push(@links, &GetPageLink($HomePage)) if ($LogoUrl eq "");
  if ($id =~ m|/|) {
    $main = $id;
    $main =~ s|/.*||;  # Only the main page name (remove subpage)
    push(@links, &GetPageLink($main));
  }
  push(@links, &GetPageLink($RCName));
  push(@links, &GetPrefsLink());
  push(@links, &GetRandomLink()) if (&GetParam("linkrandom", 0));
  push(@links, $UserGotoBar) if ($UserGotoBar ne '');
  return join(" | ", @links) . "<br>\n";
}

UseModWiki | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited October 26, 2007 7:07 pm by MarkusLude (diff)
Search: