3 rcs_id('$Id: themeinfo.php,v 1.30 2002-01-19 22:32:02 dairiki Exp $');
6 * A PhpWiki theme inspired by the Aqua appearance of Mac OS X.
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
17 * Most of the images you will see a white area around the outside.
18 * Once the icons for the buttons have been finalized, the alpha
19 * channel will be added to eliminate the white parts.
21 * The button toolbars use tables for positioning. Yuck. (It will do
24 * Only English buttons are available. Full localization is coming.
26 * The CSS is still mostly the same as phpwiki.css. I'd like to change
27 * it a bit but have no specific plans yet. Just a general feeling
28 * that it should look and feel like a Mac interface: with subtle
29 * effects and a fine color scheme. Since I'm sick of the stripes
30 * Mr. Jobs thoughtfully plastered all over my screen, I've chosen a
31 * brushed paper (or stucco?) texture effect very close to white. If
32 * your monitor isn't calibrated well you might not even see it.
34 * Send me some feedback, do you like the icons used in the buttons?
36 * Automatic button generation for localized buttons isn't going to
37 * happen for this theme--there is a gradient across the glass surface
38 * of the button that only Mac OS X Aqua can generate. Chopping a
39 * button up and stamping it with localized words means a lot of
40 * tweaking to the blank button pieces to get the seams invisible, so
41 * a more authentic Mac OS X user experience is achived by producing
42 * the buttons by hand.
44 * The defaut link icons I want to move into this theme, and come up
45 * with some new linkicons for the default look. (Any ideas,
50 require_once('lib/Theme.php');
52 class Theme_MacOSX extends Theme {
54 // FIXME: this is a hack which will not be needed once
55 // we have dynamic CSS.
56 $css = Theme::getCSS();
57 $css .= Element('style', array('type' => 'text/css'),
58 sprintf("<!--\nbody {background-image: url(%s);}\n-->\n",
59 $this->getImageURL('bgpaper8')));
60 //for non-browse pages, like former editpage, message etc.
61 //$this->getImageURL('bggranular')));
65 function getRecentChangesFormatter ($format) {
66 include_once($this->file('lib/RecentChanges.php'));
67 if (preg_match('/^rss/', $format))
68 return false; // use default
69 return '_MacOSX_RecentChanges_Formatter';
72 function getPageHistoryFormatter ($format) {
73 include_once($this->file('lib/RecentChanges.php'));
74 if (preg_match('/^rss/', $format))
75 return false; // use default
76 return '_MacOSX_PageHistory_Formatter';
79 function LinkUnknownWikiWord($wikiword, $linktext = '') {
80 if (empty($linktext)) {
81 $linktext = $wikiword;
82 if ($this->getAutoSplitWikiWords())
83 $linktext=split_pagename($linktext);
84 $class = 'wikiunknown';
86 $class = 'named-wikiunknown';
88 $qmark = $this->makeButton('?', WikiURL($wikiword, array('action' => 'edit')));
90 return Element('span', array('class' => $class),
91 Element('u', $linktext) . $qmark->asHTML());
95 $Theme = new Theme_MacOSX('MacOSX');
97 // CSS file defines fonts, colors and background images for this
98 // style. The companion '*-heavy.css' file isn't defined, it's just
99 // expected to be in the same directory that the base style is in.
100 $Theme->setDefaultCSS("MacOSX", "MacOSX.css");
101 $Theme->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen');
102 $Theme->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
103 $Theme->addAlternateCSS('PhpWiki', 'phpwiki.css');
106 * The logo image appears on every page and links to the HomePage.
108 //$Theme->addImageAlias('logo', 'logo.png');
111 * The Signature image is shown after saving an edited page. If this
112 * is not set, any signature defined in index.php will be used. If it
113 * is not defined by index.php or in here then the "Thank you for
114 * editing..." screen will be omitted.
116 //$Theme->addImageAlias('signature', 'signature.png');
121 $Theme->setLinkIcon('http');
122 $Theme->setLinkIcon('https');
123 $Theme->setLinkIcon('ftp');
124 $Theme->setLinkIcon('mailto');
125 $Theme->setLinkIcon('interwiki');
126 $Theme->setLinkIcon('*', 'url');
128 $Theme->setButtonSeparator(' ');
130 $Theme->addButtonAlias('?', 'uww');
132 * WikiWords can automatically be split by inserting spaces between
133 * the words. The default is to leave WordsSmashedTogetherLikeSo.
135 //$Theme->setAutosplitWikiWords(false);
138 * You may adjust the formats used for formatting dates and times
139 * below. (These examples give the default formats.)
140 * Formats are given as format strings to PHP strftime() function See
141 * http://www.php.net/manual/en/function.strftime.php for details.
143 //$Theme->setDateTimeFormat("%B %e, %Y"); // may contain time of day
144 //$Theme->setDateFormat("%B %e, %Y"); // must not contain time
145 $Theme->setDateTimeFormat("%A, %B %e, %Y. %l:%M:%S %p %Z"); // may contain time of day
146 $Theme->setDateFormat("%A, %B %e, %Y"); // must not contain time
149 $ToolbarImages = array(
150 'RecentChanges' => array(
151 '1 day' => "themes/$theme/buttons/en/1+day.png",
152 '2 days' => "themes/$theme/buttons/en/2+days.png",
153 '3 days' => "themes/$theme/buttons/en/3+days.png",
154 '4 days' => "themes/$theme/buttons/en/4+days.png",
155 '7 days' => "themes/$theme/buttons/en/7+days.png",
156 '30 days' => "themes/$theme/buttons/en/30+days.png",
157 '90 days' => "themes/$theme/buttons/en/90+days.png",
158 '...' => "themes/$theme/buttons/en/alltime.png")
162 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
163 // (c-file-style: "gnu")
168 // c-hanging-comment-ender-p: nil
169 // indent-tabs-mode: nil