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