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