2 // Avoid direct call to this file.
3 // PHPWIKI_VERSION is defined in lib/prepend.php
4 if (!defined('PHPWIKI_VERSION')) {
10 * The new mediawiki (Wikipedia.org) default style.
11 * Mediawiki 'monobook' style sheet for CSS2-capable browsers.
12 * Copyright Gabriel Wicke - http://www.aulinx.de/
13 * See main.css for more.
15 * Problems with IE: signin is at the left.
18 require_once 'lib/WikiTheme.php';
19 require_once 'themes/wikilens/themeinfo.php';
21 function ActionButton ($action, $label = false, $page_or_rev = false, $options = false) {
24 if (is_array($action)) {
26 $act = isset($attr['action']) ? $attr['action'] : 'browse';
29 $class = is_safe_action($act) ? 'named-wiki' : 'wikiadmin';
30 /* if selected action is current then prepend selected */
31 $curract = $request->getArg("action");
32 if ($curract == $act and $curract != 'browse')
33 $class = "selected $class";
34 if (!empty($options['class'])) {
35 if ($curract == 'browse')
36 $class = "$class ".$options['class'];
38 $class = $options['class'];
40 return HTML::li(array('class' => $class),
41 $WikiTheme->makeActionButton($action, $label, $page_or_rev, $options));
44 class WikiTheme_MonoBook extends WikiTheme_Wikilens
47 /* this adds selected to the class */
48 function makeActionButton ($action, $label=false, $page_or_rev=false, $options=false) {
49 extract($this->_get_name_and_rev($page_or_rev));
51 if (is_array($action)) {
53 $action = isset($attr['action']) ? $attr['action'] : 'browse';
56 $attr['action'] = $action;
58 $class = is_safe_action($action) ? /*'named-wiki'*/'new' : 'wikiadmin';
59 /* if selected action is current then prepend selected */
61 if ($request->getArg("action") == $action)
62 $class = "selected $class";
63 //$class = "selected";
64 if (!empty($options['class']))
65 $class = $options['class'];
67 $label = $this->_labelForAction($action);
70 $attr['version'] = $version;
72 if ($action == 'browse')
73 unset($attr['action']);
75 $options = $this->fixAccesskey($options);
76 return $this->makeButton($label, WikiURL($pagename, $attr), $class, $options);
80 $this->addMoreHeaders(JavaScript("var ta;\nvar skin = '".$this->_name."';\n"));
81 $this->addMoreHeaders(JavaScript('',array('src' => $this->_findData("wikibits.js"))));
83 $ver = browserVersion();
84 if ($ver > 5.5 and $ver < 7.0)
85 $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('IE60Fixes.css'),'all'));
87 $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('IE70Fixes.css'),'all'));
89 $this->addMoreHeaders("\n");
90 $this->addMoreHeaders(JavaScript('',array('src' => $this->_findData("IEFixes.js"))));
91 $this->addMoreHeaders("\n");
92 $this->addMoreHeaders(HTML::Raw('<meta http-equiv="imagetoolbar" content="no" />'));
94 $this->addMoreAttr('body', "class-ns-0", HTML::Raw('class="ns-0"'));
96 // CSS file defines fonts, colors and background images for this
97 // style. The companion '*-heavy.css' file isn't defined, it's just
98 // expected to be in the same directory that the base style is in.
100 // This should result in phpwiki-printer.css being used when
101 // printing or print-previewing with style "PhpWiki" or "MacOSX" selected.
102 $this->setDefaultCSS('PhpWiki',
103 array('' => 'monobook.css',
104 'print' => 'commonPrint.css'));
106 // This allows one to manually select "Printer" style (when browsing page)
107 // to see what the printer style looks like.
108 $this->addAlternateCSS(_("Printer"), 'commonPrint.css', 'print, screen');
109 $this->addAlternateCSS(_("Top & bottom toolbars"), 'phpwiki-topbottombars.css');
110 $this->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
113 * The logo image appears on every page and links to the HomePage.
115 $this->addImageAlias('logo', 'MonoBook-Logo.png');
116 //$this->addImageAlias('logo', WIKI_NAME . 'Logo.png');
119 * The Signature image is shown after saving an edited page. If this
120 * is set to false then the "Thank you for editing..." screen will
124 $this->addImageAlias('signature', "Signature.png");
125 // Uncomment this next line to disable the signature.
126 $this->addImageAlias('signature', false);
131 $this->setLinkIcon('wikiuser');
134 * WikiWords can automatically be split by inserting spaces between
135 * the words. The default is to leave WordsSmashedTogetherLikeSo.
137 //$this->setAutosplitWikiWords(false);
140 * Layout improvement with dangling links for mostly closed wiki's:
141 * If false, only users with edit permissions will be presented the
142 * special wikiunknown class with "?" and Tooltip.
143 * If true (default), any user will see the ?, but will be presented
144 * the PrintLoginForm on a click.
146 $this->setAnonEditUnknownLinks(false);
149 * You may adjust the formats used for formatting dates and times
150 * below. (These examples give the default formats.)
151 * Formats are given as format strings to PHP strftime() function See
152 * http://www.php.net/manual/en/function.strftime.php for details.
153 * Do not include the server's zone (%Z), times are converted to the
156 $this->setDateFormat("%B %d, %Y");
157 $this->setTimeFormat("%H:%M");
160 * To suppress times in the "Last edited on" messages, give a
161 * give a second argument of false:
163 //$this->setDateFormat("%B %d, %Y", false);
167 $WikiTheme = new WikiTheme_MonoBook('MonoBook');
173 // c-hanging-comment-ender-p: nil
174 // indent-tabs-mode: nil