5 * This file defines an appearance ("theme") of PhpWiki similar to the
6 * Wordpress Pattern Repository.
7 * @author: Mike Pickering
10 require_once('lib/Theme.php');
12 class Theme_Wordpress extends Theme {
14 function linkUnknownWikiWord($wikiword, $linktext = '') {
16 if (isa($wikiword, 'WikiPageName')) {
17 $default_text = $wikiword->shortName;
18 $wikiword = $wikiword->name;
21 $default_text = $wikiword;
24 $url = WikiURL($wikiword, array('action' => 'create'));
25 $link = HTML::span(HTML::a(array('href' => $url, 'rel' => 'nofollow'), '?'));
27 if (!empty($linktext)) {
28 $link->unshiftContent(HTML::u($linktext));
29 $link->setAttr('class', 'named-wikiunknown');
32 $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($default_text)));
33 $link->setAttr('class', 'wikiunknown');
35 if ($request->getArg('frame'))
36 $link->setAttr('target', '_top');
40 function getRecentChangesFormatter ($format) {
41 include_once($this->file('lib/RecentChanges.php'));
42 if (preg_match('/^rss|^sidebar/', $format))
43 return false; // use default
44 return '_Wordpress_RecentChanges_Formatter';
47 function getPageHistoryFormatter ($format) {
48 include_once($this->file('lib/RecentChanges.php'));
49 if (preg_match('/^rss|^sidebar/', $format))
50 return false; // use default
51 return '_Wordpress_PageHistory_Formatter';
55 // CSS file defines fonts, colors and background images for this
56 // style. The companion '*-heavy.css' file isn't defined, it's just
57 // expected to be in the same directory that the base style is in.
59 $this->setDefaultCSS('Wordpress', 'Wordpress.css');
60 $this->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen');
61 $this->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
62 $this->addAlternateCSS('PhpWiki', 'phpwiki.css');
65 * The logo image appears on every page and links to the HomePage.
67 //$this->addImageAlias('logo', 'logo.png');
70 * The Signature image is shown after saving an edited page. If this
71 * is not set, any signature defined in index.php will be used. If it
72 * is not defined by index.php or in here then the "Thank you for
73 * editing..." screen will be omitted.
75 $this->addImageAlias('signature', 'signature.png');
80 //$this->setLinkIcon('http');
81 //$this->setLinkIcon('https');
82 //$this->setLinkIcon('ftp');
83 //$this->setLinkIcon('mailto');
84 //$this->setLinkIcon('interwiki');
85 //$this->setLinkIcon('*', 'url');
87 $this->setButtonSeparator(' ');
90 * WikiWords can automatically be split by inserting spaces between
91 * the words. The default is to leave WordsSmashedTogetherLikeSo.
93 $this->setAutosplitWikiWords(false);
96 * You may adjust the formats used for formatting dates and times
97 * below. (These examples give the default formats.)
98 * Formats are given as format strings to PHP strftime() function See
99 * http://www.php.net/manual/en/function.strftime.php for details.
100 * Do not include the server's zone (%Z), times are converted to the
103 $this->setDateFormat("%B %d, %Y", false);
107 $WikiTheme = new Theme_Wordpress('Wordpress');
110 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
111 // (c-file-style: "gnu")
116 // c-hanging-comment-ender-p: nil
117 // indent-tabs-mode: nil