]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/MacOSX/themeinfo.php
Updated themes to work properly with RecentChanges?format=sidebar
[SourceForge/phpwiki.git] / themes / MacOSX / themeinfo.php
1 <?php
2
3 rcs_id('$Id: themeinfo.php,v 1.46 2002-03-08 20:31:14 carstenklapp Exp $');
4
5 /**
6  * A PhpWiki theme inspired by the Aqua appearance of Mac OS X.
7  * 
8  * The images used with this theme depend on the PNG alpha channel to
9  * blend in with whatever background color or texture is on the page.
10  * When viewed with an older browser, the images may be incorrectly
11  * rendered with a thick solid black border. When viewed with a modern
12  * browser, the images will display with nice edges and blended
13  * shadows.
14  *
15  * The defaut link icons I want to move into this theme, and come up
16  * with some new linkicons for the default look. (Any ideas,
17  * feedback?)
18  *
19  * Do you like the icons used in the buttons?
20  *
21  * See buttons/README for more info on the buttons.
22  *
23  * The background image is a subtle brushed paper texture or stucco
24  * effect very close to white. If your monitor isn't calibrated well
25  * you may not see it.
26  * */
27
28 require_once('lib/Theme.php');
29
30 class Theme_MacOSX extends Theme {
31     function getCSS() {
32         // FIXME: this is a hack which will not be needed once
33         //        we have dynamic CSS.
34         $css = Theme::getCSS();
35         $css->pushcontent(HTML::style(array('type' => 'text/css'),
36                              new RawXml(sprintf("<!--\nbody {background-image: url(%s);}\n-->\n",
37                                                 $this->getImageURL('bgpaper8')))));
38                                 //for non-browse pages, like former editpage, message etc.
39                                 //$this->getImageURL('bggranular')));
40         return $css;
41     }
42
43     function getRecentChangesFormatter ($format) {
44         include_once($this->file('lib/RecentChanges.php'));
45         if (preg_match('/^rss|^sidebar/', $format))
46             return false;       // use default
47         return '_MacOSX_RecentChanges_Formatter';
48     }
49
50     function getPageHistoryFormatter ($format) {
51         include_once($this->file('lib/RecentChanges.php'));
52         if (preg_match('/^rss|^sidebar/', $format))
53             return false;       // use default
54         return '_MacOSX_PageHistory_Formatter';
55     }
56
57     function linkUnknownWikiWord($wikiword, $linktext = '') {
58         $url = WikiURL($wikiword, array('action' => 'edit'));
59         //$link = HTML::span(HTML::a(array('href' => $url), '?'));
60         $link = HTML::span($this->makeButton('?', $url));
61         
62
63         if (!empty($linktext)) {
64             $link->unshiftContent(HTML::u($linktext));
65             $link->setAttr('class', 'named-wikiunknown');
66         }
67         else {
68             $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($wikiword)));
69             $link->setAttr('class', 'wikiunknown');
70         }
71         
72         return $link;
73     }
74 }
75
76 $Theme = new Theme_MacOSX('MacOSX');
77
78 // CSS file defines fonts, colors and background images for this
79 // style.  The companion '*-heavy.css' file isn't defined, it's just
80 // expected to be in the same directory that the base style is in.
81 $Theme->setDefaultCSS("MacOSX", "MacOSX.css");
82 $Theme->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen');
83 $Theme->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
84
85 /**
86  * The logo image appears on every page and links to the HomePage.
87  */
88 //$Theme->addImageAlias('logo', 'logo.png');
89
90 /**
91  * The Signature image is shown after saving an edited page. If this
92  * is not set, any signature defined in index.php will be used. If it
93  * is not defined by index.php or in here then the "Thank you for
94  * editing..." screen will be omitted.
95  */
96 $Theme->addImageAlias('signature', 'signature.png');
97
98 /*
99  * Link icons.
100  */
101 $Theme->setLinkIcon('http');
102 $Theme->setLinkIcon('https');
103 $Theme->setLinkIcon('ftp');
104 $Theme->setLinkIcon('mailto');
105 $Theme->setLinkIcon('interwiki');
106 $Theme->setLinkIcon('*', 'url');
107
108 $Theme->setButtonSeparator(""); //use no separator instead of default
109
110 $Theme->addButtonAlias('?', 'uww');
111 $Theme->addButtonAlias(_("Lock Page"), "Lock Page");
112 $Theme->addButtonAlias(_("Unlock Page"), "Unlock Page");
113 $Theme->addButtonAlias(_("Page Locked"), "Page Locked");
114 $Theme->addButtonAlias("...", "alltime");
115
116 /**
117  * WikiWords can automatically be split by inserting spaces between
118  * the words. The default is to leave WordsSmashedTogetherLikeSo.
119  */
120 //$Theme->setAutosplitWikiWords(false);
121
122 /*
123  * You may adjust the formats used for formatting dates and times
124  * below.  (These examples give the default formats.)
125  * Formats are given as format strings to PHP strftime() function See
126  * http://www.php.net/manual/en/function.strftime.php for details.
127  * Do not include the server's zone (%Z), times are converted to the
128  * user's time zone.
129  */
130 $Theme->setDateFormat("%A, %B %e, %Y"); // must not contain time
131 $Theme->setTimeFormat("%l:%M:%S %p");
132
133 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
134 // (c-file-style: "gnu")
135 // Local Variables:
136 // mode: php
137 // tab-width: 8
138 // c-basic-offset: 4
139 // c-hanging-comment-ender-p: nil
140 // indent-tabs-mode: nil
141 // End:   
142 ?>