fix missing </table>, quite visible running with tidy disabled on mediawiki messages
[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( -1 );
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?<?php echo $GLOBALS['wgStyleVersion'] ?>"; /*]]>*/</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?<?php echo $GLOBALS['wgStyleVersion'] ?>" />
61 <link rel="stylesheet" type="text/css" media="handheld" href="<?php $this->text('stylepath') ?>/monobook/handheld.css?<?php echo $GLOBALS['wgStyleVersion'] ?>" />
62 <!--[if lt IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
63 <!--[if IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
64 <!--[if IE 6]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
65 <!--[if IE 7]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE70Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
66 <!--[if lt IE 7]><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/common/IEFixes.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"></script>
67 <meta http-equiv="imagetoolbar" content="no" /><![endif]-->
68
69 <?php print Skin::makeGlobalVariablesScript( $this->data ); ?>
70
71 <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"><!-- wikibits js --></script>
72 <?php if($this->data['jsvarurl' ]) { ?>
73 <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl' ) ?>"><!-- site js --></script>
74 <?php } ?>
75 <?php if($this->data['pagecss' ]) { ?>
76 <style type="text/css"><?php $this->html('pagecss' ) ?></style>
77 <?php }
78 if($this->data['usercss' ]) { ?>
79 <style type="text/css"><?php $this->html('usercss' ) ?></style>
80 <?php }
81 if($this->data['userjs' ]) { ?>
82 <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('userjs' ) ?>"></script>
83 <?php }
84 if($this->data['userjsprev']) { ?>
85 <script type="<?php $this->text('jsmimetype') ?>"><?php $this->html('userjsprev') ?></script>
86 <?php }
87 if($this->data['trackbackhtml']) print $this->data['trackbackhtml']; ?>
88 <!-- Head Scripts -->
89 <?php $this->html('headscripts') ?>
90 </head>
91 <body <?php if($this->data['body_ondblclick']) { ?>ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
92 <?php if($this->data['body_onload' ]) { ?>onload="<?php $this->text('body_onload') ?>"<?php } ?>
93 class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?> <?php $this->text('pageclass') ?>">
94 <div id="globalWrapper">
95 <div id="column-content">
96 <div id="content">
97 <a name="top" id="top"></a>
98 <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
99 <h1 class="firstHeading"><?php $this->data['displaytitle']!=""?$this->html('title'):$this->text('title') ?></h1>
100 <div id="bodyContent">
101 <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
102 <div id="contentSub"><?php $this->html('subtitle') ?></div>
103 <?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?>
104 <?php if($this->data['newtalk'] ) { ?><div class="usermessage"><?php $this->html('newtalk') ?></div><?php } ?>
105 <?php if($this->data['showjumplinks']) { ?><div id="jump-to-nav"><?php $this->msg('jumpto') ?> <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div><?php } ?>
106 <!-- start content -->
107 <?php $this->html('bodytext') ?>
108 <?php if($this->data['catlinks']) { ?><div id="catlinks"><?php $this->html('catlinks') ?></div><?php } ?>
109 <!-- end content -->
110 <div class="visualClear"></div>
111 </div>
112 </div>
113 </div>
114 <div id="column-one">
115 <div id="p-cactions" class="portlet">
116 <h5><?php $this->msg('views') ?></h5>
117 <ul>
118 <?php foreach($this->data['content_actions'] as $key => $tab) { ?>
119 <li id="ca-<?php echo Sanitizer::escapeId($key) ?>"<?php
120 if($tab['class']) { ?> class="<?php echo htmlspecialchars($tab['class']) ?>"<?php }
121 ?>><a href="<?php echo htmlspecialchars($tab['href']) ?>"><?php
122 echo htmlspecialchars($tab['text']) ?></a></li>
123 <?php } ?>
124 </ul>
125 </div>
126 <div class="portlet" id="p-personal">
127 <h5><?php $this->msg('personaltools') ?></h5>
128 <div class="pBody">
129 <ul>
130 <?php foreach($this->data['personal_urls'] as $key => $item) { ?>
131 <li id="pt-<?php echo Sanitizer::escapeId($key) ?>"<?php
132 if ($item['active']) { ?> class="active"<?php } ?>><a href="<?php
133 echo htmlspecialchars($item['href']) ?>"<?php
134 if(!empty($item['class'])) { ?> class="<?php
135 echo htmlspecialchars($item['class']) ?>"<?php } ?>><?php
136 echo htmlspecialchars($item['text']) ?></a></li>
137 <?php } ?>
138 </ul>
139 </div>
140 </div>
141 <div class="portlet" id="p-logo">
142 <a style="background-image: url(<?php $this->text('logopath') ?>);" <?php
143 ?>href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>" <?php
144 ?>title="<?php $this->msg('mainpage') ?>"></a>
145 </div>
146 <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script>
147 <?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>
148 <div class='portlet' id='p-<?php echo Sanitizer::escapeId($bar) ?>'>
149 <h5><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo $bar; else echo $out; ?></h5>
150 <div class='pBody'>
151 <ul>
152 <?php foreach($cont as $key => $val) { ?>
153 <li id="<?php echo Sanitizer::escapeId($val['id']) ?>"<?php
154 if ( $val['active'] ) { ?> class="active" <?php }
155 ?>><a href="<?php echo htmlspecialchars($val['href']) ?>"><?php echo htmlspecialchars($val['text']) ?></a></li>
156 <?php } ?>
157 </ul>
158 </div>
159 </div>
160 <?php } ?>
161 <div id="p-search" class="portlet">
162 <h5><label for="searchInput"><?php $this->msg('search') ?></label></h5>
163 <div id="searchBody" class="pBody">
164 <form action="<?php $this->text('searchaction') ?>" id="searchform"><div>
165 <input id="searchInput" name="search" type="text" <?php
166 if($this->haveMsg('accesskey-search')) {
167 ?>accesskey="<?php $this->msg('accesskey-search') ?>"<?php }
168 if( isset( $this->data['search'] ) ) {
169 ?> value="<?php $this->text('search') ?>"<?php } ?> />
170 <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('searcharticle') ?>" />&nbsp;
171 <input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg('searchbutton') ?>" />
172 </div></form>
173 </div>
174 </div>
175 <div class="portlet" id="p-tb">
176 <h5><?php $this->msg('toolbox') ?></h5>
177 <div class="pBody">
178 <ul>
179 <?php
180 if($this->data['notspecialpage']) { ?>
181 <li id="t-whatlinkshere"><a href="<?php
182 echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href'])
183 ?>"><?php $this->msg('whatlinkshere') ?></a></li>
184 <?php
185 if( $this->data['nav_urls']['recentchangeslinked'] ) { ?>
186 <li id="t-recentchangeslinked"><a href="<?php
187 echo htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href'])
188 ?>"><?php $this->msg('recentchangeslinked') ?></a></li>
189 <?php }
190 }
191 if(isset($this->data['nav_urls']['trackbacklink'])) { ?>
192 <li id="t-trackbacklink"><a href="<?php
193 echo htmlspecialchars($this->data['nav_urls']['trackbacklink']['href'])
194 ?>"><?php $this->msg('trackbacklink') ?></a></li>
195 <?php }
196 if($this->data['feeds']) { ?>
197 <li id="feedlinks"><?php foreach($this->data['feeds'] as $key => $feed) {
198 ?><span id="feed-<?php echo Sanitizer::escapeId($key) ?>"><a href="<?php
199 echo htmlspecialchars($feed['href']) ?>"><?php echo htmlspecialchars($feed['text'])?></a>&nbsp;</span>
200 <?php } ?></li><?php
201 }
202
203 foreach( array('contributions', 'blockip', 'emailuser', 'upload', 'specialpages') as $special ) {
204
205 if($this->data['nav_urls'][$special]) {
206 ?><li id="t-<?php echo $special ?>"><a href="<?php echo htmlspecialchars($this->data['nav_urls'][$special]['href'])
207 ?>"><?php $this->msg($special) ?></a></li>
208 <?php }
209 }
210
211 if(!empty($this->data['nav_urls']['print']['href'])) { ?>
212 <li id="t-print"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['print']['href'])
213 ?>"><?php $this->msg('printableversion') ?></a></li><?php
214 }
215
216 if(!empty($this->data['nav_urls']['permalink']['href'])) { ?>
217 <li id="t-permalink"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['permalink']['href'])
218 ?>"><?php $this->msg('permalink') ?></a></li><?php
219 } elseif ($this->data['nav_urls']['permalink']['href'] === '') { ?>
220 <li id="t-ispermalink"><?php $this->msg('permalink') ?></li><?php
221 }
222
223 wfRunHooks( 'MonoBookTemplateToolboxEnd', array( &$this ) );
224 ?>
225 </ul>
226 </div>
227 </div>
228 <?php
229 if( $this->data['language_urls'] ) { ?>
230 <div id="p-lang" class="portlet">
231 <h5><?php $this->msg('otherlanguages') ?></h5>
232 <div class="pBody">
233 <ul>
234 <?php foreach($this->data['language_urls'] as $langlink) { ?>
235 <li class="<?php echo htmlspecialchars($langlink['class'])?>"><?php
236 ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>"><?php echo $langlink['text'] ?></a></li>
237 <?php } ?>
238 </ul>
239 </div>
240 </div>
241 <?php } ?>
242 </div><!-- end of the left (by default at least) column -->
243 <div class="visualClear"></div>
244 <div id="footer">
245 <?php
246 if($this->data['poweredbyico']) { ?>
247 <div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>
248 <?php }
249 if($this->data['copyrightico']) { ?>
250 <div id="f-copyrightico"><?php $this->html('copyrightico') ?></div>
251 <?php }
252
253 // Generate additional footer links
254 ?>
255 <ul id="f-list">
256 <?php
257 $footerlinks = array(
258 'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright',
259 'privacy', 'about', 'disclaimer', 'tagline',
260 );
261 foreach( $footerlinks as $aLink ) {
262 if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) {
263 ?> <li id="<?php echo$aLink?>"><?php $this->html($aLink) ?></li>
264 <?php }
265 }
266 ?>
267 </ul>
268 </div>
269
270 <?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
271 </div>
272 <?php $this->html('reporttime') ?>
273 <?php if ( $this->data['debug'] ): ?>
274 <!-- Debug output:
275 <?php $this->text( 'debug' ); ?>
276
277 -->
278 <?php endif; ?>
279 </body></html>
280 <?php
281 wfRestoreWarnings();
282 } // end of execute() method
283 } // end of class
284 ?>