2 // Avoid direct call to this file.
3 // PHPWIKI_VERSION is defined in lib/prepend.php
4 if (!defined('PHPWIKI_VERSION')) {
12 * A PhpWiki theme inspired by the Aqua appearance of Mac OS X.
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
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,
25 * Do you like the icons used in the buttons?
27 * See buttons/README for more info on the buttons.
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
34 require_once('lib/WikiTheme.php');
36 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) {
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';
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';
63 function linkUnknownWikiWord($wikiword, $linktext = '') {
66 // Get rid of anchors on unknown wikiwords
67 if (isa($wikiword, 'WikiPageName')) {
68 $default_text = $wikiword->shortName;
69 $wikiword = $wikiword->name;
72 $default_text = $wikiword;
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);
82 if (!empty($linktext)) {
83 $link->unshiftContent(HTML::u($linktext));
84 $link->setAttr('class', 'named-wikiunknown');
87 $link->unshiftContent(HTML::u($this->maybeSplitWikiWord($default_text)));
88 $link->setAttr('class', 'wikiunknown');
95 // CSS file defines fonts, colors and background images for this
96 // style. The companion '*-heavy.css' file isn't defined, it's just
97 // expected to be in the same directory that the base style is in.
99 // This should result in phpwiki-printer.css being used when
100 // printing or print-previewing with style "PhpWiki" or "MacOSX" selected.
101 $this->setDefaultCSS('MacOSX', array('' => 'MacOSX.css', 'print' => 'phpwiki-printer.css'));
103 // This allows one to manually select "Printer" style (when browsing page)
104 // to see what the printer style looks like.
105 $this->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen');
106 $this->addAlternateCSS(_("Top & bottom toolbars"), 'MacOSX-topbottombars.css');
109 * The logo image appears on every page and links to the HomePage.
111 $this->addImageAlias('logo', WIKI_NAME . 'Logo.png');
114 * The Signature image is shown after saving an edited page. If this
115 * is set to false then the "Thank you for editing..." screen will
118 $this->addImageAlias('signature', WIKI_NAME . "Signature.png");
119 // Uncomment this next line to disable the signature.
120 //$this->addImageAlias('signature', false);
125 $this->setLinkIcon('http');
126 $this->setLinkIcon('https');
127 $this->setLinkIcon('ftp');
128 $this->setLinkIcon('mailto');
129 $this->setLinkIcon('interwiki');
130 $this->setLinkIcon('wikiuser');
131 $this->setLinkIcon('*', 'url');
133 $this->setButtonSeparator(""); //use no separator instead of default
135 $this->addButtonAlias('?', 'uww');
136 $this->addButtonAlias(_("Lock Page"), "Lock Page");
137 $this->addButtonAlias(_("Unlock Page"), "Unlock Page");
138 $this->addButtonAlias(_("Page Locked"), "Page Locked");
139 $this->addButtonAlias("...", "alltime");
142 * WikiWords can automatically be split by inserting spaces between
143 * the words. The default is to leave WordsSmashedTogetherLikeSo.
145 //$this->setAutosplitWikiWords(false);
148 * You may adjust the formats used for formatting dates and times
149 * below. (These examples give the default formats.)
150 * Formats are given as format strings to PHP strftime() function See
151 * http://www.php.net/manual/en/function.strftime.php for details.
152 * Do not include the server's zone (%Z), times are converted to the
155 $this->setDateFormat("%A, %B %d, %Y"); // must not contain time
156 $this->setTimeFormat("%I:%M:%S %p");
160 $WikiTheme = new WikiTheme_MacOSX('MacOSX');
166 // c-hanging-comment-ender-p: nil
167 // indent-tabs-mode: nil