2 rcs_id('$Id: themeinfo.php,v 1.55 2004-06-14 11:26:49 rurban Exp $');
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/Theme.php');
29 class Theme_MacOSX extends Theme {
31 // FIXME: this is a hack which will not be needed once
32 // we have dynamic CSS.
33 $css = Theme::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 $WikiTheme = new Theme_MacOSX('MacOSX');
92 // CSS file defines fonts, colors and background images for this
93 // style. The companion '*-heavy.css' file isn't defined, it's just
94 // expected to be in the same directory that the base style is in.
96 // This should result in phpwiki-printer.css being used when
97 // printing or print-previewing with style "PhpWiki" or "MacOSX" selected.
98 $WikiTheme->setDefaultCSS('MacOSX',
99 array('' => 'MacOSX.css',
100 'print' => 'phpwiki-printer.css'));
102 // This allows one to manually select "Printer" style (when browsing page)
103 // to see what the printer style looks like.
104 $WikiTheme->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen');
105 $WikiTheme->addAlternateCSS(_("Top & bottom toolbars"), 'MacOSX-topbottombars.css');
108 * The logo image appears on every page and links to the HomePage.
110 $WikiTheme->addImageAlias('logo', WIKI_NAME . 'Logo.png');
113 * The Signature image is shown after saving an edited page. If this
114 * is set to false then the "Thank you for editing..." screen will
117 $WikiTheme->addImageAlias('signature', WIKI_NAME . "Signature.png");
118 // Uncomment this next line to disable the signature.
119 //$WikiTheme->addImageAlias('signature', false);
124 $WikiTheme->setLinkIcon('http');
125 $WikiTheme->setLinkIcon('https');
126 $WikiTheme->setLinkIcon('ftp');
127 $WikiTheme->setLinkIcon('mailto');
128 $WikiTheme->setLinkIcon('interwiki');
129 $WikiTheme->setLinkIcon('wikiuser');
130 $WikiTheme->setLinkIcon('*', 'url');
132 $WikiTheme->setButtonSeparator(""); //use no separator instead of default
134 $WikiTheme->addButtonAlias('?', 'uww');
135 $WikiTheme->addButtonAlias(_("Lock Page"), "Lock Page");
136 $WikiTheme->addButtonAlias(_("Unlock Page"), "Unlock Page");
137 $WikiTheme->addButtonAlias(_("Page Locked"), "Page Locked");
138 $WikiTheme->addButtonAlias("...", "alltime");
141 * WikiWords can automatically be split by inserting spaces between
142 * the words. The default is to leave WordsSmashedTogetherLikeSo.
144 //$WikiTheme->setAutosplitWikiWords(false);
147 * You may adjust the formats used for formatting dates and times
148 * below. (These examples give the default formats.)
149 * Formats are given as format strings to PHP strftime() function See
150 * http://www.php.net/manual/en/function.strftime.php for details.
151 * Do not include the server's zone (%Z), times are converted to the
154 $WikiTheme->setDateFormat("%A, %B %d, %Y"); // must not contain time
155 $WikiTheme->setTimeFormat("%I:%M:%S %p");
157 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
158 // (c-file-style: "gnu")
163 // c-hanging-comment-ender-p: nil
164 // indent-tabs-mode: nil