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 extends WikiTheme_Wikilens
55 /* this adds selected to the class */
56 function makeActionButton ($action, $label=false, $page_or_rev=false, $options=false) {
57 extract($this->_get_name_and_rev($page_or_rev));
59 if (is_array($action)) {
61 $action = isset($attr['action']) ? $attr['action'] : 'browse';
64 $attr['action'] = $action;
66 $class = is_safe_action($action) ? /*'named-wiki'*/'new' : 'wikiadmin';
67 /* if selected action is current then prepend selected */
69 if ($request->getArg("action") == $action)
70 $class = "selected $class";
71 //$class = "selected";
72 if (!empty($options['class']))
73 $class = $options['class'];
75 $label = $this->_labelForAction($action);
78 $attr['version'] = $version;
80 if ($action == 'browse')
81 unset($attr['action']);
83 $options = $this->fixAccesskey($options);
84 return $this->makeButton($label, WikiURL($pagename, $attr), $class, $options);
88 $this->addMoreHeaders(JavaScript("var ta;\nvar skin = '".$this->_name."';\n"));
89 $this->addMoreHeaders(JavaScript('',array('src' => $this->_findData("wikibits.js"))));
91 $ver = browserVersion();
92 if ($ver > 5.1 and $ver < 5.9)
93 $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('IE55Fixes.css'),'all'));
94 elseif ($ver > 5.5 and $ver < 7.0)
95 $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('IE60Fixes.css'),'all'));
97 $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('IE70Fixes.css'),'all'));
99 $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('IE50Fixes.css'),'all'));
101 $this->addMoreHeaders("\n");
102 $this->addMoreHeaders(JavaScript('',array('src' => $this->_findData("IEFixes.js"))));
103 $this->addMoreHeaders("\n");
104 $this->addMoreHeaders(HTML::Raw('<meta http-equiv="imagetoolbar" content="no" />'));
106 $this->addMoreAttr('body', "class-ns-0", HTML::Raw('class="ns-0"'));
108 // CSS file defines fonts, colors and background images for this
109 // style. The companion '*-heavy.css' file isn't defined, it's just
110 // expected to be in the same directory that the base style is in.
112 // This should result in phpwiki-printer.css being used when
113 // printing or print-previewing with style "PhpWiki" or "MacOSX" selected.
114 $this->setDefaultCSS('PhpWiki',
115 array('' => 'monobook.css',
116 'print' => 'commonPrint.css'));
118 // This allows one to manually select "Printer" style (when browsing page)
119 // to see what the printer style looks like.
120 $this->addAlternateCSS(_("Printer"), 'commonPrint.css', 'print, screen');
121 $this->addAlternateCSS(_("Top & bottom toolbars"), 'phpwiki-topbottombars.css');
122 $this->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
125 * The logo image appears on every page and links to the HomePage.
127 $this->addImageAlias('logo', 'MonoBook-Logo.png');
128 //$this->addImageAlias('logo', WIKI_NAME . 'Logo.png');
131 * The Signature image is shown after saving an edited page. If this
132 * is set to false then the "Thank you for editing..." screen will
136 $this->addImageAlias('signature', "Signature.png");
137 // Uncomment this next line to disable the signature.
138 $this->addImageAlias('signature', false);
144 $this->setLinkIcon('http');
145 $this->setLinkIcon('https');
146 $this->setLinkIcon('ftp');
147 $this->setLinkIcon('mailto');
148 //$this->setLinkIcon('interwiki');
150 $this->setLinkIcon('wikiuser');
151 //$this->setLinkIcon('*', 'url');
153 //$this->setLinkIconAttr('after');
155 //$this->setButtonSeparator("\n | ");
158 * WikiWords can automatically be split by inserting spaces between
159 * the words. The default is to leave WordsSmashedTogetherLikeSo.
161 //$this->setAutosplitWikiWords(false);
164 * Layout improvement with dangling links for mostly closed wiki's:
165 * If false, only users with edit permissions will be presented the
166 * special wikiunknown class with "?" and Tooltip.
167 * If true (default), any user will see the ?, but will be presented
168 * the PrintLoginForm on a click.
170 $this->setAnonEditUnknownLinks(false);
173 * You may adjust the formats used for formatting dates and times
174 * below. (These examples give the default formats.)
175 * Formats are given as format strings to PHP strftime() function See
176 * http://www.php.net/manual/en/function.strftime.php for details.
177 * Do not include the server's zone (%Z), times are converted to the
180 $this->setDateFormat("%B %d, %Y");
181 $this->setTimeFormat("%H:%M");
184 * To suppress times in the "Last edited on" messages, give a
185 * give a second argument of false:
187 //$this->setDateFormat("%B %d, %Y", false);
191 $WikiTheme = new WikiTheme_MonoBook('MonoBook');
197 // c-hanging-comment-ender-p: nil
198 // indent-tabs-mode: nil