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