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