]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/Portland/themeinfo.php
Allow bold, italics or underlined for numbers
[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         if (isa($wikiword, 'WikiPageName')) {
21             $default_text = $wikiword->shortName;
22             $wikiword = $wikiword->name;
23         } else {
24             $default_text = $wikiword;
25         }
26
27         $url = WikiURL($wikiword, array('action' => 'create'));
28         $link = HTML::span(HTML::a(array('href' => $url, 'rel' => 'nofollow'), '?'));
29
30         if (!empty($linktext)) {
31             $link->unshiftContent(HTML::u($linktext));
32             $link->setAttr('class', 'named-wikiunknown');
33         } else {
34             $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($default_text)));
35             $link->setAttr('class', 'wikiunknown');
36         }
37
38         return $link;
39     }
40
41     function getRecentChangesFormatter($format)
42     {
43         include_once($this->file('lib/RecentChanges.php'));
44         if (preg_match('/^rss|^sidebar/', $format))
45             return false; // use default
46         return '_Portland_RecentChanges_Formatter';
47     }
48
49     function getPageHistoryFormatter($format)
50     {
51         include_once($this->file('lib/RecentChanges.php'));
52         if (preg_match('/^rss|^sidebar/', $format))
53             return false; // use default
54         return '_Portland_PageHistory_Formatter';
55     }
56
57     function load()
58     {
59         // CSS file defines fonts, colors and background images for this
60         // style.  The companion '*-heavy.css' file isn't defined, it's just
61         // expected to be in the same directory that the base style is in.
62
63         $this->setDefaultCSS('Portland', 'portland.css');
64         $this->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen');
65         $this->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
66         $this->addAlternateCSS('PhpWiki', 'phpwiki.css');
67
68         /**
69          * The logo image appears on every page and links to the HomePage.
70          */
71         $this->addImageAlias('logo', WIKI_NAME . 'logo.png');
72
73         /**
74          * The Signature image is shown after saving an edited page. If this
75          * is set to false then the "Thank you for editing..." screen will
76          * be omitted.
77          */
78         $this->addImageAlias('signature', WIKI_NAME . "Signature.png");
79         // Uncomment this next line to disable the signature.
80         //$this->addImageAlias('signature', false);
81
82         /*
83          * Link icons.
84          */
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 // 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: