2 // Avoid direct call to this file.
3 // PHPWIKI_VERSION is defined in lib/prepend.php
4 if (!defined('PHPWIKI_VERSION')) {
10 * A PhpWiki theme inspired by the Aqua appearance of Mac OS X.
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
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,
23 * Do you like the icons used in the buttons?
25 * See buttons/README for more info on the buttons.
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
32 require_once 'lib/WikiTheme.php';
34 class WikiTheme_MacOSX extends WikiTheme {
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')));
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';
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';
61 function linkUnknownWikiWord($wikiword, $linktext = '') {
64 // Get rid of anchors on unknown wikiwords
65 if (isa($wikiword, 'WikiPageName')) {
66 $default_text = $wikiword->shortName;
67 $wikiword = $wikiword->name;
70 $default_text = $wikiword;
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);
80 if (!empty($linktext)) {
81 $link->unshiftContent(HTML::u($linktext));
82 $link->setAttr('class', 'named-wikiunknown');
85 $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($default_text)));
86 $link->setAttr('class', 'wikiunknown');
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.
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'));
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');
107 * The logo image appears on every page and links to the HomePage.
109 $this->addImageAlias('logo', WIKI_NAME . 'Logo.png');
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
116 $this->addImageAlias('signature', WIKI_NAME . "Signature.png");
117 // Uncomment this next line to disable the signature.
118 //$this->addImageAlias('signature', false);
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');
131 $this->setButtonSeparator(""); //use no separator instead of default
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");
140 * WikiWords can automatically be split by inserting spaces between
141 * the words. The default is to leave WordsSmashedTogetherLikeSo.
143 //$this->setAutosplitWikiWords(false);
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
153 $this->setDateFormat("%A, %B %d, %Y"); // must not contain time
154 $this->setTimeFormat("%I:%M:%S %p");
158 $WikiTheme = new WikiTheme_MacOSX('MacOSX');
164 // c-hanging-comment-ender-p: nil
165 // indent-tabs-mode: nil