]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/Wordpress/themeinfo.php
Harmonize file footer
[SourceForge/phpwiki.git] / themes / Wordpress / themeinfo.php
1 <?php
2 // Avoid direct call to this file.
3 // PHPWIKI_VERSION is defined in lib/prepend.php
4 if (!defined('PHPWIKI_VERSION')) {
5     header("Location: /");
6     exit;
7 }
8
9 // rcs_id('$Id$');
10
11 /*
12  * This file defines an appearance ("theme") of PhpWiki similar to the
13  * Wordpress Pattern Repository.
14  * @author: Mike Pickering
15  */
16
17 require_once('lib/WikiTheme.php');
18
19 class WikiTheme_Wordpress extends WikiTheme {
20
21     function linkUnknownWikiWord($wikiword, $linktext = '') {
22         global $request;
23         if (isa($wikiword, 'WikiPageName')) {
24             $default_text = $wikiword->shortName;
25             $wikiword = $wikiword->name;
26         }
27         else {
28             $default_text = $wikiword;
29         }
30       
31         $url = WikiURL($wikiword, array('action' => 'create'));
32         $link = HTML::span(HTML::a(array('href' => $url, 'rel' => 'nofollow'), '?'));
33
34         if (!empty($linktext)) {
35             $link->unshiftContent(HTML::u($linktext));
36             $link->setAttr('class', 'named-wikiunknown');
37         }
38         else {
39             $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($default_text)));
40             $link->setAttr('class', 'wikiunknown');
41         }
42
43         return $link;
44     }
45     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';
50     }
51
52     function getPageHistoryFormatter ($format) {
53         include_once($this->file('lib/RecentChanges.php'));
54         if (preg_match('/^rss|^sidebar/', $format))
55             return false;       // use default
56         return '_Wordpress_PageHistory_Formatter';
57     }
58
59     function load() {
60         // CSS file defines fonts, colors and background images for this
61         // style.  The companion '*-heavy.css' file isn't defined, it's just
62         // expected to be in the same directory that the base style is in.
63
64         $this->setDefaultCSS('Wordpress', 'Wordpress.css');
65         $this->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen');
66         $this->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
67         $this->addAlternateCSS('PhpWiki', 'phpwiki.css');
68
69         /**
70          * The logo image appears on every page and links to the HomePage.
71          */
72         //$this->addImageAlias('logo', 'logo.png');
73
74         /**
75          * The Signature image is shown after saving an edited page. If this
76          * is not set, any signature defined in index.php will be used. If it
77          * is not defined by index.php or in here then the "Thank you for
78          * editing..." screen will be omitted.
79          */
80         $this->addImageAlias('signature', 'signature.png');
81
82         /*
83          * Link icons.
84          */
85         //$this->setLinkIcon('http');
86         //$this->setLinkIcon('https');
87         //$this->setLinkIcon('ftp');
88         //$this->setLinkIcon('mailto');
89         //$this->setLinkIcon('interwiki');
90         //$this->setLinkIcon('*', 'url');
91
92         $this->setButtonSeparator(' ');
93
94         /**
95          * WikiWords can automatically be split by inserting spaces between
96          * the words. The default is to leave WordsSmashedTogetherLikeSo.
97          */
98         $this->setAutosplitWikiWords(false);
99
100         /*
101          * You may adjust the formats used for formatting dates and times
102          * below.  (These examples give the default formats.)
103          * Formats are given as format strings to PHP strftime() function See
104          * http://www.php.net/manual/en/function.strftime.php for details.
105          * Do not include the server's zone (%Z), times are converted to the
106          * user's time zone.
107          */
108         $this->setDateFormat("%B %d, %Y", false);
109     }
110 }
111
112 $WikiTheme = new WikiTheme_Wordpress('Wordpress');
113
114 // Local Variables:
115 // mode: php
116 // tab-width: 8
117 // c-basic-offset: 4
118 // c-hanging-comment-ender-p: nil
119 // indent-tabs-mode: nil
120 // End: 
121 ?>