1 # Copyright (C) 2006 Alex Schroeder <alex@emacswiki.org>
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the
15 # Free Software Foundation, Inc.
16 # 59 Temple Place, Suite 330
17 # Boston, MA 02111-1307 USA
19 $ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/gotobar.pl">gotobar.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Gotobar_Extension">Gotobar Extension</a></p>';
21 use vars
qw($GotobarName);
23 # Include this page on every page:
25 $GotobarName = 'GotoBar';
27 # do this later so that the user can customize $GotobarName
28 push(@MyInitVariables, \&GotobarInit);
31 $GotobarName = FreeToNormal($GotobarName); # spaces to underscores
32 $AdminPages{$GotobarName} = 1;
33 if ($IndexHash{$GotobarName}) {
34 OpenPage($GotobarName);
35 return if $DeletedPage && $Page{text} =~ /^\s*$DeletedPage\b/o;
36 # Don't use @UserGotoBarPages because this messes up the order of
37 # links for unsuspecting users.
38 @UserGotoBarPages = ();
41 while ($Page{text} =~ m/($LinkPattern|\[\[$FreeLinkPattern\]\]|\[\[$FreeLinkPattern\|([^\]]+)\]\]|\[$InterLinkPattern\s+([^\]]+?)\])/og) {
42 my $page = $2||$3||$4||$6;
44 $UserGotoBar .= ' ' if $UserGotoBar;
46 $UserGotoBar .= GetInterLink($page, $text);
48 $UserGotoBar .= GetPageLink($page, $text);
49 # The first local page is the homepage, the second local page
50 # is the list of recent changes.
53 $HomePage = FreeToNormal($page);
54 } elsif ($count == 2) {
55 $RCName = FreeToNormal($page);