2 rcs_id('$Id: themeinfo.php,v 1.3 2004-04-11 10:42:03 rurban Exp $');
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 {
13 function linkUnknownWikiWord($wikiword, $linktext = '') {
15 if (isa($wikiword, 'WikiPageName')) {
16 $default_text = $wikiword->shortName;
17 $wikiword = $wikiword->name;
20 $default_text = $wikiword;
23 $url = WikiURL($wikiword, array('action' => 'create'));
24 $link = HTML::span(HTML::a(array('href' => $url), '?'));
26 if (!empty($linktext)) {
27 $link->unshiftContent(HTML::u($linktext));
28 $link->setAttr('class', 'named-wikiunknown');
31 $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($default_text)));
32 $link->setAttr('class', 'wikiunknown');
34 if ($request->getArg('frame'))
35 $link->setAttr('target', '_top');
39 function getRecentChangesFormatter ($format) {
40 include_once($this->file('lib/RecentChanges.php'));
41 if (preg_match('/^rss|^sidebar/', $format))
42 return false; // use default
43 return '_Wordpress_RecentChanges_Formatter';
46 function getPageHistoryFormatter ($format) {
47 include_once($this->file('lib/RecentChanges.php'));
48 if (preg_match('/^rss|^sidebar/', $format))
49 return false; // use default
50 return '_Wordpress_PageHistory_Formatter';
54 $Theme = new Theme_Wordpress('Wordpress');
56 // CSS file defines fonts, colors and background images for this
57 // style. The companion '*-heavy.css' file isn't defined, it's just
58 // expected to be in the same directory that the base style is in.
60 $Theme->setDefaultCSS('Wordpress', 'Wordpress.css');
61 $Theme->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen');
62 $Theme->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
63 $Theme->addAlternateCSS('PhpWiki', 'phpwiki.css');
66 * The logo image appears on every page and links to the HomePage.
68 //$Theme->addImageAlias('logo', 'logo.png');
71 * The Signature image is shown after saving an edited page. If this
72 * is not set, any signature defined in index.php will be used. If it
73 * is not defined by index.php or in here then the "Thank you for
74 * editing..." screen will be omitted.
76 $Theme->addImageAlias('signature', 'signature.png');
81 //$Theme->setLinkIcon('http');
82 //$Theme->setLinkIcon('https');
83 //$Theme->setLinkIcon('ftp');
84 //$Theme->setLinkIcon('mailto');
85 //$Theme->setLinkIcon('interwiki');
86 //$Theme->setLinkIcon('*', 'url');
88 $Theme->setButtonSeparator(' ');
91 * WikiWords can automatically be split by inserting spaces between
92 * the words. The default is to leave WordsSmashedTogetherLikeSo.
94 $Theme->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 $Theme->setDateFormat("%B %d, %Y", false);
107 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
108 // (c-file-style: "gnu")
113 // c-hanging-comment-ender-p: nil
114 // indent-tabs-mode: nil