]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/Portland/themeinfo.php
Reformat code
[SourceForge/phpwiki.git] / themes / Portland / 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 Portland Pattern Repository.
11  */
12
13 require_once 'lib/WikiTheme.php';
14
15 class WikiTheme_Portland extends WikiTheme
16 {
17
18     function linkUnknownWikiWord($wikiword, $linktext = '')
19     {
20         global $request;
21         if (isa($wikiword, 'WikiPageName')) {
22             $default_text = $wikiword->shortName;
23             $wikiword = $wikiword->name;
24         } else {
25             $default_text = $wikiword;
26         }
27
28         $url = WikiURL($wikiword, array('action' => 'create'));
29         $link = HTML::span(HTML::a(array('href' => $url, 'rel' => 'nofollow'), '?'));
30
31         if (!empty($linktext)) {
32             $link->unshiftContent(HTML::u($linktext));
33             $link->setAttr('class', 'named-wikiunknown');
34         } else {
35             $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($default_text)));
36             $link->setAttr('class', 'wikiunknown');
37         }
38
39         return $link;
40     }
41
42     function getRecentChangesFormatter($format)
43     {
44         include_once($this->file('lib/RecentChanges.php'));
45         if (preg_match('/^rss|^sidebar/', $format))
46             return false; // use default
47         return '_Portland_RecentChanges_Formatter';
48     }
49
50     function getPageHistoryFormatter($format)
51     {
52         include_once($this->file('lib/RecentChanges.php'));
53         if (preg_match('/^rss|^sidebar/', $format))
54             return false; // use default
55         return '_Portland_PageHistory_Formatter';
56     }
57
58     function load()
59     {
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('Portland', 'portland.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', WIKI_NAME . 'logo.png');
73
74         /**
75          * The Signature image is shown after saving an edited page. If this
76          * is set to false then the "Thank you for editing..." screen will
77          * be omitted.
78          */
79         $this->addImageAlias('signature', WIKI_NAME . "Signature.png");
80         // Uncomment this next line to disable the signature.
81         //$this->addImageAlias('signature', false);
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
108 $WikiTheme = new WikiTheme_Portland('Portland');
109
110 // Local Variables:
111 // mode: php
112 // tab-width: 8
113 // c-basic-offset: 4
114 // c-hanging-comment-ender-p: nil
115 // indent-tabs-mode: nil
116 // End: