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