2 // Avoid direct call to this file.
3 // PHPWIKI_VERSION is defined in lib/prepend.php
4 if (!defined('PHPWIKI_VERSION')) {
10 * This file defines a blog theme for PhpWiki,
11 * based on Rui Carmo's excellent http://the.taoofmac.com/space/
12 * which is based on the Kubrick theme: http://binarybonsai.com/kubrick/
13 * The layout was designed and built by Michael Heilemann,
14 * whose blog you will find at http://binarybonsai.com/
16 * [Stanley Kubrick]"Good afternoon, gentlemen. I am a HAL 9000
17 * computer. I became operational at the H.A.L. plant in Urbana,
18 * Illinois on the 12th of January 1992. My instructor was
19 * Mr. Langley, and he taught me to sing a song. If you'd like to hear
20 * it I can sing it for you."
22 * The CSS, XHTML and design is released under GPL:
23 * http://www.opensource.org/licenses/gpl-license.php
25 * Default is a one-person (ADMIN_USER) blog (at the BlogHomePage), but
26 * other blogs are also enabled for every authenticated user.
28 * Actionbar: Edit, Home, About, Archives, News, ..., Info [ Search ]
29 * PageTrail: > .. > ..
30 * Right sidebar boxes: Archives, Syndication, Links, GoogleAds
32 * For the livesearch feature (autodropdown of the results while you tip)
33 * you'll have to copy livesearch.js from http://blog.bitflux.ch/wiki/LiveSearch
34 * to themes/default/, change the liveSearchReq.open line to:
35 liveSearchReq.open("GET", liveSearchURI + "?format=livesearch&paging=none&limit=25&s=" + document.forms.searchform.s.value);
36 * and define ENABLE_LIVESEARCH in config.ini to true.
38 * Better autodropdown's are in consideration:
39 * http://momche.net/publish/article.php?page=acdropdown)
44 require_once 'lib/WikiTheme.php';
46 class WikiTheme_blog extends WikiTheme
49 function WikiTheme_blog($theme_name = 'blog')
51 $this->WikiTheme($theme_name);
52 $this->calendarInit(true);
55 /* overload to load from Sidebar */
56 function _findFile($file, $missing_okay = false)
58 if (file_exists($this->_path . "themes/" . $this->_name . "/$file"))
59 return "themes/" . $this->_name . "/$file";
60 if (file_exists($this->_path . "themes/Sidebar/$file"))
61 return "themes/Sidebar/$file";
62 return parent::_findFile($file, $missing_okay);
65 function _labelForAction($action)
83 return gettext(ucfirst($action));
87 function getRecentChangesFormatter($format)
89 include_once($this->file('lib/RecentChanges.php'));
90 if (preg_match('/^rss|^sidebar/', $format))
91 return false; // use default
93 return '_blog_RecentChanges_BoxFormatter';
94 return '_blog_RecentChanges_Formatter';
97 /* TODO: use the blog summary as label instead of the pagename */
98 function linkExistingWikiWord($wikiword, $linktext = '', $version = false)
101 if ($version !== false and !$this->HTML_DUMP_SUFFIX)
102 $url = WikiURL($wikiword, array('version' => $version));
104 $url = WikiURL($wikiword);
106 // Extra steps for dumping page to an html file.
107 if ($this->HTML_DUMP_SUFFIX) {
108 $url = preg_replace('/^\./', '%2e', $url); // dot pages
111 $link = HTML::a(array('href' => $url));
113 if (isa($wikiword, 'WikiPageName'))
114 $default_text = $wikiword->shortName;
116 $default_text = $wikiword;
118 if (!empty($linktext)) {
119 $link->pushContent($linktext);
120 $link->setAttr('class', 'named-wiki');
121 $link->setAttr('title', $this->maybeSplitWikiWord($default_text));
123 //TODO: check if wikiblog
124 $link->pushContent($this->maybeSplitWikiWord($default_text));
125 $link->setAttr('class', 'wiki');
132 // CSS file defines fonts, colors and background images for this
135 // override sidebar definitions:
136 $this->setDefaultCSS(_("blog"), 'Kubrick.css');
138 $this->addMoreHeaders($this->_CSSlink(0, $this->_findFile('IEFixes.css'), 'all'));
140 $this->addButtonAlias(_("(diff)"), "[diff]");
141 $this->addButtonAlias("...", "alltime");
143 $this->setButtonSeparator("");
146 * WikiWords can automatically be split by inserting spaces between
147 * the words. The default is to leave WordsSmashedTogetherLikeSo.
149 $this->setAutosplitWikiWords(false);
152 * If true (default) show create '?' buttons on not existing pages, even if the
153 * user is not signed in.
154 * If false, anon users get no links and it looks cleaner, but then they
155 * cannot easily fix missing pages.
157 $this->setAnonEditUnknownLinks(false);
160 * You may adjust the formats used for formatting dates and times
161 * below. (These examples give the default formats.)
162 * Formats are given as format strings to PHP strftime() function See
163 * http://www.php.net/manual/en/function.strftime.php for details.
164 * Do not include the server's zone (%Z), times are converted to the
167 //$this->setDateFormat("%B %d, %Y");
168 $this->setDateFormat("%A, %B %e, %Y"); // must not contain time
169 $this->setTimeFormat("%H:%M:%S");
173 $WikiTheme = new WikiTheme_blog('blog');
174 define("PAGETRAIL_ARROW", " ยป ");
180 // c-hanging-comment-ender-p: nil
181 // indent-tabs-mode: nil