2 rcs_id('$Id: themeinfo.php,v 1.3 2005-02-02 19:14:13 rurban Exp $');
5 * This file defines a blog theme for PhpWiki,
6 * based on Rui Carmo's excellent http://the.taoofmac.com/space/
7 * which is based on the Kubrick theme: http://binarybonsai.com/kubrick/
8 * The layout was designed and built by Michael Heilemann,
9 * whose blog you will find at http://binarybonsai.com/
11 * [Stanley Kubrick]"Good afternoon, gentlemen. I am a HAL 9000
12 * computer. I became operational at the H.A.L. plant in Urbana,
13 * Illinois on the 12th of January 1992. My instructor was
14 * Mr. Langley, and he taught me to sing a song. If you'd like to hear
15 * it I can sing it for you."
17 * The CSS, XHTML and design is released under GPL:
18 * http://www.opensource.org/licenses/gpl-license.php
20 * Default is a one-person (ADMIN_USER) blog (at the BlogHomePage), but
21 * other blogs are also enabled for every authenticated user.
23 * Actionbar: Edit, Home, About, Archives, News, ..., Info [ Search ]
24 * PageTrail: > .. > ..
25 * Right sidebar boxes: Archives, Syndication, Links, GoogleAds
30 require_once('lib/Theme.php');
31 require_once('themes/Sidebar/themeinfo.php');
33 class Theme_blog extends Theme_Sidebar {
34 function _findFile ($file, $missing_okay=false) {
35 if (file_exists($this->_path . "themes/".$this->_name."/$file"))
36 return "themes/".$this->_name."/$file";
37 if (file_exists($this->_path . "themes/Sidebar/$file"))
38 return "themes/Sidebar/$file";
39 return parent::_findFile($file, $missing_okay);
42 function _labelForAction ($action) {
44 case 'edit': return _("Edit");
45 case 'diff': return _("Diff");
46 case 'logout': return _("SignOut");
47 case 'login': return _("SignIn");
48 case 'lock': return _("Lock");
49 case 'unlock': return _("Unlock");
50 case 'remove': return _("Remove");
52 return gettext(ucfirst($action));
56 function getRecentChangesFormatter ($format) {
57 include_once($this->file('lib/RecentChanges.php'));
58 if (preg_match('/^rss|^sidebar/', $format))
59 return false; // use default
61 return '_blog_RecentChanges_BoxFormatter';
62 return '_blog_RecentChanges_Formatter';
65 /* TODO: use the blog summary as label instead of the pagename */
66 function linkExistingWikiWord($wikiword, $linktext = '', $version = false) {
68 if ($version !== false and !$this->HTML_DUMP_SUFFIX)
69 $url = WikiURL($wikiword, array('version' => $version));
71 $url = WikiURL($wikiword);
73 // Extra steps for dumping page to an html file.
74 if ($this->HTML_DUMP_SUFFIX) {
75 $url = preg_replace('/^\./', '%2e', $url); // dot pages
78 $link = HTML::a(array('href' => $url));
80 if (isa($wikiword, 'WikiPageName'))
81 $default_text = $wikiword->shortName;
83 $default_text = $wikiword;
85 if (!empty($linktext)) {
86 $link->pushContent($linktext);
87 $link->setAttr('class', 'named-wiki');
88 $link->setAttr('title', $this->maybeSplitWikiWord($default_text));
91 //TODO: check if wikiblog
92 $link->pushContent($this->maybeSplitWikiWord($default_text));
93 $link->setAttr('class', 'wiki');
95 if ($request->getArg('frame'))
96 $link->setAttr('target', '_top');
101 $WikiTheme = new Theme_blog('blog');
103 // CSS file defines fonts, colors and background images for this
106 // override sidebar definitions:
107 $WikiTheme->setDefaultCSS(_("blog"), 'Kubrick.css');
109 $WikiTheme->addButtonAlias(_("(diff)"), "[diff]" );
110 $WikiTheme->addButtonAlias("...", "alltime");
112 $WikiTheme->setButtonSeparator("");
115 * WikiWords can automatically be split by inserting spaces between
116 * the words. The default is to leave WordsSmashedTogetherLikeSo.
118 $WikiTheme->setAutosplitWikiWords(false);
121 * If true (default) show create '?' buttons on not existing pages, even if the
122 * user is not signed in.
123 * If false, anon users get no links and it looks cleaner, but then they
124 * cannot easily fix missing pages.
126 $WikiTheme->setAnonEditUnknownLinks(false);
129 * You may adjust the formats used for formatting dates and times
130 * below. (These examples give the default formats.)
131 * Formats are given as format strings to PHP strftime() function See
132 * http://www.php.net/manual/en/function.strftime.php for details.
133 * Do not include the server's zone (%Z), times are converted to the
136 //$WikiTheme->setDateFormat("%B %d, %Y");
137 $WikiTheme->setDateFormat("%A, %B %e, %Y"); // must not contain time
138 $WikiTheme->setTimeFormat("%H:%M:%S");
140 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
141 // (c-file-style: "gnu")
146 // c-hanging-comment-ender-p: nil
147 // indent-tabs-mode: nil