]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/MonoBook/themeinfo.php
Remove $Id$
[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     global $WikiTheme;
23     global $request;
24     if (is_array($action)) {
25         $attr = $action;
26         $act = isset($attr['action']) ? $attr['action'] : 'browse';
27     } else
28         $act = $action;
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'];
37         else
38             $class = $options['class'];
39     }
40     return HTML::li(array('class' => $class),
41                     $WikiTheme->makeActionButton($action, $label, $page_or_rev, $options));
42 }
43
44 class WikiTheme_MonoBook extends WikiTheme_Wikilens
45 {
46
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));
50
51         if (is_array($action)) {
52             $attr = $action;
53             $action = isset($attr['action']) ? $attr['action'] : 'browse';
54         }
55         else
56             $attr['action'] = $action;
57
58         $class = is_safe_action($action) ? /*'named-wiki'*/'new' : 'wikiadmin';
59         /* if selected action is current then prepend selected */
60         global $request;
61         if ($request->getArg("action") == $action)
62             $class = "selected $class";
63             //$class = "selected";
64         if (!empty($options['class']))
65             $class = $options['class'];
66         if (!$label)
67             $label = $this->_labelForAction($action);
68
69         if ($version)
70             $attr['version'] = $version;
71
72         if ($action == 'browse')
73             unset($attr['action']);
74
75         $options = $this->fixAccesskey($options);
76         return $this->makeButton($label, WikiURL($pagename, $attr), $class, $options);
77     }
78
79     function load() {
80    $this->addMoreHeaders(JavaScript("var ta;\nvar skin = '".$this->_name."';\n"));
81    $this->addMoreHeaders(JavaScript('',array('src' => $this->_findData("wikibits.js"))));
82    if (isBrowserIE()) {
83        $ver = browserVersion();
84        if ($ver > 5.5 and $ver < 7.0)
85       $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('IE60Fixes.css'),'all'));
86        elseif ($ver >= 7.0)
87       $this->addMoreHeaders($this->_CSSlink(0,$this->_findFile('IE70Fixes.css'),'all'));
88        unset($ver);
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" />'));
93    }
94    $this->addMoreAttr('body', "class-ns-0", HTML::Raw('class="ns-0"'));
95
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.
99
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'));
105
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');
111
112    /**
113     * The logo image appears on every page and links to the HomePage.
114     */
115    $this->addImageAlias('logo', 'MonoBook-Logo.png');
116    //$this->addImageAlias('logo', WIKI_NAME . 'Logo.png');
117
118    /**
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
121     * be omitted.
122     */
123
124    $this->addImageAlias('signature', "Signature.png");
125    // Uncomment this next line to disable the signature.
126    $this->addImageAlias('signature', false);
127
128    /*
129     * Link icons.
130     */
131    $this->setLinkIcon('wikiuser');
132
133    /**
134     * WikiWords can automatically be split by inserting spaces between
135     * the words. The default is to leave WordsSmashedTogetherLikeSo.
136     */
137    //$this->setAutosplitWikiWords(false);
138
139    /**
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.
145     */
146    $this->setAnonEditUnknownLinks(false);
147
148    /*
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
154     * user's time zone.
155     */
156    $this->setDateFormat("%B %d, %Y");
157    $this->setTimeFormat("%H:%M");
158
159    /*
160     * To suppress times in the "Last edited on" messages, give a
161     * give a second argument of false:
162     */
163    //$this->setDateFormat("%B %d, %Y", false);
164     }
165 }
166
167 $WikiTheme = new WikiTheme_MonoBook('MonoBook');
168
169 // Local Variables:
170 // mode: php
171 // tab-width: 8
172 // c-basic-offset: 4
173 // c-hanging-comment-ender-p: nil
174 // indent-tabs-mode: nil
175 // End: