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
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')));
49 function getRecentChangesFormatter($format)
51 include_once($this->file('lib/RecentChanges.php'));
52 if (preg_match('/^rss|^sidebar/', $format))
53 return false; // use default
54 return '_MacOSX_RecentChanges_Formatter';
57 function getPageHistoryFormatter($format)
59 include_once($this->file('lib/RecentChanges.php'));
60 if (preg_match('/^rss|^sidebar/', $format))
61 return false; // use default
62 return '_MacOSX_PageHistory_Formatter';
65 function linkUnknownWikiWord($wikiword, $linktext = '')
69 // Get rid of anchors on unknown wikiwords
70 if (isa($wikiword, 'WikiPageName')) {
71 $default_text = $wikiword->shortName;
72 $wikiword = $wikiword->name;
74 $default_text = $wikiword;
77 $url = WikiURL($wikiword, array('action' => 'create'));
78 //$link = HTML::span(HTML::a(array('href' => $url), '?'));
79 $button = $this->makeButton('?', $url);
80 $button->addTooltip(sprintf(_("Create: %s"), $wikiword));
81 $link = HTML::span($button);
84 if (!empty($linktext)) {
85 $link->unshiftContent(HTML::u($linktext));
86 $link->setAttr('class', 'named-wikiunknown');
88 $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($default_text)));
89 $link->setAttr('class', 'wikiunknown');
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.
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', array('' => 'MacOSX.css', 'print' => 'phpwiki-printer.css'));
105 // This allows one to manually select "Printer" style (when browsing page)
106 // to see what the printer style looks like.
107 $this->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen');
108 $this->addAlternateCSS(_("Top & bottom toolbars"), 'MacOSX-topbottombars.css');
111 * The logo image appears on every page and links to the HomePage.
113 $this->addImageAlias('logo', WIKI_NAME . 'Logo.png');
116 * The Signature image is shown after saving an edited page. If this
117 * is set to false then the "Thank you for editing..." screen will
120 $this->addImageAlias('signature', WIKI_NAME . "Signature.png");
121 // Uncomment this next line to disable the signature.
122 //$this->addImageAlias('signature', false);
127 $this->setLinkIcon('http');
128 $this->setLinkIcon('https');
129 $this->setLinkIcon('ftp');
130 $this->setLinkIcon('mailto');
131 $this->setLinkIcon('interwiki');
132 $this->setLinkIcon('wikiuser');
133 $this->setLinkIcon('*', 'url');
135 $this->setButtonSeparator(""); //use no separator instead of default
137 $this->addButtonAlias('?', 'uww');
138 $this->addButtonAlias(_("Lock Page"), "Lock Page");
139 $this->addButtonAlias(_("Unlock Page"), "Unlock Page");
140 $this->addButtonAlias(_("Page Locked"), "Page Locked");
141 $this->addButtonAlias("...", "alltime");
144 * WikiWords can automatically be split by inserting spaces between
145 * the words. The default is to leave WordsSmashedTogetherLikeSo.
147 //$this->setAutosplitWikiWords(false);
150 * You may adjust the formats used for formatting dates and times
151 * below. (These examples give the default formats.)
152 * Formats are given as format strings to PHP strftime() function See
153 * http://www.php.net/manual/en/function.strftime.php for details.
154 * Do not include the server's zone (%Z), times are converted to the
157 $this->setDateFormat("%A, %B %d, %Y"); // must not contain time
158 $this->setTimeFormat("%I:%M:%S %p");
162 $WikiTheme = new WikiTheme_MacOSX('MacOSX');
168 // c-hanging-comment-ender-p: nil
169 // indent-tabs-mode: nil