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