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.
19 require_once 'lib/WikiTheme.php';
20 require_once 'themes/wikilens/themeinfo.php';
22 function ActionButton ($action, $label = false, $page_or_rev = false, $options = false) {
25 if (is_array($action)) {
27 $act = isset($attr['action']) ? $attr['action'] : 'browse';
30 $class = is_safe_action($act) ? 'named-wiki' : 'wikiadmin';
31 /* if selected action is current then prepend selected */
32 $curract = $request->getArg("action");
33 if ($curract == $act and $curract != 'browse')
34 $class = "selected $class";
35 if (!empty($options['class'])) {
36 if ($curract == 'browse')
37 $class = "$class ".$options['class'];
39 $class = $options['class'];
41 return HTML::li(array('class' => $class),
42 $WikiTheme->makeActionButton($action, $label, $page_or_rev, $options));
45 class WikiTheme_MonoBook extends WikiTheme_Wikilens
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.5 and $ver < 7.0)
86 $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('IE60Fixes.css'),'all'));
88 $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('IE70Fixes.css'),'all'));
90 $this->addMoreHeaders("\n");
91 $this->addMoreHeaders(JavaScript('',array('src' => $this->_findData("IEFixes.js"))));
92 $this->addMoreHeaders("\n");
93 $this->addMoreHeaders(HTML::Raw('<meta http-equiv="imagetoolbar" content="no" />'));
95 $this->addMoreAttr('body', "class-ns-0", HTML::Raw('class="ns-0"'));
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('PhpWiki',
104 array('' => 'monobook.css',
105 'print' => 'commonPrint.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"), 'commonPrint.css', 'print, screen');
110 $this->addAlternateCSS(_("Top & bottom toolbars"), 'phpwiki-topbottombars.css');
111 $this->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
114 * The logo image appears on every page and links to the HomePage.
116 $this->addImageAlias('logo', 'MonoBook-Logo.png');
117 //$this->addImageAlias('logo', WIKI_NAME . 'Logo.png');
120 * The Signature image is shown after saving an edited page. If this
121 * is set to false then the "Thank you for editing..." screen will
125 $this->addImageAlias('signature', "Signature.png");
126 // Uncomment this next line to disable the signature.
127 $this->addImageAlias('signature', false);
132 $this->setLinkIcon('wikiuser');
135 * WikiWords can automatically be split by inserting spaces between
136 * the words. The default is to leave WordsSmashedTogetherLikeSo.
138 //$this->setAutosplitWikiWords(false);
141 * Layout improvement with dangling links for mostly closed wiki's:
142 * If false, only users with edit permissions will be presented the
143 * special wikiunknown class with "?" and Tooltip.
144 * If true (default), any user will see the ?, but will be presented
145 * the PrintLoginForm on a click.
147 $this->setAnonEditUnknownLinks(false);
150 * You may adjust the formats used for formatting dates and times
151 * below. (These examples give the default formats.)
152 * Formats are given as format strings to PHP strftime() function See
153 * http://www.php.net/manual/en/function.strftime.php for details.
154 * Do not include the server's zone (%Z), times are converted to the
157 $this->setDateFormat("%B %d, %Y");
158 $this->setTimeFormat("%H:%M");
161 * To suppress times in the "Last edited on" messages, give a
162 * give a second argument of false:
164 //$this->setDateFormat("%B %d, %Y", false);
168 $WikiTheme = new WikiTheme_MonoBook('MonoBook');
174 // c-hanging-comment-ender-p: nil
175 // indent-tabs-mode: nil