]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/MacOSX/themeinfo.php
More infiltration of new object-based HTML generation.
[SourceForge/phpwiki.git] / themes / MacOSX / themeinfo.php
1 <?php
2
3 rcs_id('$Id: themeinfo.php,v 1.31 2002-01-21 06:55:47 dairiki 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  * Known Problems:
16  *
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.
20  *
21  * The button toolbars use tables for positioning. Yuck. (It will do
22  * for now).
23  *
24  * Only English buttons are available. Full localization is coming.
25  *
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.
33  *
34  * Send me some feedback, do you like the icons used in the buttons?
35  *
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.
43  *
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,
46  * feedback?)
47  *
48  * */
49
50 require_once('lib/Theme.php');
51
52 class Theme_MacOSX extends Theme {
53     function getCSS() {
54         // FIXME: this is a hack which will not be needed once
55         //        we have dynamic CSS.
56         $css = Theme::getCSS();
57         $css[] = HTML::style(array('type' => 'text/css'),
58                              new RawXml(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')));
62         return $css;
63     }
64
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';
70     }
71
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';
77     }
78
79     function linkUnknownWikiWord($wikiword, $linktext = '') {
80         $url = WikiURL($wikiword, array('action' => 'edit'));
81         $link = HTML::span(HTML::a(array('href' => $url), '?'));
82
83         if (!empty($linktext)) {
84             $link->unshiftContent(HTML::u($linktext));
85             $link->setAttr('class', 'named-wikiunknown');
86         }
87         else {
88             $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($wikiword)));
89             $link->setAttr('class', 'wikiunknown');
90         }
91         
92         return $link;
93     }
94 }
95
96 $Theme = new Theme_MacOSX('MacOSX');
97
98 // CSS file defines fonts, colors and background images for this
99 // style.  The companion '*-heavy.css' file isn't defined, it's just
100 // expected to be in the same directory that the base style is in.
101 $Theme->setDefaultCSS("MacOSX", "MacOSX.css");
102 $Theme->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen');
103 $Theme->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
104 $Theme->addAlternateCSS('PhpWiki', 'phpwiki.css');
105
106 /**
107  * The logo image appears on every page and links to the HomePage.
108  */
109 //$Theme->addImageAlias('logo', 'logo.png');
110
111 /**
112  * The Signature image is shown after saving an edited page. If this
113  * is not set, any signature defined in index.php will be used. If it
114  * is not defined by index.php or in here then the "Thank you for
115  * editing..." screen will be omitted.
116  */
117 //$Theme->addImageAlias('signature', 'signature.png');
118
119 /*
120  * Link icons.
121  */
122 $Theme->setLinkIcon('http');
123 $Theme->setLinkIcon('https');
124 $Theme->setLinkIcon('ftp');
125 $Theme->setLinkIcon('mailto');
126 $Theme->setLinkIcon('interwiki');
127 $Theme->setLinkIcon('*', 'url');
128
129 $Theme->setButtonSeparator(' ');
130
131 $Theme->addButtonAlias('?', 'uww');
132 /**
133  * WikiWords can automatically be split by inserting spaces between
134  * the words. The default is to leave WordsSmashedTogetherLikeSo.
135  */
136 //$Theme->setAutosplitWikiWords(false);
137
138 /*
139  * You may adjust the formats used for formatting dates and times
140  * below.  (These examples give the default formats.)
141  * Formats are given as format strings to PHP strftime() function See
142  * http://www.php.net/manual/en/function.strftime.php for details.
143  */
144 //$Theme->setDateTimeFormat("%B %e, %Y");   // may contain time of day
145 //$Theme->setDateFormat("%B %e, %Y");       // must not contain time
146 $Theme->setDateTimeFormat("%A, %B %e, %Y. %l:%M:%S %p %Z"); // may contain time of day
147 $Theme->setDateFormat("%A, %B %e, %Y"); // must not contain time
148
149 /*
150 $ToolbarImages = array(
151 'RecentChanges' => array(
152 '1 day'         => "themes/$theme/buttons/en/1+day.png",
153 '2 days'        => "themes/$theme/buttons/en/2+days.png",
154 '3 days'        => "themes/$theme/buttons/en/3+days.png",
155 '4 days'        => "themes/$theme/buttons/en/4+days.png",
156 '7 days'        => "themes/$theme/buttons/en/7+days.png",
157 '30 days'       => "themes/$theme/buttons/en/30+days.png",
158 '90 days'       => "themes/$theme/buttons/en/90+days.png",
159 '...'           => "themes/$theme/buttons/en/alltime.png")
160 );
161 */
162
163 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
164 // (c-file-style: "gnu")
165 // Local Variables:
166 // mode: php
167 // tab-width: 8
168 // c-basic-offset: 4
169 // c-hanging-comment-ender-p: nil
170 // indent-tabs-mode: nil
171 // End:   
172 ?>