2 // Avoid direct call to this file.
3 // PHPWIKI_VERSION is defined in lib/prepend.php
4 if (!defined('PHPWIKI_VERSION')) {
12 * This file defines a blog theme for PhpWiki,
13 * based on Rui Carmo's excellent http://the.taoofmac.com/space/
14 * which is based on the Kubrick theme: http://binarybonsai.com/kubrick/
15 * The layout was designed and built by Michael Heilemann,
16 * whose blog you will find at http://binarybonsai.com/
18 * [Stanley Kubrick]"Good afternoon, gentlemen. I am a HAL 9000
19 * computer. I became operational at the H.A.L. plant in Urbana,
20 * Illinois on the 12th of January 1992. My instructor was
21 * Mr. Langley, and he taught me to sing a song. If you'd like to hear
22 * it I can sing it for you."
24 * The CSS, XHTML and design is released under GPL:
25 * http://www.opensource.org/licenses/gpl-license.php
27 * Default is a one-person (ADMIN_USER) blog (at the BlogHomePage), but
28 * other blogs are also enabled for every authenticated user.
30 * Actionbar: Edit, Home, About, Archives, News, ..., Info [ Search ]
31 * PageTrail: > .. > ..
32 * Right sidebar boxes: Archives, Syndication, Links, GoogleAds
34 * For the livesearch feature (autodropdown of the results while you tip)
35 * you'll have to copy livesearch.js from http://blog.bitflux.ch/wiki/LiveSearch
36 * to themes/default/, change the liveSearchReq.open line to:
37 liveSearchReq.open("GET", liveSearchURI + "?format=livesearch&paging=none&limit=25&s=" + document.forms.searchform.s.value);
38 * and define ENABLE_LIVESEARCH in config.ini to true.
40 * Better autodropdown's are in consideration:
41 * http://momche.net/publish/article.php?page=acdropdown)
46 require_once('lib/WikiTheme.php');
47 //require_once('themes/Sidebar/themeinfo.php');
49 class WikiTheme_blog extends WikiTheme {
51 function WikiTheme_blog ($theme_name='blog') {
52 $this->WikiTheme($theme_name);
53 $this->calendarInit(true);
56 /* overload to load from Sidebar */
57 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) {
67 case 'edit': return _("Edit");
68 case 'diff': return _("Diff");
69 case 'logout': return _("SignOut");
70 case 'login': return _("SignIn");
71 case 'lock': return _("Lock");
72 case 'unlock': return _("Unlock");
73 case 'remove': return _("Remove");
75 return gettext(ucfirst($action));
79 function getRecentChangesFormatter ($format) {
80 include_once($this->file('lib/RecentChanges.php'));
81 if (preg_match('/^rss|^sidebar/', $format))
82 return false; // use default
84 return '_blog_RecentChanges_BoxFormatter';
85 return '_blog_RecentChanges_Formatter';
88 /* TODO: use the blog summary as label instead of the pagename */
89 function linkExistingWikiWord($wikiword, $linktext = '', $version = false) {
91 if ($version !== false and !$this->HTML_DUMP_SUFFIX)
92 $url = WikiURL($wikiword, array('version' => $version));
94 $url = WikiURL($wikiword);
96 // Extra steps for dumping page to an html file.
97 if ($this->HTML_DUMP_SUFFIX) {
98 $url = preg_replace('/^\./', '%2e', $url); // dot pages
101 $link = HTML::a(array('href' => $url));
103 if (isa($wikiword, 'WikiPageName'))
104 $default_text = $wikiword->shortName;
106 $default_text = $wikiword;
108 if (!empty($linktext)) {
109 $link->pushContent($linktext);
110 $link->setAttr('class', 'named-wiki');
111 $link->setAttr('title', $this->maybeSplitWikiWord($default_text));
114 //TODO: check if wikiblog
115 $link->pushContent($this->maybeSplitWikiWord($default_text));
116 $link->setAttr('class', 'wiki');
118 if ($request->getArg('frame'))
119 $link->setAttr('target', '_top');
124 // CSS file defines fonts, colors and background images for this
127 // override sidebar definitions:
128 $this->setDefaultCSS(_("blog"), 'Kubrick.css');
130 $this->addMoreHeaders($this->_CSSlink(0, $this->_findFile('IEFixes.css'),'all'));
132 $this->addButtonAlias(_("(diff)"), "[diff]" );
133 $this->addButtonAlias("...", "alltime");
135 $this->setButtonSeparator("");
138 * WikiWords can automatically be split by inserting spaces between
139 * the words. The default is to leave WordsSmashedTogetherLikeSo.
141 $this->setAutosplitWikiWords(false);
144 * If true (default) show create '?' buttons on not existing pages, even if the
145 * user is not signed in.
146 * If false, anon users get no links and it looks cleaner, but then they
147 * cannot easily fix missing pages.
149 $this->setAnonEditUnknownLinks(false);
152 * You may adjust the formats used for formatting dates and times
153 * below. (These examples give the default formats.)
154 * Formats are given as format strings to PHP strftime() function See
155 * http://www.php.net/manual/en/function.strftime.php for details.
156 * Do not include the server's zone (%Z), times are converted to the
159 //$this->setDateFormat("%B %d, %Y");
160 $this->setDateFormat("%A, %B %e, %Y"); // must not contain time
161 $this->setTimeFormat("%H:%M:%S");
165 $WikiTheme = new WikiTheme_blog('blog');
166 define("PAGETRAIL_ARROW", " ยป ");
169 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
170 // (c-file-style: "gnu")
175 // c-hanging-comment-ender-p: nil
176 // indent-tabs-mode: nil