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