2 rcs_id('$Id: themeinfo.php,v 1.10 2007-07-01 09:36:10 rurban Exp $');
4 * The new mediawiki (Wikipedia.org) default style.
5 * Mediawiki 'monobook' style sheet for CSS2-capable browsers.
6 * Copyright Gabriel Wicke - http://www.aulinx.de/
7 * See main.css for more.
9 * Problems with IE: signin is at the left.
11 * We don't (yet) support all mediawiki UI options, but we try to.
12 * Besides that, maybe the mediawiki folks will see how much better phpwiki
13 * will scale, esp. with a true database, not just mysql.
14 * Technically phpwiki has about 2-3 years advantage and our plugins
15 * cannot destroy the layout.
16 * Anyway, the WikiParser perl module (and our php version) will be able to import
17 * and convert back and forth.
19 require_once('lib/Theme.php');
20 if (!defined("ENABLE_MARKUP_TEMPLATE"))
21 define("ENABLE_MARKUP_TEMPLATE", true);
23 function ActionButton ($action, $label = false, $page_or_rev = false, $options = false) {
26 if (is_array($action)) {
28 $act = isset($attr['action']) ? $attr['action'] : 'browse';
31 $class = is_safe_action($act) ? 'named-wiki' : 'wikiadmin';
32 /* if selected action is current then prepend selected */
33 $curract = $request->getArg("action");
34 if ($curract == $act and $curract != 'browse')
35 $class = "selected $class";
36 if (!empty($options['class'])) {
37 if ($curract == 'browse')
38 $class = "$class ".$options['class'];
40 $class = $options['class'];
42 return HTML::li(array('class' => $class),
43 $WikiTheme->makeActionButton($action, $label, $page_or_rev, $options));
46 class Theme_MonoBook extends Theme {
48 /* this adds selected to the class */
49 function makeActionButton ($action, $label = false, $page_or_rev = false, $options = false) {
50 extract($this->_get_name_and_rev($page_or_rev));
52 if (is_array($action)) {
54 $action = isset($attr['action']) ? $attr['action'] : 'browse';
57 $attr['action'] = $action;
59 $class = is_safe_action($action) ? /*'named-wiki'*/'new' : 'wikiadmin';
60 /* if selected action is current then prepend selected */
62 if ($request->getArg("action") == $action)
63 $class = "selected $class";
64 //$class = "selected";
65 if (!empty($options['class']))
66 $class = $options['class'];
68 $label = $this->_labelForAction($action);
71 $attr['version'] = $version;
73 if ($action == 'browse')
74 unset($attr['action']);
76 $options = $this->fixAccesskey($options);
77 return $this->makeButton($label, WikiURL($pagename, $attr), $class, $options);
81 $this->addMoreHeaders(JavaScript("var ta;\nvar skin = '".$this->_name."';\n"));
82 $this->addMoreHeaders(JavaScript('',array('src' => $this->_findData("wikibits.js"))));
84 $ver = browserVersion();
85 if ($ver > 5.1 and $ver < 5.9)
86 $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('IE55Fixes.css'),'all'));
87 elseif ($ver > 5.5 and $ver < 7.0)
88 $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('IE60Fixes.css'),'all'));
90 $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('IE70Fixes.css'),'all'));
92 $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('IE50Fixes.css'),'all'));
94 $this->addMoreHeaders("\n");
95 $this->addMoreHeaders(JavaScript('',array('src' => $this->_findData("IEFixes.js"))));
96 $this->addMoreHeaders("\n");
97 $this->addMoreHeaders(HTML::Raw('<meta http-equiv="imagetoolbar" content="no" />'));
99 // better done in wikibits.js
100 /*elseif (isBrowserSafari()) {
101 $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('IEMacFixes.css'),'all'));
102 } elseif (isBrowserKonqueror()) {
103 $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('KHTMLFixes.css'),'all'));
104 } elseif (isBrowserOpera()) {
105 $this->addMoreHeaders($this->_CSSlink
107 isBrowserOpera(7) ? $this->_findFile('Opera7Fixes.css')
108 : $this->_findFile('Opera6Fixes.css'),'all'));
111 // TODO: IEMAC, KHTML, Opera6, Opera7
112 $this->addMoreAttr('body', "class-ns-0", HTML::Raw('class="ns-0"'));
114 // CSS file defines fonts, colors and background images for this
115 // style. The companion '*-heavy.css' file isn't defined, it's just
116 // expected to be in the same directory that the base style is in.
118 // This should result in phpwiki-printer.css being used when
119 // printing or print-previewing with style "PhpWiki" or "MacOSX" selected.
120 $this->setDefaultCSS('PhpWiki',
121 array('' => 'monobook.css',
122 'print' => 'commonPrint.css'));
124 // This allows one to manually select "Printer" style (when browsing page)
125 // to see what the printer style looks like.
126 $this->addAlternateCSS(_("Printer"), 'commonPrint.css', 'print, screen');
127 $this->addAlternateCSS(_("Top & bottom toolbars"), 'phpwiki-topbottombars.css');
128 $this->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
131 * The logo image appears on every page and links to the HomePage.
133 $this->addImageAlias('logo', 'MonoBook-Logo.png');
134 //$this->addImageAlias('logo', WIKI_NAME . 'Logo.png');
137 * The Signature image is shown after saving an edited page. If this
138 * is set to false then the "Thank you for editing..." screen will
142 $this->addImageAlias('signature', "Signature.png");
143 // Uncomment this next line to disable the signature.
144 $this->addImageAlias('signature', false);
150 $this->setLinkIcon('http');
151 $this->setLinkIcon('https');
152 $this->setLinkIcon('ftp');
153 $this->setLinkIcon('mailto');
154 //$this->setLinkIcon('interwiki');
156 $this->setLinkIcon('wikiuser');
157 //$this->setLinkIcon('*', 'url');
159 //$this->setLinkIconAttr('after');
161 //$this->setButtonSeparator("\n | ");
164 * WikiWords can automatically be split by inserting spaces between
165 * the words. The default is to leave WordsSmashedTogetherLikeSo.
167 //$this->setAutosplitWikiWords(false);
170 * Layout improvement with dangling links for mostly closed wiki's:
171 * If false, only users with edit permissions will be presented the
172 * special wikiunknown class with "?" and Tooltip.
173 * If true (default), any user will see the ?, but will be presented
174 * the PrintLoginForm on a click.
176 $this->setAnonEditUnknownLinks(false);
179 * You may adjust the formats used for formatting dates and times
180 * below. (These examples give the default formats.)
181 * Formats are given as format strings to PHP strftime() function See
182 * http://www.php.net/manual/en/function.strftime.php for details.
183 * Do not include the server's zone (%Z), times are converted to the
186 $this->setDateFormat("%B %d, %Y");
187 $this->setTimeFormat("%H:%M");
190 * To suppress times in the "Last edited on" messages, give a
191 * give a second argument of false:
193 //$this->setDateFormat("%B %d, %Y", false);
197 $WikiTheme = new Theme_MonoBook('MonoBook');
199 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
200 // (c-file-style: "gnu")
205 // c-hanging-comment-ender-p: nil
206 // indent-tabs-mode: nil