* css/orgmuse.css: Add styles div.header span.gotobar form and h1
[orgmuse.git] / org-custom.pl
blob3399370c1572fdaf9857cdb079713930a0f99a7f
1 #!/usr/bin/env perl
2 # ====================[ orgaddition.pl ]====================
4 =head1 NAME
6 org-custom - An Oddmuse module for augmenting the Org Markup module with
7 so-called, unofficial "Org Additions" markup.
9 =head1 INSTALLATION
11 orgaddition is simply installable; simply:
13 =over
15 =item First install the Org Markup module; see
16 L<http://www.oddmuse.org/cgi-bin/oddmuse/Org_Markup_Extension>.
18 =item Move this file into the B<wiki/modules/> directory for your Oddmuse Wiki.
20 =back
22 =cut
23 # # package OddMuse;
25 $ModulesDescription .= '<p>See <a href="http://oddmuse.org/wiki/Org_Markup_Extension">Org Markup Extension</a></p>';
27 *GetOldTitle = *GetTitle;
28 *GetTitle = *OrgGetTitle;
30 sub OrgGetTitle {
31 my ($id, $title, $oldId, $nocache, $status, $links) = @_;
32 return '';
35 *GetOldHeader = *GetHeader;
36 *GetHeader = *OrgGetHeader;
38 sub OrgGetHeader {
39 my ($id, $title, $oldId, $nocache, $status, $links) = @_;
40 return GetOldHeader($id, $title, $oldId, $nocache, $status, $links)
41 . GetOldTitle($id, $title);
44 push(@MyFooters, \&OrgPrintFooter);
45 sub OrgPrintFooter {
46 my ($id) = @_;
47 # return $q->div({-class=>'navbar'}, GetGotoBar(@_));
48 return '';
51 use vars qw($SideBars);
53 # Include this page on every page:
54 @SideBars = ();
56 # do this later so that the user can customize $SidebarName
57 push(@MyInitVariables, \&SideBarInit);
59 sub SideBarInit {
60 foreach my $sideBar (@SideBars) {
61 $AdminPages{FreeToNormal($sideBar)} = 1;
65 sub PrintSideBar {
66 my ($pageName, $className) = @_;
68 $pageName = FreeToNormal($pageName);
69 $className = lc($pageName) unless $className;
70 # While rendering, OpenPageName must point to the sidebar, so that
71 # the form extension which checks whether the current page is locked
72 # will check the SideBar lock and not the real page's lock.
73 local $OpenPageName = $pageName;
74 print $q->start_div({-class=>$className});
75 # This makes sure that $Page{text} remains undisturbed.
76 PrintWikiToHTML(GetPageContent($pageName));
77 print $q->end_div();
78 return '';
81 sub PrintMyContent {
82 foreach my $sideBar (@SideBars) {
83 PrintSideBar($sideBar);
87 =head1 COPYRIGHT AND LICENSE
89 The information below applies to everything in this distribution,
90 except where noted.
92 Copyright 2013 Jambunathan K <kjambunathan@gmail.com>
94 This program is free software; you can redistribute it and/or modify
95 it under the terms of the GNU General Public License as published by
96 the Free Software Foundation; either version 3 of the License, or
97 (at your option) any later version.
99 This program is distributed in the hope that it will be useful,
100 but WITHOUT ANY WARRANTY; without even the implied warranty of
101 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
102 GNU General Public License for more details.
104 You should have received a copy of the GNU General Public License
105 along with this program. If not, see L<http://www.gnu.org/licenses/>.
107 =cut