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