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)
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)
51 extract($this->_get_name_and_rev($page_or_rev));
53 if (is_array($action)) {
55 $action = isset($attr['action']) ? $attr['action'] : 'browse';
57 $attr['action'] = $action;
59 $class = is_safe_action($action) ? /*'named-wiki'*/
61 /* if selected action is current then prepend selected */
63 if ($request->getArg("action") == $action)
64 $class = "selected $class";
65 //$class = "selected";
66 if (!empty($options['class']))
67 $class = $options['class'];
69 $label = $this->_labelForAction($action);
72 $attr['version'] = $version;
74 if ($action == 'browse')
75 unset($attr['action']);
77 $options = $this->fixAccesskey($options);
78 return $this->makeButton($label, WikiURL($pagename, $attr), $class, $options);
83 $this->addMoreHeaders(JavaScript("var ta;\nvar skin = '" . $this->_name . "';\n"));
84 $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("wikibits.js"))));
86 $ver = browserVersion();
87 if ($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("\n");
93 $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("IEFixes.js"))));
94 $this->addMoreHeaders("\n");
95 $this->addMoreHeaders(HTML::Raw('<meta http-equiv="imagetoolbar" content="no" />'));
97 $this->addMoreAttr('body', "class-ns-0", HTML::Raw('class="ns-0"'));
99 // CSS file defines fonts, colors and background images for this
100 // style. The companion '*-heavy.css' file isn't defined, it's just
101 // expected to be in the same directory that the base style is in.
103 // This should result in phpwiki-printer.css being used when
104 // printing or print-previewing with style "PhpWiki" or "MacOSX" selected.
105 $this->setDefaultCSS('PhpWiki',
106 array('' => 'monobook.css',
107 'print' => 'commonPrint.css'));
109 // This allows one to manually select "Printer" style (when browsing page)
110 // to see what the printer style looks like.
111 $this->addAlternateCSS(_("Printer"), 'commonPrint.css', 'print, screen');
112 $this->addAlternateCSS(_("Top & bottom toolbars"), 'phpwiki-topbottombars.css');
113 $this->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
116 * The logo image appears on every page and links to the HomePage.
118 $this->addImageAlias('logo', 'MonoBook-Logo.png');
119 //$this->addImageAlias('logo', WIKI_NAME . 'Logo.png');
122 * The Signature image is shown after saving an edited page. If this
123 * is set to false then the "Thank you for editing..." screen will
127 $this->addImageAlias('signature', "Signature.png");
128 // Uncomment this next line to disable the signature.
129 $this->addImageAlias('signature', false);
134 $this->setLinkIcon('wikiuser');
137 * WikiWords can automatically be split by inserting spaces between
138 * the words. The default is to leave WordsSmashedTogetherLikeSo.
140 //$this->setAutosplitWikiWords(false);
143 * Layout improvement with dangling links for mostly closed wiki's:
144 * If false, only users with edit permissions will be presented the
145 * special wikiunknown class with "?" and Tooltip.
146 * If true (default), any user will see the ?, but will be presented
147 * the PrintLoginForm on a click.
149 $this->setAnonEditUnknownLinks(false);
152 * You may adjust the formats used for formatting dates and times
153 * below. (These examples give the default formats.)
154 * Formats are given as format strings to PHP strftime() function See
155 * http://www.php.net/manual/en/function.strftime.php for details.
156 * Do not include the server's zone (%Z), times are converted to the
159 $this->setDateFormat("%B %d, %Y");
160 $this->setTimeFormat("%H:%M");
163 * To suppress times in the "Last edited on" messages, give a
164 * give a second argument of false:
166 //$this->setDateFormat("%B %d, %Y", false);
170 $WikiTheme = new WikiTheme_MonoBook('MonoBook');
176 // c-hanging-comment-ender-p: nil
177 // indent-tabs-mode: nil