]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/Wordpress/themeinfo.php
pgsrc/CreatePagePlugin
[SourceForge/phpwiki.git] / themes / Wordpress / themeinfo.php
1 <?php
2 rcs_id('$Id: themeinfo.php,v 1.3 2004-04-11 10:42:03 rurban Exp $');
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     function linkUnknownWikiWord($wikiword, $linktext = '') {
14         global $request;
15         if (isa($wikiword, 'WikiPageName')) {
16             $default_text = $wikiword->shortName;
17             $wikiword = $wikiword->name;
18         }
19         else {
20             $default_text = $wikiword;
21         }
22         
23         $url = WikiURL($wikiword, array('action' => 'create'));
24         $link = HTML::span(HTML::a(array('href' => $url), '?'));
25
26         if (!empty($linktext)) {
27             $link->unshiftContent(HTML::u($linktext));
28             $link->setAttr('class', 'named-wikiunknown');
29         }
30         else {
31             $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($default_text)));
32             $link->setAttr('class', 'wikiunknown');
33         }
34         if ($request->getArg('frame'))
35             $link->setAttr('target', '_top');
36         
37         return $link;
38     }
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';
44     }
45
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';
51     }
52 }
53
54 $Theme = new Theme_Wordpress('Wordpress');
55
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.
59
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');
64
65 /**
66  * The logo image appears on every page and links to the HomePage.
67  */
68 //$Theme->addImageAlias('logo', 'logo.png');
69
70 /**
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.
75  */
76 $Theme->addImageAlias('signature', 'signature.png');
77
78 /*
79  * Link icons.
80  */
81 //$Theme->setLinkIcon('http');
82 //$Theme->setLinkIcon('https');
83 //$Theme->setLinkIcon('ftp');
84 //$Theme->setLinkIcon('mailto');
85 //$Theme->setLinkIcon('interwiki');
86 //$Theme->setLinkIcon('*', 'url');
87
88 $Theme->setButtonSeparator(' ');
89
90 /**
91  * WikiWords can automatically be split by inserting spaces between
92  * the words. The default is to leave WordsSmashedTogetherLikeSo.
93  */
94 $Theme->setAutosplitWikiWords(false);
95
96 /*
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
102  * user's time zone.
103  */
104 $Theme->setDateFormat("%B %d, %Y", false);
105
106
107 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
108 // (c-file-style: "gnu")
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:   
116 ?>