]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/Sidebar/themeinfo.php
simplified Sidebar theme: table, not absolute css positioning
[SourceForge/phpwiki.git] / themes / Sidebar / themeinfo.php
1 <?php
2 rcs_id('$Id: themeinfo.php,v 1.13 2004-04-01 15:57:20 rurban Exp $');
3
4 /*
5  * This file defines the Sidebar appearance ("theme") of PhpWiki.
6  */
7
8 require_once('lib/Theme.php');
9
10 class Theme_Sidebar extends Theme {
11
12     function findTemplate ($name) {
13         // hack for navbar.tmpl to hide the buttonseparator
14         if ($name == "navbar") {
15             //$old = $Theme->getButtonSeparator();
16             $this->setButtonSeparator(HTML::Raw('<br /> &middot; '));
17             //$this->setButtonSeparator("\n");
18             //$Theme->setButtonSeparator($old);
19         }
20         if ($name == "actionbar" || $name == "signin") {
21             //$old = $Theme->getButtonSeparator();
22             //$this->setButtonSeparator(HTML::br());
23             $this->setButtonSeparator(" ");
24             //$Theme->setButtonSeparator($old);
25         }
26         return $this->_path . $this->_findFile("templates/$name.tmpl");
27     }
28
29     function calendarLink($date = false) {
30         return $this->calendarBase() . SUBPAGE_SEPARATOR . 
31                strftime("%Y-%m-%d", $date ? $date : time());
32     }
33
34     function calendarBase() {
35         static $UserCalPageTitle = false;
36         if (!$UserCalPageTitle) 
37             $UserCalPageTitle = $GLOBALS['request']->_user->getId() . 
38                                 SUBPAGE_SEPARATOR . _("Calendar");
39         return $UserCalPageTitle;
40     }
41 }
42 $Theme = new Theme_Sidebar('Sidebar');
43
44 $dbi = $GLOBALS['request']->getDbh();
45 // display flat calender dhtml under the clock
46 if ($dbi->isWikiPage($Theme->calendarBase())) {
47     $jslang = @$GLOBALS['LANG'];
48     $Theme->addMoreHeaders($Theme->_CSSlink(0,
49         $Theme->_findFile('jscalendar/calendar-phpwiki.css'),'all'));
50     $Theme->addMoreHeaders("\n");
51     $Theme->addMoreHeaders(JavaScript('',
52         array('src' => $Theme->_findData('jscalendar/calendar_stripped.js'))));
53     $Theme->addMoreHeaders("\n");
54     if (!($langfile = $Theme->_findData("jscalendar/lang/calendar-$jslang.js")))
55         $langfile = $Theme->_findData("jscalendar/lang/calendar-en.js");
56     $Theme->addMoreHeaders(JavaScript('',array('src' => $langfile)));
57     $Theme->addMoreHeaders("\n");
58     $Theme->addMoreHeaders(JavaScript('',
59         array('src' => $Theme->_findData('jscalendar/calendar-setup_stripped.js'))));
60     $Theme->addMoreHeaders("\n");
61 }
62
63 // CSS file defines fonts, colors and background images for this
64 // style.  The companion '*-heavy.css' file isn't defined, it's just
65 // expected to be in the same directory that the base style is in.
66
67 //$Theme->setDefaultCSS(_("Sidebar"), 'sidebar.css');
68 //$Theme->addAlternateCSS('PhpWiki', 'phpwiki.css');
69 $Theme->setDefaultCSS('PhpWiki', 'phpwiki.css');
70 $Theme->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen');
71 $Theme->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
72
73 /**
74  * The logo image appears on every page and links to the HomePage.
75  */
76 //$Theme->addImageAlias('logo', 'logo.png');
77
78 /**
79  * The Signature image is shown after saving an edited page. If this
80  * is not set, any signature defined in index.php will be used. If it
81  * is not defined by index.php or in here then the "Thank you for
82  * editing..." screen will be omitted.
83  */
84
85 // Comment this next line out to enable signature.
86 $Theme->addImageAlias('signature', false);
87
88 /*
89  * Link icons.
90  */
91 $Theme->setLinkIcon('http');
92 $Theme->setLinkIcon('https');
93 $Theme->setLinkIcon('ftp');
94 $Theme->setLinkIcon('mailto');
95 $Theme->setLinkIcon('interwiki');
96 $Theme->setLinkIcon('*', 'url');
97
98 //$Theme->setButtonSeparator(' | ');
99
100 /**
101  * WikiWords can automatically be split by inserting spaces between
102  * the words. The default is to leave WordsSmashedTogetherLikeSo.
103  */
104 $Theme->setAutosplitWikiWords(true);
105
106 /**
107  * If true (default) show create '?' buttons on not existing pages, even if the 
108  * user is not signed in.
109  * If false, anon users get no links and it looks cleaner, but then they 
110  * cannot easily fix missing pages.
111  */
112 $Theme->setAnonEditUnknownLinks(false);
113
114 /*
115  * You may adjust the formats used for formatting dates and times
116  * below.  (These examples give the default formats.)
117  * Formats are given as format strings to PHP strftime() function See
118  * http://www.php.net/manual/en/function.strftime.php for details.
119  * Do not include the server's zone (%Z), times are converted to the
120  * user's time zone.
121  */
122 //$Theme->setDateFormat("%B %d, %Y");
123
124
125 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
126 // (c-file-style: "gnu")
127 // Local Variables:
128 // mode: php
129 // tab-width: 8
130 // c-basic-offset: 4
131 // c-hanging-comment-ender-p: nil
132 // indent-tabs-mode: nil
133 // End:   
134 ?>