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
27 * For the livesearch feature (autodropdown of the results while you tip)
28 * you'll have to copy livesearch.js from http://blog.bitflux.ch/wiki/LiveSearch
29 * to themes/default/, change the liveSearchReq.open line to:
30 liveSearchReq.open("GET", liveSearchURI + "?format=livesearch&paging=none&limit=25&s=" + document.forms.searchform.s.value);
31 * and define ENABLE_LIVESEARCH in config.ini to true.
33 * Better autodropdown's are in consideration:
34 * http://momche.net/publish/article.php?page=acdropdown)
39 require_once('lib/WikiTheme.php');
40 //require_once('themes/Sidebar/themeinfo.php');
42 class WikiTheme_blog extends WikiTheme {
44 function WikiTheme_blog ($theme_name='blog') {
45 $this->WikiTheme($theme_name);
46 $this->calendarInit(true);
49 /* overload to load from Sidebar */
50 function _findFile ($file, $missing_okay=false) {
51 if (file_exists($this->_path . "themes/".$this->_name."/$file"))
52 return "themes/".$this->_name."/$file";
53 if (file_exists($this->_path . "themes/Sidebar/$file"))
54 return "themes/Sidebar/$file";
55 return parent::_findFile($file, $missing_okay);
58 function _labelForAction ($action) {
60 case 'edit': return _("Edit");
61 case 'diff': return _("Diff");
62 case 'logout': return _("SignOut");
63 case 'login': return _("SignIn");
64 case 'lock': return _("Lock");
65 case 'unlock': return _("Unlock");
66 case 'remove': return _("Remove");
68 return gettext(ucfirst($action));
72 function getRecentChangesFormatter ($format) {
73 include_once($this->file('lib/RecentChanges.php'));
74 if (preg_match('/^rss|^sidebar/', $format))
75 return false; // use default
77 return '_blog_RecentChanges_BoxFormatter';
78 return '_blog_RecentChanges_Formatter';
81 /* TODO: use the blog summary as label instead of the pagename */
82 function linkExistingWikiWord($wikiword, $linktext = '', $version = false) {
84 if ($version !== false and !$this->HTML_DUMP_SUFFIX)
85 $url = WikiURL($wikiword, array('version' => $version));
87 $url = WikiURL($wikiword);
89 // Extra steps for dumping page to an html file.
90 if ($this->HTML_DUMP_SUFFIX) {
91 $url = preg_replace('/^\./', '%2e', $url); // dot pages
94 $link = HTML::a(array('href' => $url));
96 if (isa($wikiword, 'WikiPageName'))
97 $default_text = $wikiword->shortName;
99 $default_text = $wikiword;
101 if (!empty($linktext)) {
102 $link->pushContent($linktext);
103 $link->setAttr('class', 'named-wiki');
104 $link->setAttr('title', $this->maybeSplitWikiWord($default_text));
107 //TODO: check if wikiblog
108 $link->pushContent($this->maybeSplitWikiWord($default_text));
109 $link->setAttr('class', 'wiki');
111 if ($request->getArg('frame'))
112 $link->setAttr('target', '_top');
117 // CSS file defines fonts, colors and background images for this
120 // override sidebar definitions:
121 $this->setDefaultCSS(_("blog"), 'Kubrick.css');
123 $this->addMoreHeaders($this->_CSSlink(0, $this->_findFile('IEFixes.css'),'all'));
125 $this->addButtonAlias(_("(diff)"), "[diff]" );
126 $this->addButtonAlias("...", "alltime");
128 $this->setButtonSeparator("");
131 * WikiWords can automatically be split by inserting spaces between
132 * the words. The default is to leave WordsSmashedTogetherLikeSo.
134 $this->setAutosplitWikiWords(false);
137 * If true (default) show create '?' buttons on not existing pages, even if the
138 * user is not signed in.
139 * If false, anon users get no links and it looks cleaner, but then they
140 * cannot easily fix missing pages.
142 $this->setAnonEditUnknownLinks(false);
145 * You may adjust the formats used for formatting dates and times
146 * below. (These examples give the default formats.)
147 * Formats are given as format strings to PHP strftime() function See
148 * http://www.php.net/manual/en/function.strftime.php for details.
149 * Do not include the server's zone (%Z), times are converted to the
152 //$this->setDateFormat("%B %d, %Y");
153 $this->setDateFormat("%A, %B %e, %Y"); // must not contain time
154 $this->setTimeFormat("%H:%M:%S");
158 $WikiTheme = new WikiTheme_blog('blog');
159 define("PAGETRAIL_ARROW", " ยป ");
162 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
163 // (c-file-style: "gnu")
168 // c-hanging-comment-ender-p: nil
169 // indent-tabs-mode: nil