2 rcs_id('$Id: themeinfo.php,v 1.13 2004-04-01 15:57:20 rurban Exp $');
5 * This file defines the Sidebar appearance ("theme") of PhpWiki.
8 require_once('lib/Theme.php');
10 class Theme_Sidebar extends Theme {
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 /> · '));
17 //$this->setButtonSeparator("\n");
18 //$Theme->setButtonSeparator($old);
20 if ($name == "actionbar" || $name == "signin") {
21 //$old = $Theme->getButtonSeparator();
22 //$this->setButtonSeparator(HTML::br());
23 $this->setButtonSeparator(" ");
24 //$Theme->setButtonSeparator($old);
26 return $this->_path . $this->_findFile("templates/$name.tmpl");
29 function calendarLink($date = false) {
30 return $this->calendarBase() . SUBPAGE_SEPARATOR .
31 strftime("%Y-%m-%d", $date ? $date : time());
34 function calendarBase() {
35 static $UserCalPageTitle = false;
36 if (!$UserCalPageTitle)
37 $UserCalPageTitle = $GLOBALS['request']->_user->getId() .
38 SUBPAGE_SEPARATOR . _("Calendar");
39 return $UserCalPageTitle;
42 $Theme = new Theme_Sidebar('Sidebar');
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");
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.
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');
74 * The logo image appears on every page and links to the HomePage.
76 //$Theme->addImageAlias('logo', 'logo.png');
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.
85 // Comment this next line out to enable signature.
86 $Theme->addImageAlias('signature', false);
91 $Theme->setLinkIcon('http');
92 $Theme->setLinkIcon('https');
93 $Theme->setLinkIcon('ftp');
94 $Theme->setLinkIcon('mailto');
95 $Theme->setLinkIcon('interwiki');
96 $Theme->setLinkIcon('*', 'url');
98 //$Theme->setButtonSeparator(' | ');
101 * WikiWords can automatically be split by inserting spaces between
102 * the words. The default is to leave WordsSmashedTogetherLikeSo.
104 $Theme->setAutosplitWikiWords(true);
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.
112 $Theme->setAnonEditUnknownLinks(false);
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
122 //$Theme->setDateFormat("%B %d, %Y");
125 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
126 // (c-file-style: "gnu")
131 // c-hanging-comment-ender-p: nil
132 // indent-tabs-mode: nil