Fixed bug caused in r52944 - where the inclusion of csshover.htc was lost in the...
[lhc/web/wiklou.git] / skins / Vector.php
1 <?php
2 /**
3 * Vector - Branch of MonoBook which has many usability improvements and
4 * somewhat cleaner code.
5 *
6 * @todo document
7 * @file
8 * @ingroup Skins
9 */
10
11 if( !defined( 'MEDIAWIKI' ) )
12 die( -1 );
13
14 /**
15 * SkinTemplate class for Vector skin
16 * @ingroup Skins
17 */
18 class SkinVector extends SkinTemplate {
19
20 /* Functions */
21
22 /**
23 * Initializes output page and sets up skin-specific parameters
24 * @param object $out Output page object to initialize
25 */
26 public function initPage( OutputPage $out ) {
27 global $wgStylePath;
28
29 parent::initPage( $out );
30 $this->skinname = 'vector';
31 $this->stylename = 'vector';
32 $this->template = 'VectorTemplate';
33
34 // Append skin-specific styles
35 $out->addStyle( 'vector/main-rtl.css', 'screen', '', 'rtl' );
36 $out->addStyle( 'vector/main-ltr.css', 'screen', '', 'ltr' );
37 // Append CSS which includes IE only behavior fixes for hover support -
38 // this is better than including this in a CSS fille since it doesn't
39 // wait for the CSS file to load before fetching the HTC file.
40 $out->addScript(
41 '<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
42 $wgStylePath .
43 '/vector/csshover.htc")}</style><![endif]-->'
44 );
45 }
46 /**
47 * Builds a structured array of links used for tabs and menus
48 * @return array
49 * @private
50 */
51 function buildNavigationUrls() {
52 global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle;
53 global $wgDisableLangConversion;
54
55 wfProfileIn( __METHOD__ );
56
57 $links = array(
58 'namespaces' => array(),
59 'views' => array(),
60 'actions' => array(),
61 'variants' => array()
62 );
63
64 // Detects parameters
65 $action = $wgRequest->getVal( 'action', 'view' );
66 $section = $wgRequest->getVal( 'section' );
67
68 // Checks if page is some kind of content
69 if( $this->iscontent ) {
70
71 // Gets page objects for the related namespaces
72 $subjectPage = $this->mTitle->getSubjectPage();
73 $talkPage = $this->mTitle->getTalkPage();
74
75 // Determines if this is a talk page
76 $isTalk = $this->mTitle->isTalkPage();
77
78 // Generates XML IDs from namespace names
79 $subjectId = $this->mTitle->getNamespaceKey( '' );
80
81 if ( $subjectId == 'main' ) {
82 $talkId = 'talk';
83 } else {
84 $talkId = "{$subjectId}_talk";
85 }
86 $currentId = $isTalk ? $talkId : $subjectId;
87
88 // Adds namespace links
89 $links['namespaces'][$subjectId] = $this->tabAction(
90 $subjectPage, 'vector-namespace-' . $subjectId, !$isTalk, '', true
91 );
92 $links['namespaces'][$subjectId]['context'] = 'subject';
93 $links['namespaces'][$talkId] = $this->tabAction(
94 $talkPage, 'vector-namespace-talk', $isTalk, '', true
95 );
96 $links['namespaces'][$talkId]['context'] = 'talk';
97
98 // Adds view view link
99 if ( $this->mTitle->exists() ) {
100 $links['views']['view'] = $this->tabAction(
101 $isTalk ? $talkPage : $subjectPage,
102 'vector-view-view', ( $action == 'view' ), '', true
103 );
104 }
105
106 wfProfileIn( __METHOD__ . '-edit' );
107
108 // Checks if user can...
109 if (
110 // edit the current page
111 $this->mTitle->quickUserCan( 'edit' ) &&
112 (
113 // if it exists
114 $this->mTitle->exists() ||
115 // or they can create one here
116 $this->mTitle->quickUserCan( 'create' )
117 )
118 ) {
119 // Builds CSS class for talk page links
120 $isTalkClass = $isTalk ? ' istalk' : '';
121
122 // Determines if we're in edit mode
123 $selected = (
124 ( $action == 'edit' || $action == 'submit' ) &&
125 ( $section != 'new' )
126 );
127 $links['views']['edit'] = array(
128 'class' => ( $selected ? 'selected' : '' ) . $isTalkClass,
129 'text' => $this->mTitle->exists()
130 ? wfMsg( 'vector-view-edit' )
131 : wfMsg( 'vector-view-create' ),
132 'href' =>
133 $this->mTitle->getLocalUrl( $this->editUrlOptions() )
134 );
135 // Checks if this is a current rev of talk page and we should show a new
136 // section link
137 if ( ( $isTalk && $wgArticle->isCurrent() ) || ( $wgOut->showNewSectionLink() ) ) {
138 // Checks if we should ever show a new section link
139 if ( !$wgOut->forceHideNewSectionLink() ) {
140 // Adds new section link
141 $links['actions']['addsection'] = array(
142 'class' => $section == 'new' ? 'selected' : false,
143 'text' => wfMsg( 'vector-action-addsection' ),
144 'href' => $this->mTitle->getLocalUrl(
145 'action=edit&section=new'
146 )
147 );
148 }
149 }
150 // Checks if the page is known (some kind of viewable content)
151 } elseif ( $this->mTitle->isKnown() ) {
152 // Adds view source view link
153 $links['views']['viewsource'] = array(
154 'class' => ( $action == 'edit' ) ? 'selected' : false,
155 'text' => wfMsg( 'vector-view-viewsource' ),
156 'href' =>
157 $this->mTitle->getLocalUrl( $this->editUrlOptions() )
158 );
159 }
160 wfProfileOut( __METHOD__ . '-edit' );
161
162 wfProfileIn( __METHOD__ . '-live' );
163
164 // Checks if the page exists
165 if ( $this->mTitle->exists() ) {
166 // Adds history view link
167 $links['views']['history'] = array(
168 'class' => ($action == 'history') ? 'selected' : false,
169 'text' => wfMsg( 'vector-view-history' ),
170 'href' => $this->mTitle->getLocalUrl( 'action=history' ),
171 'rel' => 'archives',
172 );
173
174 if( $wgUser->isAllowed( 'delete' ) ) {
175 $links['actions']['delete'] = array(
176 'class' => ($action == 'delete') ? 'selected' : false,
177 'text' => wfMsg( 'vector-action-delete' ),
178 'href' => $this->mTitle->getLocalUrl( 'action=delete' )
179 );
180 }
181 if ( $this->mTitle->quickUserCan( 'move' ) ) {
182 $moveTitle = SpecialPage::getTitleFor(
183 'Movepage', $this->thispage
184 );
185 $links['actions']['move'] = array(
186 'class' => $this->mTitle->isSpecial( 'Movepage' ) ?
187 'selected' : false,
188 'text' => wfMsg( 'vector-action-move' ),
189 'href' => $moveTitle->getLocalUrl()
190 );
191 }
192
193 if (
194 $this->mTitle->getNamespace() !== NS_MEDIAWIKI &&
195 $wgUser->isAllowed( 'protect' )
196 ) {
197 if ( !$this->mTitle->isProtected() ){
198 $links['actions']['protect'] = array(
199 'class' => ($action == 'protect') ?
200 'selected' : false,
201 'text' => wfMsg( 'vector-action-protect' ),
202 'href' =>
203 $this->mTitle->getLocalUrl( 'action=protect' )
204 );
205
206 } else {
207 $links['actions']['unprotect'] = array(
208 'class' => ($action == 'unprotect') ?
209 'selected' : false,
210 'text' => wfMsg( 'vector-action-unprotect' ),
211 'href' =>
212 $this->mTitle->getLocalUrl( 'action=unprotect' )
213 );
214 }
215 }
216 } else {
217 // article doesn't exist or is deleted
218 if (
219 $wgUser->isAllowed( 'deletedhistory' ) &&
220 $wgUser->isAllowed( 'undelete' )
221 ) {
222 if( $n = $this->mTitle->isDeleted() ) {
223 $undelTitle = SpecialPage::getTitleFor( 'Undelete' );
224 $links['actions']['undelete'] = array(
225 'class' => false,
226 'text' => wfMsgExt(
227 'vector-action-undelete',
228 array( 'parsemag' ),
229 $wgLang->formatNum( $n )
230 ),
231 'href' => $undelTitle->getLocalUrl(
232 'target=' . urlencode( $this->thispage )
233 )
234 );
235 }
236 }
237
238 if (
239 $this->mTitle->getNamespace() !== NS_MEDIAWIKI &&
240 $wgUser->isAllowed( 'protect' )
241 ) {
242 if ( !$this->mTitle->getRestrictions( 'create' ) ) {
243 $links['actions']['protect'] = array(
244 'class' => ($action == 'protect') ?
245 'selected' : false,
246 'text' => wfMsg( 'vector-action-protect' ),
247 'href' =>
248 $this->mTitle->getLocalUrl( 'action=protect' )
249 );
250
251 } else {
252 $links['actions']['unprotect'] = array(
253 'class' => ($action == 'unprotect') ?
254 'selected' : false,
255 'text' => wfMsg( 'vector-action-unprotect' ),
256 'href' =>
257 $this->mTitle->getLocalUrl( 'action=unprotect' )
258 );
259 }
260 }
261 }
262 wfProfileOut( __METHOD__ . '-live' );
263
264 /**
265 * The following actions use messages which, if made particular to
266 * the Vector skin, would break the Ajax code which makes this
267 * action happen entirely inline. Skin::makeGlobalVariablesScript
268 * defines a set of messages in a javascript object - and these
269 * messages are assumed to be global for all skins. Without making
270 * a change to that procedure these messages will have to remain as
271 * the global versions.
272 */
273 // Checks if the user is logged in
274 if( $this->loggedin ) {
275 // Checks if the user is watching this page
276 if( !$this->mTitle->userIsWatching() ) {
277 // Adds watch action link
278 $links['actions']['watch'] = array(
279 'class' =>
280 ( $action == 'watch' or $action == 'unwatch' ) ?
281 'selected' : false,
282 'text' => wfMsg( 'watch' ),
283 'href' => $this->mTitle->getLocalUrl( 'action=watch' )
284 );
285 } else {
286 // Adds unwatch action link
287 $links['actions']['unwatch'] = array(
288 'class' =>
289 ($action == 'unwatch' or $action == 'watch') ?
290 'selected' : false,
291 'text' => wfMsg( 'unwatch' ),
292 'href' => $this->mTitle->getLocalUrl( 'action=unwatch' )
293 );
294 }
295 }
296
297 // This is instead of SkinTemplateTabs - which uses a flat array
298 wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$links ) );
299
300 // If it's not content, it's got to be a special page
301 } else {
302 $links['namespaces']['special'] = array(
303 'class' => 'selected',
304 'text' => wfMsg( 'vector-namespace-special' ),
305 'href' => $wgRequest->getRequestURL()
306 );
307 }
308
309 // Gets list of language variants
310 $variants = $wgContLang->getVariants();
311 // Checks that language conversion is enabled and variants exist
312 if( !$wgDisableLangConversion && count( $variants ) > 1 ) {
313 // Gets preferred variant
314 $preferred = $wgContLang->getPreferredVariant();
315 // Loops over each variant
316 foreach( $variants as $code ) {
317 // Gets variant name from language code
318 $varname = $wgContLang->getVariantname( $code );
319 // Checks if the variant is marked as disabled
320 if( $varname == 'disable' ) {
321 // Skips this variant
322 continue;
323 }
324 // Appends variant link
325 $links['variants'][] = array(
326 'class' => ( $code == $preferred ) ? 'selected' : false,
327 'text' => $varname,
328 'href' => $this->mTitle->getLocalURL( '', $code )
329 );
330 }
331 }
332
333 wfProfileOut( __METHOD__ );
334
335 return $links;
336 }
337 }
338
339 /**
340 * QuickTemplate class for Vector skin
341 * @ingroup Skins
342 */
343 class VectorTemplate extends QuickTemplate {
344
345 /* Members */
346
347 /**
348 * @var Cached skin object
349 */
350 var $skin;
351
352 /* Functions */
353
354 /**
355 * Outputs the entire contents of the XHTML page
356 */
357 public function execute() {
358 global $wgRequest, $wgUseTwoButtonsSearchForm, $wgOut;
359
360 $this->skin = $this->data['skin'];
361 $action = $wgRequest->getText( 'action' );
362
363 // Suppress warnings to prevent notices about missing indexes in
364 // $this->data (is this really the best way to handle this?)
365 wfSuppressWarnings();
366
367 // Build additional attributes for navigation urls
368 $nav = $this->skin->buildNavigationUrls();
369 foreach ( $nav as $section => $links ) {
370 foreach ( $links as $key => $link ) {
371 $xmlID = $key;
372 if ( isset( $link['context'] ) && $link['context'] == 'subject' ) {
373 $xmlID = 'ca-nstab-' . $xmlID;
374 } else if ( isset( $link['context'] ) && $link['context'] == 'talk' ) {
375 $xmlID = 'ca-talk';
376 } else {
377 $xmlID = 'ca-' . $xmlID;
378 }
379 $nav[$section][$key]['attributes'] =
380 ' id="' . Sanitizer::escapeId( $xmlID ) . '"';
381 if ( $nav[$section][$key]['class'] ) {
382 $nav[$section][$key]['attributes'] .=
383 ' class="' . htmlspecialchars( $link['class'] ) . '"';
384 unset( $nav[$section][$key]['class'] );
385 }
386
387 // We don't want to give the watch tab an accesskey if the page is
388 // being edited, because that conflicts with the accesskey on the
389 // watch checkbox. We also don't want to give the edit tab an
390 // accesskey, because that's fairly superfluous and conflicts with
391 // an accesskey (Ctrl-E) often used for editing in Safari.
392 if (
393 in_array( $action, array( 'edit', 'submit' ) ) &&
394 in_array( $key, array( 'edit', 'watch', 'unwatch' ) )
395 ) {
396 $nav[$section][$key]['key'] =
397 $this->skin->tooltip( $xmlID );
398 } else {
399 $nav[$section][$key]['key'] =
400 $this->skin->tooltipAndAccesskey( $xmlID );
401 }
402 }
403 }
404 $this->data['namespace_urls'] = $nav['namespaces'];
405 $this->data['view_urls'] = $nav['views'];
406 $this->data['action_urls'] = $nav['actions'];
407 $this->data['variant_urls'] = $nav['variants'];
408
409 // Build additional attributes for personal_urls
410 foreach ( $this->data['personal_urls'] as $key => $item) {
411 $this->data['personal_urls'][$key]['attributes'] =
412 ' id="' . Sanitizer::escapeId( "pt-$key" ) . '"';
413 if ( $item['active'] ) {
414 $this->data['personal_urls'][$key]['attributes'] .=
415 ' class="active"';
416 }
417 $this->data['personal_urls'][$key]['key'] =
418 $this->skin->tooltipAndAccesskey('pt-'.$key);
419 }
420
421 // Generate additional footer links
422 $footerlinks = array(
423 'info' => array(
424 'lastmod',
425 'viewcount',
426 'numberofwatchingusers',
427 'credits',
428 'copyright',
429 'tagline',
430 ),
431 'places' => array(
432 'privacy',
433 'about',
434 'disclaimer',
435 ),
436 );
437
438 // Build list of valid footer links
439 $validFooterLinks = array();
440 foreach( $footerlinks as $category => $links ) {
441 $validFooterLinks[$category] = array();
442 foreach( $links as $link ) {
443 if( isset( $this->data[$link] ) && $this->data[$link] ) {
444 $validFooterLinks[$category][] = $link;
445 }
446 }
447 }
448
449 // Begin content output
450
451 echo $wgOut->headElement( $this->skin );
452 ?> <body<?php if($this->data['body_ondblclick']): ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php endif; ?> <?php if($this->data['body_onload']): ?> onload="<?php $this->text('body_onload') ?>"<?php endif; ?> class="mediawiki <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>">
453 <div id="page-base" class="noprint"></div>
454 <div id="head-base" class="noprint"></div>
455 <!-- content -->
456 <div id="content">
457 <a id="top"></a>
458 <div id="mw-js-message" style="display:none;"></div>
459 <!-- sitenotice -->
460 <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
461 <!-- /sitenotice -->
462 <!-- firstHeading -->
463 <h1 id="firstHeading" class="firstHeading"><?php $this->html('title') ?></h1>
464 <!-- /firstHeading -->
465 <!-- bodyContent -->
466 <div id="bodyContent">
467 <!-- tagline -->
468 <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
469 <!-- /tagline -->
470 <!-- subtitle -->
471 <div id="contentSub"><?php $this->html('subtitle') ?></div>
472 <!-- /subtitle -->
473 <?php if($this->data['undelete']): ?>
474 <!-- undelete -->
475 <div id="contentSub2"><?php $this->html('undelete') ?></div>
476 <!-- /undelete -->
477 <?php endif; ?>
478 <?php if($this->data['newtalk'] ): ?>
479 <!-- newtalk -->
480 <div class="usermessage"><?php $this->html('newtalk') ?></div>
481 <!-- /newtalk -->
482 <?php endif; ?>
483 <?php if($this->data['showjumplinks']): ?>
484 <!-- jumpto -->
485 <div id="jump-to-nav">
486 <?php $this->msg('jumpto') ?> <a href="#head"><?php $this->msg('jumptonavigation') ?></a>,
487 <a href="#search"><?php $this->msg('jumptosearch') ?></a>
488 </div>
489 <!-- /jumpto -->
490 <?php endif; ?>
491 <!-- bodytext -->
492 <?php $this->html('bodytext') ?>
493 <!-- /bodytext -->
494 <!-- catlinks -->
495 <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
496 <!-- /catlinks -->
497 <!-- dataAfterContent -->
498 <?php if($this->data['dataAfterContent']) { $this->html('dataAfterContent'); } ?>
499 <!-- /dataAfterContent -->
500 <div class="visualClear"></div>
501 </div>
502 <!-- /bodyContent -->
503 </div>
504 <!-- /content -->
505 <!-- header -->
506 <div id="head" class="noprint">
507 <!-- personal -->
508 <?php if ( count( $this->data['personal_urls'] ) > 0 ): ?>
509 <div id="p-personal">
510 <h5><?php $this->msg('personaltools') ?></h5>
511 <ul <?php $this->html('userlangattributes') ?>>
512 <?php foreach($this->data['personal_urls'] as $key => $item): ?>
513 <li <?php echo $item['attributes'] ?>><a href="<?php echo htmlspecialchars($item['href']) ?>"<?php echo $item['key'] ?><?php if(!empty($item['class'])): ?> class="<?php echo htmlspecialchars($item['class']) ?>"<?php endif; ?>><?php echo htmlspecialchars($item['text']) ?></a></li>
514 <?php endforeach; ?>
515 </ul>
516 </div>
517 <?php endif; ?>
518 <!-- /personal -->
519 <div id="left-navigation">
520 <!-- namespaces -->
521 <?php if ( count( $this->data['namespace_urls'] ) > 0 ): ?>
522 <div id="namespaces" class="vectorTabs">
523 <h5><?php $this->msg('namespaces') ?></h5>
524 <ul <?php $this->html('userlangattributes') ?>>
525 <?php foreach ($this->data['namespace_urls'] as $key => $link ): ?>
526 <li <?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><span><?php echo htmlspecialchars( $link['text'] ) ?></span></a></li>
527 <?php endforeach; ?>
528 </ul>
529 </div>
530 <?php endif; ?>
531 <!-- /namespaces -->
532 <!-- variants -->
533 <?php if ( count( $this->data['variant_urls'] ) > 0 ): ?>
534 <div id="variants" class="vectorMenu">
535 <h5><span><?php $this->msg('variants') ?></span><a href="#">&nbsp;</a></h5>
536 <div class="menu">
537 <ul <?php $this->html('userlangattributes') ?>>
538 <?php foreach ($this->data['variant_urls'] as $key => $link ): ?>
539 <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
540 <?php endforeach; ?>
541 </ul>
542 </div>
543 </div>
544 <?php endif; ?>
545 <!-- /variants -->
546 </div>
547 <div id="right-navigation">
548 <!-- views -->
549 <?php if ( count( $this->data['view_urls'] ) > 0 ): ?>
550 <div id="views" class="vectorTabs">
551 <h5><?php $this->msg('views') ?></h5>
552 <ul <?php $this->html('userlangattributes') ?>>
553 <?php foreach ($this->data['view_urls'] as $key => $link ): ?>
554 <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><span><?php echo htmlspecialchars( $link['text'] ) ?></span></a></li>
555 <?php endforeach; ?>
556 </ul>
557 </div>
558 <?php endif; ?>
559 <!-- /views -->
560 <!-- actions -->
561 <?php if ( count( $this->data['action_urls'] ) > 0 ): ?>
562 <div id="p-cactions" class="vectorMenu">
563 <h5><span><?php $this->msg('actions') ?></span><a href="#">&nbsp;</a></h5>
564 <div class="menu">
565 <ul <?php $this->html('userlangattributes') ?>>
566 <?php foreach ($this->data['action_urls'] as $key => $link ): ?>
567 <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
568 <?php endforeach; ?>
569 </ul>
570 </div>
571 </div>
572 <?php endif; ?>
573 <!-- /actions -->
574 <!-- search -->
575 <div id="p-search">
576 <h5 <?php $this->html('userlangattributes') ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5>
577 <form action="<?php $this->text( 'wgScript' ) ?>" id="searchform">
578 <input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>"/>
579 <input id="searchInput" name="search" type="text" <?php echo $this->skin->tooltipAndAccesskey( 'search' ); ?> <?php if( isset( $this->data['search'] ) ): ?> value="<?php $this->text( 'search' ) ?>"<?php endif; ?> />
580 <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg( 'searcharticle' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> />
581 <?php if ( $wgUseTwoButtonsSearchForm ): ?>
582 <input type="submit" name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg( 'searchbutton' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> />
583 <?php else: ?>
584 <div><a href="<?php $this->text( 'searchaction' ) ?>" rel="search"><?php $this->msg( 'powersearch-legend' ) ?></a></div>
585 <?php endif; ?>
586 </form>
587 </div>
588 <!-- /search -->
589 </div>
590 </div>
591 <!-- /header -->
592 <!-- panel -->
593 <div id="panel" class="noprint">
594 <!-- sidebar -->
595 <?php
596 $sidebar = $this->data['sidebar'];
597 $sidebar['TOOLBOX'] = ( !isset( $sidebar['TOOLBOX'] ) );
598 $sidebar['LANGUAGES'] = ( !isset( $sidebar['LANGUAGES'] ) );
599 foreach ( $sidebar as $name => $content ) {
600 switch( $name ) {
601 case 'SEARCH':
602 break;
603 case 'TOOLBOX':
604 $this->toolBox();
605 break;
606 case 'LANGUAGES':
607 $this->languageBox();
608 break;
609 default:
610 $this->customBox( $name, $content );
611 break;
612 }
613 }
614 ?>
615 <!-- /sidebar -->
616 </div>
617 <!-- /panel -->
618 <div class="break"></div>
619 <!-- foot -->
620 <div id="foot">
621 <?php foreach( $validFooterLinks as $category => $links ): ?>
622 <?php if ( count( $links ) > 0 ): ?>
623 <ul id="foot-<?php echo $category ?>">
624 <?php foreach( $links as $link ): ?>
625 <?php if( isset( $this->data[$link] ) && $this->data[$link] ): ?>
626 <li id="foot-<?php echo $category ?>-<?php echo $link ?>"><?php $this->html( $link ) ?></li>
627 <?php endif; ?>
628 <?php endforeach; ?>
629 </ul>
630 <?php endif; ?>
631 <?php endforeach; ?>
632 <ul id="foot-icons" class="noprint">
633 <?php if( $this->data['poweredbyico'] ): ?>
634 <li id="foot-icon-poweredby"><?php $this->html( 'poweredbyico' ) ?></li>
635 <?php endif; ?>
636 <?php if( $this->data['copyrightico'] ): ?>
637 <li id="foot-icon-copyright"><?php $this->html( 'copyrightico' ) ?></li>
638 <?php endif; ?>
639 </ul>
640 <div style="clear:both"></div>
641 </div>
642 <!-- /foot -->
643 <!-- logo -->
644 <div id="p-logo">
645 <a style="background-image: url(<?php $this->text('logopath') ?>);" href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>" <?php echo $this->skin->tooltipAndAccesskey('p-logo') ?>></a>
646 </div>
647 <!-- /logo -->
648 <!-- fixalpha -->
649 <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha( 'p-logo' ); </script>
650 <!-- /fixalpha -->
651 <?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?>
652 <?php $this->html( 'reporttime' ) ?>
653 <?php if ( $this->data['debug'] ): ?>
654 <!-- Debug output:
655 <?php $this->text( 'debug' ); ?>
656 -->
657 <?php endif; ?>
658 </body>
659 </html>
660 <?php
661 // We're done with abusing arrays now...
662 wfRestoreWarnings();
663 }
664
665 /**
666 * Outputs a box with a list of tools
667 */
668 private function toolBox() {
669 ?>
670 <div class="portal" id="p-tb">
671 <h5 <?php $this->html('userlangattributes') ?>><?php $this->msg( 'toolbox' ) ?></h5>
672 <div class="body">
673 <ul>
674 <?php if( $this->data['notspecialpage'] ): ?>
675 <li id="t-whatlinkshere"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['whatlinkshere']['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-whatlinkshere' ) ?>><?php $this->msg( 'whatlinkshere' ) ?></a></li>
676 <?php if( $this->data['nav_urls']['recentchangeslinked'] ): ?>
677 <li id="t-recentchangeslinked"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['recentchangeslinked']['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-recentchangeslinked' ) ?>><?php $this->msg( 'recentchangeslinked-toolbox' ) ?></a></li>
678 <?php endif; ?>
679 <?php endif; ?>
680 <?php if( isset( $this->data['nav_urls']['trackbacklink'] ) ): ?>
681 <li id="t-trackbacklink"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['trackbacklink']['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-trackbacklink' ) ?>><?php $this->msg( 'trackbacklink' ) ?></a></li>
682 <?php endif; ?>
683 <?php if( $this->data['feeds']): ?>
684 <li id="feedlinks">
685 <?php foreach( $this->data['feeds'] as $key => $feed ): ?>
686 <a id="<?php echo Sanitizer::escapeId( "feed-$key" ) ?>" href="<?php 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>
687 <?php endforeach; ?>
688 </li>
689 <?php endif; ?>
690 <?php foreach( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages' ) as $special ): ?>
691 <?php if( $this->data['nav_urls'][$special]): ?>
692 <li id="t-<?php echo $special ?>"><a href="<?php echo htmlspecialchars( $this->data['nav_urls'][$special]['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-' . $special ) ?>><?php $this->msg( $special ) ?></a></li>
693 <?php endif; ?>
694 <?php endforeach; ?>
695 <?php if( !empty( $this->data['nav_urls']['print']['href'] ) ): ?>
696 <li id="t-print"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['print']['href'] ) ?>" rel="alternate"<?php echo $this->skin->tooltipAndAccesskey( 't-print' ) ?>><?php $this->msg( 'printableversion' ) ?></a></li>
697 <?php endif; ?>
698 <?php if ( !empty( $this->data['nav_urls']['permalink']['href'] ) ): ?>
699 <li id="t-permalink"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['permalink']['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-permalink' ) ?>><?php $this->msg( 'permalink' ) ?></a></li>
700 <?php elseif ( $this->data['nav_urls']['permalink']['href'] === '' ): ?>
701 <li id="t-ispermalink"<?php echo $this->skin->tooltip( 't-ispermalink' ) ?>><?php $this->msg( 'permalink' ) ?></li>
702 <?php endif; ?>
703 <?php wfRunHooks( 'VectorTemplateToolboxEnd', array( &$this ) ); ?>
704 <?php wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); ?>
705 </ul>
706 </div>
707 </div>
708 <?php
709 }
710
711 /**
712 * Outputs a box with a list of alternative languages for this page
713 */
714 private function languageBox() {
715 if( $this->data['language_urls'] ) {
716 ?>
717 <div class="portal" id="p-lang">
718 <h5 <?php $this->html('userlangattributes') ?>><?php $this->msg( 'otherlanguages' ) ?></h5>
719 <div class="body">
720 <ul>
721 <?php foreach ( $this->data['language_urls'] as $langlink ): ?>
722 <li class="<?php echo htmlspecialchars( $langlink['class'] ) ?>"><a href="<?php echo htmlspecialchars( $langlink['href'] ) ?>"><?php echo $langlink['text'] ?></a></li>
723 <?php endforeach; ?>
724 </ul>
725 </div>
726 </div>
727 <?php
728 }
729 }
730
731 /**
732 * Outputs a box with a custom list of items or HTML content
733 * @param string $bar Message name for title of box
734 * @param mixed $content HTML or array of items to build a list from
735 */
736 private function customBox( $bar, $content ) {
737 ?>
738 <div class="portal" id='<?php echo Sanitizer::escapeId( "p-$bar" ) ?>'<?php echo $this->skin->tooltip( 'p-' . $bar ) ?>>
739 <h5 <?php $this->html('userlangattributes') ?>><?php $out = wfMsg( $bar ); if ( wfEmptyMsg( $bar, $out ) ) echo htmlspecialchars( $bar ); else echo htmlspecialchars( $out ); ?></h5>
740 <div class="body">
741 <?php if ( is_array( $content ) ): ?>
742 <ul>
743 <?php foreach( $content as $key => $val ): ?>
744 <li id="<?php echo Sanitizer::escapeId( $val['id'] ) ?>"<?php if ( $val['active'] ): ?> class="active" <?php endif; ?>><a href="<?php echo htmlspecialchars( $val['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( $val['id'] ) ?>><?php echo htmlspecialchars( $val['text'] ) ?></a></li>
745 <?php endforeach; ?>
746 </ul>
747 <?php else: ?>
748 <?php echo $content; /* Allow raw HTML block to be defined by extensions */ ?>
749 <?php endif; ?>
750 </div>
751 </div>
752 <?php
753 }
754 }