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