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.5 and $ver < 7.0)
93 $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('IE60Fixes.css'),'all'));
95 $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('IE70Fixes.css'),'all'));
97 $this->addMoreHeaders("\n");
98 $this->addMoreHeaders(JavaScript('',array('src' => $this->_findData("IEFixes.js"))));
99 $this->addMoreHeaders("\n");
100 $this->addMoreHeaders(HTML::Raw('<meta http-equiv="imagetoolbar" content="no" />'));
102 $this->addMoreAttr('body', "class-ns-0", HTML::Raw('class="ns-0"'));
104 // CSS file defines fonts, colors and background images for this
105 // style. The companion '*-heavy.css' file isn't defined, it's just
106 // expected to be in the same directory that the base style is in.
108 // This should result in phpwiki-printer.css being used when
109 // printing or print-previewing with style "PhpWiki" or "MacOSX" selected.
110 $this->setDefaultCSS('PhpWiki',
111 array('' => 'monobook.css',
112 'print' => 'commonPrint.css'));
114 // This allows one to manually select "Printer" style (when browsing page)
115 // to see what the printer style looks like.
116 $this->addAlternateCSS(_("Printer"), 'commonPrint.css', 'print, screen');
117 $this->addAlternateCSS(_("Top & bottom toolbars"), 'phpwiki-topbottombars.css');
118 $this->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
121 * The logo image appears on every page and links to the HomePage.
123 $this->addImageAlias('logo', 'MonoBook-Logo.png');
124 //$this->addImageAlias('logo', WIKI_NAME . 'Logo.png');
127 * The Signature image is shown after saving an edited page. If this
128 * is set to false then the "Thank you for editing..." screen will
132 $this->addImageAlias('signature', "Signature.png");
133 // Uncomment this next line to disable the signature.
134 $this->addImageAlias('signature', false);
140 $this->setLinkIcon('http');
141 $this->setLinkIcon('https');
142 $this->setLinkIcon('ftp');
143 $this->setLinkIcon('mailto');
144 //$this->setLinkIcon('interwiki');
146 $this->setLinkIcon('wikiuser');
147 //$this->setLinkIcon('*', 'url');
149 //$this->setLinkIconAttr('after');
151 //$this->setButtonSeparator("\n | ");
154 * WikiWords can automatically be split by inserting spaces between
155 * the words. The default is to leave WordsSmashedTogetherLikeSo.
157 //$this->setAutosplitWikiWords(false);
160 * Layout improvement with dangling links for mostly closed wiki's:
161 * If false, only users with edit permissions will be presented the
162 * special wikiunknown class with "?" and Tooltip.
163 * If true (default), any user will see the ?, but will be presented
164 * the PrintLoginForm on a click.
166 $this->setAnonEditUnknownLinks(false);
169 * You may adjust the formats used for formatting dates and times
170 * below. (These examples give the default formats.)
171 * Formats are given as format strings to PHP strftime() function See
172 * http://www.php.net/manual/en/function.strftime.php for details.
173 * Do not include the server's zone (%Z), times are converted to the
176 $this->setDateFormat("%B %d, %Y");
177 $this->setTimeFormat("%H:%M");
180 * To suppress times in the "Last edited on" messages, give a
181 * give a second argument of false:
183 //$this->setDateFormat("%B %d, %Y", false);
187 $WikiTheme = new WikiTheme_MonoBook('MonoBook');
193 // c-hanging-comment-ender-p: nil
194 // indent-tabs-mode: nil