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');
90 if ($request->getArg('frame'))
91 $link->setAttr('target', '_top');
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',
104 array('' => 'MacOSX.css',
105 'print' => 'phpwiki-printer.css'));
107 // This allows one to manually select "Printer" style (when browsing page)
108 // to see what the printer style looks like.
109 $this->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen');
110 $this->addAlternateCSS(_("Top & bottom toolbars"), 'MacOSX-topbottombars.css');
113 * The logo image appears on every page and links to the HomePage.
115 $this->addImageAlias('logo', WIKI_NAME . 'Logo.png');
118 * The Signature image is shown after saving an edited page. If this
119 * is set to false then the "Thank you for editing..." screen will
122 $this->addImageAlias('signature', WIKI_NAME . "Signature.png");
123 // Uncomment this next line to disable the signature.
124 //$this->addImageAlias('signature', false);
129 $this->setLinkIcon('http');
130 $this->setLinkIcon('https');
131 $this->setLinkIcon('ftp');
132 $this->setLinkIcon('mailto');
133 $this->setLinkIcon('interwiki');
134 $this->setLinkIcon('wikiuser');
135 $this->setLinkIcon('*', 'url');
137 $this->setButtonSeparator(""); //use no separator instead of default
139 $this->addButtonAlias('?', 'uww');
140 $this->addButtonAlias(_("Lock Page"), "Lock Page");
141 $this->addButtonAlias(_("Unlock Page"), "Unlock Page");
142 $this->addButtonAlias(_("Page Locked"), "Page Locked");
143 $this->addButtonAlias("...", "alltime");
146 * WikiWords can automatically be split by inserting spaces between
147 * the words. The default is to leave WordsSmashedTogetherLikeSo.
149 //$this->setAutosplitWikiWords(false);
152 * You may adjust the formats used for formatting dates and times
153 * below. (These examples give the default formats.)
154 * Formats are given as format strings to PHP strftime() function See
155 * http://www.php.net/manual/en/function.strftime.php for details.
156 * Do not include the server's zone (%Z), times are converted to the
159 $this->setDateFormat("%A, %B %d, %Y"); // must not contain time
160 $this->setTimeFormat("%I:%M:%S %p");
164 $WikiTheme = new WikiTheme_MacOSX('MacOSX');
166 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
167 // (c-file-style: "gnu")
172 // c-hanging-comment-ender-p: nil
173 // indent-tabs-mode: nil