5184a03bd1ca84641efe1c949f21e6dae67e746a
[lhc/web/wiklou.git] / skins / MonoBook.php
1 <?php
2 /**
3 * MonoBook nouveau
4 *
5 * Translated from gwicke's previous TAL template version to remove
6 * dependency on PHPTAL.
7 *
8 * @todo document
9 * @package MediaWiki
10 * @subpackage Skins
11 */
12
13 if( !defined( 'MEDIAWIKI' ) )
14 die();
15
16 /** */
17 require_once('includes/SkinTemplate.php');
18
19 /**
20 * Inherit main code from SkinTemplate, set the CSS and template filter.
21 * @todo document
22 * @package MediaWiki
23 * @subpackage Skins
24 */
25 class SkinMonoBook extends SkinTemplate {
26 /** Using monobook. */
27 function initPage( &$out ) {
28 SkinTemplate::initPage( $out );
29 $this->skinname = 'monobook';
30 $this->stylename = 'monobook';
31 $this->template = 'MonoBookTemplate';
32 }
33 }
34
35 /**
36 * @todo document
37 * @package MediaWiki
38 * @subpackage Skins
39 */
40 class MonoBookTemplate extends QuickTemplate {
41 /**
42 * Template filter callback for MonoBook skin.
43 * Takes an associative array of data set from a SkinTemplate-based
44 * class, and a wrapper for MediaWiki's localization database, and
45 * outputs a formatted page.
46 *
47 * @access private
48 */
49 function execute() {
50 // Suppress warnings to prevent notices about missing indexes in $this->data
51 wfSuppressWarnings();
52
53 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
54 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
55 <head>
56 <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
57 <?php $this->html('headlinks') ?>
58 <title><?php $this->text('pagetitle') ?></title>
59 <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css"; /*]]>*/</style>
60 <link rel="stylesheet" type="text/css" <?php if(empty($this->data['printable']) ) { ?>media="print"<?php } ?> href="<?php $this->text('stylepath') ?>/common/commonPrint.css" />
61 <!--[if lt IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css";</style><![endif]-->
62 <!--[if IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css";</style><![endif]-->
63 <!--[if IE 6]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css";</style><![endif]-->
64 <!--[if IE]><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/common/IEFixes.js"></script>
65 <meta http-equiv="imagetoolbar" content="no" /><![endif]-->
66 <?php if($this->data['jsvarurl' ]) { ?><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl' ) ?>"></script><?php } ?>
67 <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js"></script>
68 <?php if($this->data['usercss' ]) { ?><style type="text/css"><?php $this->html('usercss' ) ?></style><?php } ?>
69 <?php if($this->data['userjs' ]) { ?><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('userjs' ) ?>"></script><?php } ?>
70 <?php if($this->data['userjsprev']) { ?><script type="<?php $this->text('jsmimetype') ?>"><?php $this->html('userjsprev') ?></script><?php } ?>
71 <?php if($this->data['trackbackhtml']) print $this->data['trackbackhtml']; ?>
72 </head>
73 <body <?php if($this->data['body_ondblclick']) { ?>ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
74 <?php if($this->data['body_onload' ]) { ?>onload="<?php $this->text('body_onload') ?>"<?php } ?>
75 <?php if($this->data['nsclass' ]) { ?>class="<?php $this->text('nsclass') ?>"<?php } ?>>
76 <div id="globalWrapper">
77 <div id="column-content">
78 <div id="content">
79 <a name="top" id="contentTop"></a>
80 <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
81 <h1 class="firstHeading"><?php $this->text('title') ?></h1>
82 <div id="bodyContent">
83 <?php if($this->data['catlinks']) { ?><div id="catlinks-top"><?php $this->html('catlinks') ?></div><?php } ?>
84 <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
85 <div id="contentSub"><?php $this->html('subtitle') ?></div>
86 <?php if($this->data['undelete']) { ?><div id="contentSub"><?php $this->html('undelete') ?></div><?php } ?>
87 <?php if($this->data['newtalk'] ) { ?><div class="usermessage"><?php $this->html('newtalk') ?></div><?php } ?>
88 <!-- start content -->
89 <?php $this->html('bodytext') ?>
90 <?php if($this->data['catlinks']) { ?><div id="catlinks"><?php $this->html('catlinks') ?></div><?php } ?>
91 <!-- end content -->
92 <div class="visualClear"></div>
93 </div>
94 </div>
95 </div>
96 <div id="column-one">
97 <div id="p-cactions" class="portlet">
98 <h5><?php $this->msg('views') ?></h5>
99 <ul>
100 <?php foreach($this->data['content_actions'] as $key => $action) {
101 ?><li id="ca-<?php echo htmlspecialchars($key) ?>"
102 <?php if($action['class']) { ?>class="<?php echo htmlspecialchars($action['class']) ?>"<?php } ?>
103 ><a href="<?php echo htmlspecialchars($action['href']) ?>"><?php
104 echo htmlspecialchars($action['text']) ?></a></li><?php
105 } ?>
106 </ul>
107 </div>
108 <div class="portlet" id="p-personal">
109 <h5><?php $this->msg('personaltools') ?></h5>
110 <div class="pBody">
111 <ul>
112 <?php foreach($this->data['personal_urls'] as $key => $item) {
113 ?><li id="pt-<?php echo htmlspecialchars($key) ?>"><a href="<?php
114 echo htmlspecialchars($item['href']) ?>"<?php
115 if(!empty($item['class'])) { ?> class="<?php
116 echo htmlspecialchars($item['class']) ?>"<?php } ?>><?php
117 echo htmlspecialchars($item['text']) ?></a></li><?php
118 } ?>
119 </ul>
120 </div>
121 </div>
122 <div class="portlet" id="p-logo">
123 <a style="background-image: url(<?php $this->text('logopath') ?>);"
124 href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>"
125 title="<?php $this->msg('mainpage') ?>"></a>
126 </div>
127 <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script>
128 <?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>
129 <div class='portlet' id='p-<?php echo htmlspecialchars($bar) ?>'>
130 <h5><?php $this->msg( $bar ) ?></h5>
131 <div class='pBody'>
132 <ul>
133 <?php foreach($cont as $key => $val) { ?>
134 <li id="<?php echo htmlspecialchars($val['id']) ?>"><a href="<?php echo htmlspecialchars($val['href']) ?>"><?php echo htmlspecialchars($val['text'])?></a></li>
135 <?php } ?>
136 </ul>
137 </div>
138 </div>
139 <?php } ?>
140 <div id="p-search" class="portlet">
141 <h5><label for="searchInput"><?php $this->msg('search') ?></label></h5>
142 <div class="pBody">
143 <form name="searchform" action="<?php $this->text('searchaction') ?>" id="searchform">
144 <input id="searchInput" name="search" type="text"
145 <?php if($this->haveMsg('accesskey-search')) {
146 ?>accesskey="<?php $this->msg('accesskey-search') ?>"<?php }
147 if( isset( $this->data['search'] ) ) {
148 ?> value="<?php $this->text('search') ?>"<?php } ?> />
149 <input type='submit' name="go" class="searchButton" id="searchGoButton"
150 value="<?php $this->msg('go') ?>"
151 />&nbsp;<input type='submit' name="fulltext"
152 class="searchButton"
153 value="<?php $this->msg('search') ?>" />
154 </form>
155 </div>
156 </div>
157 <div class="portlet" id="p-tb">
158 <h5><?php $this->msg('toolbox') ?></h5>
159 <div class="pBody">
160 <ul>
161 <?php if($this->data['notspecialpage']) { foreach( array( 'whatlinkshere', 'recentchangeslinked' ) as $special ) { ?>
162 <li id="t-<?php echo $special?>"><a href="<?php
163 echo htmlspecialchars($this->data['nav_urls'][$special]['href'])
164 ?>"><?php echo $this->msg($special) ?></a></li>
165 <?php } } ?>
166 <?php if(isset($this->data['nav_urls']['trackbacklink'])) { ?>
167 <li id="t-trackbacklink"><a href="<?php
168 echo htmlspecialchars($this->data['nav_urls']['trackbacklink']['href'])
169 ?>"><?php echo $this->msg('trackbacklink') ?></a></li>
170 <?php } ?>
171 <?php if($this->data['feeds']) { ?><li id="feedlinks"><?php foreach($this->data['feeds'] as $key => $feed) {
172 ?><span id="feed-<?php echo htmlspecialchars($key) ?>"><a href="<?php
173 echo htmlspecialchars($feed['href']) ?>"><?php echo htmlspecialchars($feed['text'])?></a>&nbsp;</span>
174 <?php } ?></li><?php } ?>
175 <?php foreach( array('contributions', 'emailuser', 'upload', 'specialpages') as $special ) { ?>
176 <?php if($this->data['nav_urls'][$special]) {?><li id="t-<?php echo $special ?>"><a href="<?php
177 echo htmlspecialchars($this->data['nav_urls'][$special]['href'])
178 ?>"><?php $this->msg($special) ?></a></li><?php } ?>
179 <?php } ?>
180 <?php if(!empty($this->data['nav_urls']['print']['href'])) { ?>
181 <li id="t-print"><a href="<?php
182 echo htmlspecialchars($this->data['nav_urls']['print']['href'])
183 ?>"><?php echo $this->msg('printableversion') ?></a></li>
184 <?php } ?>
185 </ul>
186 </div>
187 </div>
188 <?php if( $this->data['language_urls'] ) { ?><div id="p-lang" class="portlet">
189 <h5><?php $this->msg('otherlanguages') ?></h5>
190 <div class="pBody">
191 <ul>
192 <?php foreach($this->data['language_urls'] as $langlink) { ?>
193 <li>
194 <a href="<?php echo htmlspecialchars($langlink['href'])
195 ?>"><?php echo $langlink['text'] ?></a>
196 </li>
197 <?php } ?>
198 </ul>
199 </div>
200 </div>
201 <?php } ?>
202 </div><!-- end of the left (by default at least) column -->
203 <div class="visualClear"></div>
204 <div id="footer">
205 <?php if($this->data['poweredbyico']) { ?><div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div><?php } ?>
206 <?php if($this->data['copyrightico']) { ?><div id="f-copyrightico"><?php $this->html('copyrightico') ?></div><?php } ?>
207 <ul id="f-list">
208 <?php if($this->data['lastmod' ]) { ?><li id="f-lastmod"><?php $this->html('lastmod') ?></li><?php } ?>
209 <?php if($this->data['viewcount' ]) { ?><li id="f-viewcount"><?php $this->html('viewcount') ?></li><?php } ?>
210 <?php if($this->data['numberofwatchingusers' ]) { ?><li id="f-numberofwatchingusers"><?php $this->html('numberofwatchingusers') ?></li><?php } ?>
211 <?php if($this->data['credits' ]) { ?><li id="f-credits"><?php $this->html('credits') ?></li><?php } ?>
212 <?php if($this->data['copyright' ]) { ?><li id="f-copyright"><?php $this->html('copyright') ?></li><?php } ?>
213 <?php if($this->data['about' ]) { ?><li id="f-about"><?php $this->html('about') ?></li><?php } ?>
214 <?php if($this->data['disclaimer']) { ?><li id="f-disclaimer"><?php $this->html('disclaimer') ?></li><?php } ?>
215 <?php if($this->data['tagline']) { ?><li id="f-tagline"><?php echo $this->data['tagline'] ?></li><?php } ?>
216 </ul>
217 </div>
218 </div>
219 <?php $this->html('reporttime') ?>
220 </body>
221 </html>
222 <?php
223 wfRestoreWarnings();
224 }
225 }
226 ?>