2004-02-09 23:14:24 +00:00
|
|
|
# Copyright (C) 2004 Tilmann Holst
|
2007-08-15 15:08:51 +00:00
|
|
|
# Copyright (C) 2004, 2005, 2007 Alex Schroeder <alex@emacswiki.org>
|
2004-02-09 23:14:24 +00:00
|
|
|
#
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
2007-08-15 15:08:51 +00:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
2004-02-09 23:14:24 +00:00
|
|
|
# (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-08-15 15:08:51 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2004-02-09 23:14:24 +00:00
|
|
|
|
2007-08-15 15:08:51 +00:00
|
|
|
$ModulesDescription .= '<p>$Id: sidebar.pl,v 1.18 2007/08/15 15:08:51 as Exp $</p>';
|
2004-02-09 23:14:24 +00:00
|
|
|
|
2007-08-15 15:08:51 +00:00
|
|
|
use vars qw($SidebarName);
|
2004-02-09 23:14:24 +00:00
|
|
|
|
|
|
|
|
# Include this page on every page:
|
|
|
|
|
|
|
|
|
|
$SidebarName = 'SideBar';
|
|
|
|
|
|
2005-01-04 09:57:56 +00:00
|
|
|
# do this later so that the user can customize $SidebarName
|
|
|
|
|
push(@MyInitVariables, \&SidebarInit);
|
|
|
|
|
|
|
|
|
|
sub SidebarInit {
|
|
|
|
|
$SidebarName = FreeToNormal($SidebarName); # spaces to underscores
|
2006-07-15 23:15:12 +00:00
|
|
|
$AdminPages{$SidebarName} = 1;
|
2005-01-04 09:57:56 +00:00
|
|
|
}
|
2005-01-04 09:04:05 +00:00
|
|
|
|
2005-05-01 13:01:29 +00:00
|
|
|
*OldSideBarGetHeader = *GetHeader;
|
|
|
|
|
*GetHeader = *NewSideBarGetHeader;
|
|
|
|
|
|
2004-02-09 23:14:24 +00:00
|
|
|
# this assumes that *all* calls to GetHeader will print!
|
|
|
|
|
sub NewSideBarGetHeader {
|
|
|
|
|
my ($id) = @_;
|
|
|
|
|
print OldSideBarGetHeader(@_);
|
2006-08-06 23:18:08 +00:00
|
|
|
# While rendering, OpenPageName must point to the sidebar, so that
|
|
|
|
|
# the form extension which checks whether the current page is locked
|
|
|
|
|
# will check the SideBar lock and not the real page's lock.
|
2005-05-01 13:01:29 +00:00
|
|
|
local $OpenPageName = $SidebarName;
|
2004-02-09 23:14:24 +00:00
|
|
|
print '<div class="sidebar">';
|
2006-08-06 23:18:08 +00:00
|
|
|
# This makes sure that $Page{text} remains undisturbed.
|
2004-02-09 23:22:19 +00:00
|
|
|
PrintWikiToHTML(GetPageContent($SidebarName));
|
2004-02-09 23:14:24 +00:00
|
|
|
print '</div>';
|
|
|
|
|
return '';
|
|
|
|
|
}
|