]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/Portland/themeinfo.php
rcs_id no longer makes sense with Subversion global version number
[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 // rcs_id('$Id$');
10
11 /*
12  * This file defines an appearance ("theme") of PhpWiki similar to the Portland Pattern Repository.
13  */
14
15 require_once('lib/WikiTheme.php');
16
17 class WikiTheme_Portland extends WikiTheme {
18
19     function linkUnknownWikiWord($wikiword, $linktext = '') {
20         global $request;
21         if (isa($wikiword, 'WikiPageName')) {
22             $default_text = $wikiword->shortName;
23             $wikiword = $wikiword->name;
24         }
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         }
36         else {
37             $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($default_text)));
38             $link->setAttr('class', 'wikiunknown');
39         }
40         if ($request->getArg('frame'))
41             $link->setAttr('target', '_top');
42
43         return $link;
44     }
45     function getRecentChangesFormatter ($format) {
46         include_once($this->file('lib/RecentChanges.php'));
47         if (preg_match('/^rss|^sidebar/', $format))
48             return false;       // use default
49         return '_Portland_RecentChanges_Formatter';
50     }
51
52     function getPageHistoryFormatter ($format) {
53         include_once($this->file('lib/RecentChanges.php'));
54         if (preg_match('/^rss|^sidebar/', $format))
55             return false;       // use default
56         return '_Portland_PageHistory_Formatter';
57     }
58
59     function load() {
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         //$this->setLinkIcon('http');
87         //$this->setLinkIcon('https');
88         //$this->setLinkIcon('ftp');
89         //$this->setLinkIcon('mailto');
90         //$this->setLinkIcon('interwiki');
91         //$this->setLinkIcon('*', 'url');
92
93         $this->setButtonSeparator(' ');
94
95         /**
96          * WikiWords can automatically be split by inserting spaces between
97          * the words. The default is to leave WordsSmashedTogetherLikeSo.
98          */
99         $this->setAutosplitWikiWords(false);
100
101         /*
102          * You may adjust the formats used for formatting dates and times
103          * below.  (These examples give the default formats.)
104          * Formats are given as format strings to PHP strftime() function See
105          * http://www.php.net/manual/en/function.strftime.php for details.
106          * Do not include the server's zone (%Z), times are converted to the
107          * user's time zone.
108          */
109         $this->setDateFormat("%B %d, %Y", false);
110
111     }
112 }
113
114 $WikiTheme = new WikiTheme_Portland('Portland');
115
116
117 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
118 // (c-file-style: "gnu")
119 // Local Variables:
120 // mode: php
121 // tab-width: 8
122 // c-basic-offset: 4
123 // c-hanging-comment-ender-p: nil
124 // indent-tabs-mode: nil
125 // End:   
126 ?>