Index: trunk/phase3/skins/Modern.php |
— | — | @@ -10,6 +10,8 @@ |
11 | 11 | if( !defined( 'MEDIAWIKI' ) ) |
12 | 12 | die( -1 ); |
13 | 13 | |
| 14 | +require( dirname(__FILE__) . '/MonoBook.php' ); |
| 15 | + |
14 | 16 | /** |
15 | 17 | * Inherit main code from SkinTemplate, set the CSS and template filter. |
16 | 18 | * @todo document |
— | — | @@ -43,7 +45,7 @@ |
44 | 46 | * @todo document |
45 | 47 | * @ingroup Skins |
46 | 48 | */ |
47 | | -class ModernTemplate extends QuickTemplate { |
| 49 | +class ModernTemplate extends MonoBookTemplate { |
48 | 50 | var $skin; |
49 | 51 | /** |
50 | 52 | * Template filter callback for Modern skin. |
— | — | @@ -205,134 +207,6 @@ |
206 | 208 | <?php |
207 | 209 | wfRestoreWarnings(); |
208 | 210 | } // end of execute() method |
209 | | - |
210 | | - /*************************************************************************************************/ |
211 | | - function searchBox() { |
212 | | - global $wgUseTwoButtonsSearchForm; |
213 | | -?> |
214 | | - <!-- search --> |
215 | | - <div id="p-search" class="portlet"> |
216 | | - <h5><label for="searchInput"><?php $this->msg('search') ?></label></h5> |
217 | | - <div id="searchBody" class="pBody"> |
218 | | - <form action="<?php $this->text('wgScript') ?>" id="searchform"> |
219 | | - <input type='hidden' name="title" value="<?php $this->text('searchtitle') ?>"/> |
220 | | - <input id="searchInput" name="search" type="text"<?php echo $this->skin->tooltipAndAccesskey('search'); |
221 | | - if( isset( $this->data['search'] ) ) { |
222 | | - ?> value="<?php $this->text('search') ?>"<?php } ?> /> |
223 | | - <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('searcharticle') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> /><?php if ($wgUseTwoButtonsSearchForm) { ?> |
224 | | - <input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg('searchbutton') ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> /><?php } else { ?> |
225 | | - |
226 | | - <div><a href="<?php $this->text('searchaction') ?>" rel="search"><?php $this->msg('powersearch-legend') ?></a></div><?php } ?> |
227 | | - |
228 | | - </form> |
229 | | - </div> |
230 | | - </div> |
231 | | -<?php |
232 | | - } |
233 | | - |
234 | | - /*************************************************************************************************/ |
235 | | - function toolbox() { |
236 | | -?> |
237 | | - <!-- toolbox --> |
238 | | - <div class="portlet" id="p-tb"> |
239 | | - <h5><?php $this->msg('toolbox') ?></h5> |
240 | | - <div class="pBody"> |
241 | | - <ul> |
242 | | -<?php |
243 | | - if($this->data['notspecialpage']) { ?> |
244 | | - <li id="t-whatlinkshere"><a href="<?php |
245 | | - echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href']) |
246 | | - ?>"<?php echo $this->skin->tooltipAndAccesskey('t-whatlinkshere') ?>><?php $this->msg('whatlinkshere') ?></a></li> |
247 | | -<?php |
248 | | - if( $this->data['nav_urls']['recentchangeslinked'] ) { ?> |
249 | | - <li id="t-recentchangeslinked"><a href="<?php |
250 | | - echo htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href']) |
251 | | - ?>"<?php echo $this->skin->tooltipAndAccesskey('t-recentchangeslinked') ?>><?php $this->msg('recentchangeslinked-toolbox') ?></a></li> |
252 | | -<?php } |
253 | | - } |
254 | | - if(isset($this->data['nav_urls']['trackbacklink'])) { ?> |
255 | | - <li id="t-trackbacklink"><a href="<?php |
256 | | - echo htmlspecialchars($this->data['nav_urls']['trackbacklink']['href']) |
257 | | - ?>"<?php echo $this->skin->tooltipAndAccesskey('t-trackbacklink') ?>><?php $this->msg('trackbacklink') ?></a></li> |
258 | | -<?php } |
259 | | - if($this->data['feeds']) { ?> |
260 | | - <li id="feedlinks"><?php foreach($this->data['feeds'] as $key => $feed) { |
261 | | - ?><a id="<?php echo Sanitizer::escapeId( "feed-$key" ) ?>" href="<?php |
262 | | - echo htmlspecialchars($feed['href']) ?>" rel="alternate" type="application/<?php echo $key ?>+xml" class="feedlink"<?php echo $this->skin->tooltipAndAccesskey('feed-'.$key) ?>><?php echo htmlspecialchars($feed['text'])?></a> |
263 | | - <?php } ?></li><?php |
264 | | - } |
265 | | - |
266 | | - foreach( array('contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages') as $special ) { |
267 | | - |
268 | | - if($this->data['nav_urls'][$special]) { |
269 | | - ?><li id="t-<?php echo $special ?>"><a href="<?php echo htmlspecialchars($this->data['nav_urls'][$special]['href']) |
270 | | - ?>"<?php echo $this->skin->tooltipAndAccesskey('t-'.$special) ?>><?php $this->msg($special) ?></a></li> |
271 | | -<?php } |
272 | | - } |
273 | | - |
274 | | - if(!empty($this->data['nav_urls']['print']['href'])) { ?> |
275 | | - <li id="t-print"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['print']['href']) |
276 | | - ?>" rel="alternate"<?php echo $this->skin->tooltipAndAccesskey('t-print') ?>><?php $this->msg('printableversion') ?></a></li><?php |
277 | | - } |
278 | | - |
279 | | - if(!empty($this->data['nav_urls']['permalink']['href'])) { ?> |
280 | | - <li id="t-permalink"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['permalink']['href']) |
281 | | - ?>"<?php echo $this->skin->tooltipAndAccesskey('t-permalink') ?>><?php $this->msg('permalink') ?></a></li><?php |
282 | | - } elseif ($this->data['nav_urls']['permalink']['href'] === '') { ?> |
283 | | - <li id="t-ispermalink"<?php echo $this->skin->tooltip('t-ispermalink') ?>><?php $this->msg('permalink') ?></li><?php |
284 | | - } |
285 | | - |
286 | | - wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); |
287 | | -?> |
288 | | - </ul> |
289 | | - </div> |
290 | | - </div> |
291 | | -<?php |
292 | | - } |
293 | | - |
294 | | - /*************************************************************************************************/ |
295 | | - function languageBox() { |
296 | | - if( $this->data['language_urls'] ) { |
297 | | -?> |
298 | | - <div id="p-lang" class="portlet"> |
299 | | - <h5><?php $this->msg('otherlanguages') ?></h5> |
300 | | - <div class="pBody"> |
301 | | - <ul> |
302 | | -<?php foreach($this->data['language_urls'] as $langlink) { ?> |
303 | | - <li class="<?php echo htmlspecialchars($langlink['class'])?>"><?php |
304 | | - ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>"><?php echo $langlink['text'] ?></a></li> |
305 | | -<?php } ?> |
306 | | - </ul> |
307 | | - </div> |
308 | | - </div> |
309 | | -<?php |
310 | | - } |
311 | | - } |
312 | | - |
313 | | - /*************************************************************************************************/ |
314 | | - function customBox( $bar, $cont ) { |
315 | | -?> |
316 | | - <div class='generated-sidebar portlet' id='<?php echo Sanitizer::escapeId( "p-$bar" ) ?>'<?php echo $this->skin->tooltip('p-'.$bar) ?>> |
317 | | - <h5><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo $bar; else echo $out; ?></h5> |
318 | | - <div class='pBody'> |
319 | | -<?php if ( is_array( $cont ) ) { ?> |
320 | | - <ul> |
321 | | -<?php foreach($cont as $key => $val) { ?> |
322 | | - <li id="<?php echo Sanitizer::escapeId($val['id']) ?>"<?php |
323 | | - if ( $val['active'] ) { ?> class="active" <?php } |
324 | | - ?>><a href="<?php echo htmlspecialchars($val['href']) ?>"<?php echo $this->skin->tooltipAndAccesskey($val['id']) ?>><?php echo htmlspecialchars($val['text']) ?></a></li> |
325 | | -<?php } ?> |
326 | | - </ul> |
327 | | -<?php } else { |
328 | | - # allow raw HTML block to be defined by extensions |
329 | | - print $cont; |
330 | | - } |
331 | | -?> |
332 | | - </div> |
333 | | - </div> |
334 | | -<?php |
335 | | - } |
336 | | - |
337 | 211 | } // end of class |
338 | 212 | |
339 | 213 | |