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)
100 if ($version !== false and !$this->HTML_DUMP_SUFFIX)
101 $url = WikiURL($wikiword, array('version' => $version));
103 $url = WikiURL($wikiword);
105 // Extra steps for dumping page to an html file.
106 if ($this->HTML_DUMP_SUFFIX) {
107 $url = preg_replace('/^\./', '%2e', $url); // dot pages
110 $link = HTML::a(array('href' => $url));
112 if (isa($wikiword, 'WikiPageName'))
113 $default_text = $wikiword->shortName;
115 $default_text = $wikiword;
117 if (!empty($linktext)) {
118 $link->pushContent($linktext);
119 $link->setAttr('class', 'named-wiki');
120 $link->setAttr('title', $this->maybeSplitWikiWord($default_text));
122 //TODO: check if wikiblog
123 $link->pushContent($this->maybeSplitWikiWord($default_text));
124 $link->setAttr('class', 'wiki');
131 // CSS file defines fonts, colors and background images for this
134 // override sidebar definitions:
135 $this->setDefaultCSS(_("blog"), 'Kubrick.css');
137 $this->addMoreHeaders($this->_CSSlink(0, $this->_findFile('IEFixes.css'), 'all'));
139 $this->addButtonAlias(_("(diff)"), "[diff]");
140 $this->addButtonAlias("...", "alltime");
142 $this->setButtonSeparator("");
145 * WikiWords can automatically be split by inserting spaces between
146 * the words. The default is to leave WordsSmashedTogetherLikeSo.
148 $this->setAutosplitWikiWords(false);
151 * If true (default) show create '?' buttons on not existing pages, even if the
152 * user is not signed in.
153 * If false, anon users get no links and it looks cleaner, but then they
154 * cannot easily fix missing pages.
156 $this->setAnonEditUnknownLinks(false);
159 * You may adjust the formats used for formatting dates and times
160 * below. (These examples give the default formats.)
161 * Formats are given as format strings to PHP strftime() function See
162 * http://www.php.net/manual/en/function.strftime.php for details.
163 * Do not include the server's zone (%Z), times are converted to the
166 //$this->setDateFormat("%B %d, %Y");
167 $this->setDateFormat("%A, %B %e, %Y"); // must not contain time
168 $this->setTimeFormat("%H:%M:%S");
172 $WikiTheme = new WikiTheme_blog('blog');
173 define("PAGETRAIL_ARROW", " ยป ");
179 // c-hanging-comment-ender-p: nil
180 // indent-tabs-mode: nil