]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/Wordpress/themeinfo.php
Activated Id substitution for Subversion
[SourceForge/phpwiki.git] / themes / Wordpress / themeinfo.php
1 <?php
2 rcs_id('$Id$');
3
4 /*
5  * This file defines an appearance ("theme") of PhpWiki similar to the 
6  * Wordpress Pattern Repository.
7  * @author: Mike Pickering
8  */
9
10 require_once('lib/Theme.php');
11
12 class Theme_Wordpress extends Theme {
13
14     function linkUnknownWikiWord($wikiword, $linktext = '') {
15         global $request;
16         if (isa($wikiword, 'WikiPageName')) {
17             $default_text = $wikiword->shortName;
18             $wikiword = $wikiword->name;
19         }
20         else {
21             $default_text = $wikiword;
22         }
23         
24         $url = WikiURL($wikiword, array('action' => 'create'));
25         $link = HTML::span(HTML::a(array('href' => $url, 'rel' => 'nofollow'), '?'));
26
27         if (!empty($linktext)) {
28             $link->unshiftContent(HTML::u($linktext));
29             $link->setAttr('class', 'named-wikiunknown');
30         }
31         else {
32             $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($default_text)));
33             $link->setAttr('class', 'wikiunknown');
34         }
35         if ($request->getArg('frame'))
36             $link->setAttr('target', '_top');
37         
38         return $link;
39     }
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';
45     }
46
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';
52     }
53
54     function load() {
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.
58
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');
63
64         /**
65          * The logo image appears on every page and links to the HomePage.
66          */
67         //$this->addImageAlias('logo', 'logo.png');
68
69         /**
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.
74          */
75         $this->addImageAlias('signature', 'signature.png');
76
77         /*
78          * Link icons.
79          */
80         //$this->setLinkIcon('http');
81         //$this->setLinkIcon('https');
82         //$this->setLinkIcon('ftp');
83         //$this->setLinkIcon('mailto');
84         //$this->setLinkIcon('interwiki');
85         //$this->setLinkIcon('*', 'url');
86
87         $this->setButtonSeparator(' ');
88
89         /**
90          * WikiWords can automatically be split by inserting spaces between
91          * the words. The default is to leave WordsSmashedTogetherLikeSo.
92          */
93         $this->setAutosplitWikiWords(false);
94
95         /*
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
101          * user's time zone.
102          */
103         $this->setDateFormat("%B %d, %Y", false);
104     }
105 }
106
107 $WikiTheme = new Theme_Wordpress('Wordpress');
108
109
110 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
111 // (c-file-style: "gnu")
112 // Local Variables:
113 // mode: php
114 // tab-width: 8
115 // c-basic-offset: 4
116 // c-hanging-comment-ender-p: nil
117 // indent-tabs-mode: nil
118 // End:   
119 ?>