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 an appearance ("theme") of PhpWiki similar to the
11 * Wordpress Pattern Repository.
12 * @author: Mike Pickering
15 require_once 'lib/WikiTheme.php';
17 class WikiTheme_Wordpress extends WikiTheme
20 function linkUnknownWikiWord($wikiword, $linktext = '')
23 if (isa($wikiword, 'WikiPageName')) {
24 $default_text = $wikiword->shortName;
25 $wikiword = $wikiword->name;
27 $default_text = $wikiword;
30 $url = WikiURL($wikiword, array('action' => 'create'));
31 $link = HTML::span(HTML::a(array('href' => $url, 'rel' => 'nofollow'), '?'));
33 if (!empty($linktext)) {
34 $link->unshiftContent(HTML::u($linktext));
35 $link->setAttr('class', 'named-wikiunknown');
37 $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($default_text)));
38 $link->setAttr('class', 'wikiunknown');
44 function getRecentChangesFormatter($format)
46 include_once($this->file('lib/RecentChanges.php'));
47 if (preg_match('/^rss|^sidebar/', $format))
48 return false; // use default
49 return '_Wordpress_RecentChanges_Formatter';
52 function getPageHistoryFormatter($format)
54 include_once($this->file('lib/RecentChanges.php'));
55 if (preg_match('/^rss|^sidebar/', $format))
56 return false; // use default
57 return '_Wordpress_PageHistory_Formatter';
62 // CSS file defines fonts, colors and background images for this
63 // style. The companion '*-heavy.css' file isn't defined, it's just
64 // expected to be in the same directory that the base style is in.
66 $this->setDefaultCSS('Wordpress', 'Wordpress.css');
67 $this->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen');
68 $this->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
69 $this->addAlternateCSS('PhpWiki', 'phpwiki.css');
72 * The logo image appears on every page and links to the HomePage.
74 //$this->addImageAlias('logo', 'logo.png');
77 * The Signature image is shown after saving an edited page. If this
78 * is not set, any signature defined in index.php will be used. If it
79 * is not defined by index.php or in here then the "Thank you for
80 * editing..." screen will be omitted.
82 $this->addImageAlias('signature', 'signature.png');
88 $this->setButtonSeparator(' ');
91 * WikiWords can automatically be split by inserting spaces between
92 * the words. The default is to leave WordsSmashedTogetherLikeSo.
94 $this->setAutosplitWikiWords(false);
97 * You may adjust the formats used for formatting dates and times
98 * below. (These examples give the default formats.)
99 * Formats are given as format strings to PHP strftime() function See
100 * http://www.php.net/manual/en/function.strftime.php for details.
101 * Do not include the server's zone (%Z), times are converted to the
104 $this->setDateFormat("%B %d, %Y", false);
108 $WikiTheme = new WikiTheme_Wordpress('Wordpress');
114 // c-hanging-comment-ender-p: nil
115 // indent-tabs-mode: nil