]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/Wordpress/themeinfo.php
Update WikiAdminSearchReplace plugin
[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 /*
10  * This file defines an appearance ("theme") of PhpWiki similar to the
11  * Wordpress Pattern Repository.
12  * @author: Mike Pickering
13  */
14
15 require_once 'lib/WikiTheme.php';
16
17 class WikiTheme_Wordpress extends WikiTheme
18 {
19
20     function linkUnknownWikiWord($wikiword, $linktext = '')
21     {
22         if (isa($wikiword, 'WikiPageName')) {
23             $default_text = $wikiword->shortName;
24             $wikiword = $wikiword->name;
25         } else {
26             $default_text = $wikiword;
27         }
28
29         $url = WikiURL($wikiword, array('action' => 'create'));
30         $link = HTML::span(HTML::a(array('href' => $url, 'rel' => 'nofollow'), '?'));
31
32         if (!empty($linktext)) {
33             $link->unshiftContent(HTML::u($linktext));
34             $link->setAttr('class', 'named-wikiunknown');
35         } else {
36             $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($default_text)));
37             $link->setAttr('class', 'wikiunknown');
38         }
39
40         return $link;
41     }
42
43     function getRecentChangesFormatter($format)
44     {
45         include_once($this->file('lib/RecentChanges.php'));
46         if (preg_match('/^rss|^sidebar/', $format))
47             return false; // use default
48         return '_Wordpress_RecentChanges_Formatter';
49     }
50
51     function getPageHistoryFormatter($format)
52     {
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     {
61         // CSS file defines fonts, colors and background images for this
62         // style.  The companion '*-heavy.css' file isn't defined, it's just
63         // expected to be in the same directory that the base style is in.
64
65         $this->setDefaultCSS('Wordpress', 'Wordpress.css');
66         $this->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen');
67         $this->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
68         $this->addAlternateCSS('PhpWiki', 'phpwiki.css');
69
70         /**
71          * The logo image appears on every page and links to the HomePage.
72          */
73         //$this->addImageAlias('logo', 'logo.png');
74
75         /**
76          * The Signature image is shown after saving an edited page. If this
77          * is not set, any signature defined in index.php will be used. If it
78          * is not defined by index.php or in here then the "Thank you for
79          * editing..." screen will be omitted.
80          */
81         $this->addImageAlias('signature', 'signature.png');
82
83         /*
84          * Link icons.
85          */
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 WikiTheme_Wordpress('Wordpress');
108
109 // Local Variables:
110 // mode: php
111 // tab-width: 8
112 // c-basic-offset: 4
113 // c-hanging-comment-ender-p: nil
114 // indent-tabs-mode: nil
115 // End: