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 {
19 function linkUnknownWikiWord($wikiword, $linktext = '') {
21 if (isa($wikiword, 'WikiPageName')) {
22 $default_text = $wikiword->shortName;
23 $wikiword = $wikiword->name;
26 $default_text = $wikiword;
29 $url = WikiURL($wikiword, array('action' => 'create'));
30 $link = HTML::span(HTML::a(array('href' => $url, 'rel' => 'nofollow'), '?'));
32 if (!empty($linktext)) {
33 $link->unshiftContent(HTML::u($linktext));
34 $link->setAttr('class', 'named-wikiunknown');
37 $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($default_text)));
38 $link->setAttr('class', 'wikiunknown');
43 function getRecentChangesFormatter ($format) {
44 include_once($this->file('lib/RecentChanges.php'));
45 if (preg_match('/^rss|^sidebar/', $format))
46 return false; // use default
47 return '_Wordpress_RecentChanges_Formatter';
50 function getPageHistoryFormatter ($format) {
51 include_once($this->file('lib/RecentChanges.php'));
52 if (preg_match('/^rss|^sidebar/', $format))
53 return false; // use default
54 return '_Wordpress_PageHistory_Formatter';
58 // CSS file defines fonts, colors and background images for this
59 // style. The companion '*-heavy.css' file isn't defined, it's just
60 // expected to be in the same directory that the base style is in.
62 $this->setDefaultCSS('Wordpress', 'Wordpress.css');
63 $this->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen');
64 $this->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
65 $this->addAlternateCSS('PhpWiki', 'phpwiki.css');
68 * The logo image appears on every page and links to the HomePage.
70 //$this->addImageAlias('logo', 'logo.png');
73 * The Signature image is shown after saving an edited page. If this
74 * is not set, any signature defined in index.php will be used. If it
75 * is not defined by index.php or in here then the "Thank you for
76 * editing..." screen will be omitted.
78 $this->addImageAlias('signature', 'signature.png');
84 $this->setButtonSeparator(' ');
87 * WikiWords can automatically be split by inserting spaces between
88 * the words. The default is to leave WordsSmashedTogetherLikeSo.
90 $this->setAutosplitWikiWords(false);
93 * You may adjust the formats used for formatting dates and times
94 * below. (These examples give the default formats.)
95 * Formats are given as format strings to PHP strftime() function See
96 * http://www.php.net/manual/en/function.strftime.php for details.
97 * Do not include the server's zone (%Z), times are converted to the
100 $this->setDateFormat("%B %d, %Y", false);
104 $WikiTheme = new WikiTheme_Wordpress('Wordpress');
110 // c-hanging-comment-ender-p: nil
111 // indent-tabs-mode: nil