]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/MonoBook/themeinfo.php
Remove accesskeys
[SourceForge/phpwiki.git] / themes / MonoBook / themeinfo.php
1 <?php
2 // Avoid direct call to this file.
3 // PHPWIKI_VERSION is defined in lib/prepend.php
4 if (!defined('PHPWIKI_VERSION')) {
5     header("Location: /");
6     exit;
7 }
8
9 /**
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.
14  *
15  * Problems with IE: signin is at the left.
16  *
17  */
18 require_once 'lib/WikiTheme.php';
19 require_once 'themes/wikilens/themeinfo.php';
20
21 class WikiTheme_MonoBook extends WikiTheme_Wikilens
22 {
23     /* this adds selected to the class */
24     function makeActionButton($action, $label = false, $page_or_rev = false, $options = false)
25     {
26         extract($this->_get_name_and_rev($page_or_rev));
27
28         if (is_array($action)) {
29             $attr = $action;
30             $action = isset($attr['action']) ? $attr['action'] : 'browse';
31         } else
32             $attr['action'] = $action;
33
34         $class = is_safe_action($action) ? /*'named-wiki'*/
35             'new' : 'wikiadmin';
36         /* if selected action is current then prepend selected */
37         global $request;
38         if ($request->getArg("action") == $action)
39             $class = "selected $class";
40         //$class = "selected";
41         if (!empty($options['class']))
42             $class = $options['class'];
43         if (!$label)
44             $label = $this->_labelForAction($action);
45
46         if ($version)
47             $attr['version'] = $version;
48
49         if ($action == 'browse')
50             unset($attr['action']);
51
52         return $this->makeButton($label, WikiURL($pagename, $attr), $class, $options);
53     }
54
55     function load()
56     {
57         $this->addMoreHeaders(JavaScript("var ta;\nvar skin = '" . $this->_name . "';\n"));
58         $this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("wikibits.js"))));
59         $this->addMoreAttr('body', "class-ns-0", HTML::raw('class="ns-0"'));
60
61         // CSS file defines fonts, colors and background images for this
62         // style.  The companion '*-heavy.css' file isn't defined, it's just
63         // expected to be in the same directory that the base style is in.
64
65         // This should result in phpwiki-printer.css being used when
66         // printing or print-previewing with style "PhpWiki" or "MacOSX" selected.
67         $this->setDefaultCSS('PhpWiki',
68             array('' => 'monobook.css',
69                 'print' => 'commonPrint.css'));
70
71         // This allows one to manually select "Printer" style (when browsing page)
72         // to see what the printer style looks like.
73         $this->addAlternateCSS(_("Printer"), 'commonPrint.css');
74         $this->addAlternateCSS(_("Top & bottom toolbars"), 'phpwiki-topbottombars.css');
75         $this->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
76
77         /**
78          * The logo image appears on every page and links to the HomePage.
79          */
80         $this->addImageAlias('logo', 'MonoBook-Logo.png');
81         //$this->addImageAlias('logo', WIKI_NAME . 'Logo.png');
82
83         /**
84          * The Signature image is shown after saving an edited page. If this
85          * is set to false then the "Thank you for editing..." screen will
86          * be omitted.
87          */
88
89         $this->addImageAlias('signature', "Signature.png");
90         // Uncomment this next line to disable the signature.
91         $this->addImageAlias('signature', false);
92
93         /*
94          * Link icons.
95          */
96         $this->setLinkIcon('wikiuser');
97
98         /**
99          * WikiWords can automatically be split by inserting spaces between
100          * the words. The default is to leave WordsSmashedTogetherLikeSo.
101          */
102         //$this->setAutosplitWikiWords(false);
103
104         /**
105          * Layout improvement with dangling links for mostly closed wiki's:
106          * If false, only users with edit permissions will be presented the
107          * special wikiunknown class with "?" and Tooltip.
108          * If true (default), any user will see the ?, but will be presented
109          * the PrintLoginForm on a click.
110          */
111         $this->setAnonEditUnknownLinks(false);
112
113         /*
114          * You may adjust the formats used for formatting dates and times
115          * below.  (These examples give the default formats.)
116          * Formats are given as format strings to PHP strftime() function See
117          * http://www.php.net/manual/en/function.strftime.php for details.
118          * Do not include the server's zone (%Z), times are converted to the
119          * user's time zone.
120          */
121         $this->setDateFormat("%B %d, %Y");
122         $this->setTimeFormat("%H:%M");
123
124         /*
125          * To suppress times in the "Last edited on" messages, give a
126          * give a second argument of false:
127          */
128         //$this->setDateFormat("%B %d, %Y", false);
129     }
130 }
131
132 $WikiTheme = new WikiTheme_MonoBook('MonoBook');