3 * Vector - Branch of MonoBook which has many usability improvements and
4 * somewhat cleaner code.
11 if( !defined( 'MEDIAWIKI' ) )
15 * SkinTemplate class for Vector skin
18 class SkinVector
extends SkinTemplate
{
23 * Intializes output page and sets up skin-specific parameters
24 * @param object $out Output page object to initialize
26 public function initPage( OutputPage
$out ) {
27 parent
::initPage( $out );
28 $this->skinname
= 'vector';
29 $this->stylename
= 'vector';
30 $this->template
= 'VectorTemplate';
34 * Defines CSS files to be included
35 * @param object $out Output page to add styles to
37 public function setupSkinUserCss( OutputPage
$out ) {
38 global $wgHandheldStyle;
40 parent
::setupSkinUserCss( $out );
42 // Append to the default screen common & print styles...
43 $out->addStyle( 'vector/main.css', 'screen' );
47 * A structured array of edit links by default used for the tabs
51 function buildNavigationUrls() {
52 global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest;
53 global $wgEnableVariants;
55 wfProfileIn( __METHOD__
);
58 'namespaces' => array(),
65 $action = $wgRequest->getVal( 'action', 'view' );
66 $section = $wgRequest->getVal( 'section' );
68 // Checks if page is some kind of content
69 if( $this->iscontent
) {
71 // Gets page objects for the related namespaces
72 $subjectPage = $this->mTitle
->getSubjectPage();
73 $talkPage = $this->mTitle
->getTalkPage();
75 // Determines if this is a talk page
76 $isTalk = $this->mTitle
->isTalkPage();
78 // Generates XML IDs from namespace names
79 $subjectId = $wgContLang->lc( $this->mTitle
->getSubjectNsText() );
80 if ( $subjectId == '' ) {
83 $talkId = "{$subjectId}_talk";
84 $currentId = $isTalk ?
$talkId : $subjectId;
86 // Adds namespace links
87 $links['namespaces'][$subjectId] = $this->tabAction(
88 $subjectPage, 'nstab-' . $subjectId, !$isTalk, '', true
90 $links['namespaces'][$talkId] = $this->tabAction(
91 $talkPage, 'talk', $isTalk, '', true
94 // Adds view view link
95 if ( $this->mTitle
->exists() ) {
96 $links['views']['view'] = $this->tabAction(
97 $isTalk ?
$talkPage : $subjectPage,
98 'view', ( $action == 'view' ), '', true
102 wfProfileIn( __METHOD__
. '-edit' );
104 // Checks if user can...
106 // edit the current page
107 $this->mTitle
->quickUserCan( 'edit' ) &&
110 $this->mTitle
->exists() ||
111 // or they can create one here
112 $this->mTitle
->quickUserCan( 'create' )
115 // Builds CSS class for talk page links
116 $isTalkClass = $isTalk ?
' istalk' : '';
118 // Determines if we're in edit mode
120 ( $action == 'edit' ||
$action == 'submit' ) &&
121 ( $section != 'new' )
123 $links['views']['edit'] = array(
124 'class' => ( $selected ?
'selected' : '' ) . $isTalkClass,
125 'text' => $this->mTitle
->exists()
129 $this->mTitle
->getLocalUrl( $this->editUrlOptions() )
131 // Checks if this is a talk page and we should show a new
133 if ( $isTalk ||
$wgOut->showNewSectionLink() ) {
134 // Checks if we should ever show a new section link
135 if ( !$wgOut->forceHideNewSectionLink() ) {
136 // Adds new section link
137 $links['actions']['addsection'] = array(
138 'class' => $section == 'new' ?
'selected' : false,
139 'text' => wfMsg( 'addsection' ),
140 'href' => $this->mTitle
->getLocalUrl(
141 'action=edit§ion=new'
146 // Checks if the page is known (some kind of viewable content)
147 } elseif ( $this->mTitle
->isKnown() ) {
148 // Adds view source view link
149 $links['views']['viewsource'] = array(
150 'class' => ( $action == 'edit') ?
'selected' : false,
151 'text' => wfMsg( 'viewsource' ),
153 $this->mTitle
->getLocalUrl( $this->editUrlOptions() )
156 wfProfileOut( __METHOD__
. '-edit' );
158 wfProfileIn( __METHOD__
. '-live' );
160 // Checks if the page exists
161 if ( $this->mTitle
->exists() ) {
162 // Adds history view link
163 $links['views']['history'] = array(
164 'class' => ($action == 'history') ?
'selected' : false,
165 'text' => wfMsg( 'history_short' ),
166 'href' => $this->mTitle
->getLocalUrl( 'action=history' ),
170 if( $wgUser->isAllowed( 'delete' ) ) {
171 $links['actions']['delete'] = array(
172 'class' => ($action == 'delete') ?
'selected' : false,
173 'text' => wfMsg( 'delete' ),
174 'href' => $this->mTitle
->getLocalUrl( 'action=delete' )
177 if ( $this->mTitle
->quickUserCan( 'move' ) ) {
178 $moveTitle = SpecialPage
::getTitleFor(
179 'Movepage', $this->thispage
181 $links['actions']['move'] = array(
182 'class' => $this->mTitle
->isSpecial( 'Movepage' ) ?
184 'text' => wfMsg( 'move' ),
185 'href' => $moveTitle->getLocalUrl()
190 $this->mTitle
->getNamespace() !== NS_MEDIAWIKI
&&
191 $wgUser->isAllowed( 'protect' )
193 if ( !$this->mTitle
->isProtected() ){
194 $links['actions']['protect'] = array(
195 'class' => ($action == 'protect') ?
197 'text' => wfMsg( 'protect' ),
199 $this->mTitle
->getLocalUrl( 'action=protect' )
203 $links['actions']['unprotect'] = array(
204 'class' => ($action == 'unprotect') ?
206 'text' => wfMsg( 'unprotect' ),
208 $this->mTitle
->getLocalUrl( 'action=unprotect' )
213 // article doesn't exist or is deleted
215 $wgUser->isAllowed( 'deletedhistory' ) &&
216 $wgUser->isAllowed( 'undelete' )
218 if( $n = $this->mTitle
->isDeleted() ) {
219 $undelTitle = SpecialPage
::getTitleFor( 'Undelete' );
220 $links['actions']['undelete'] = array(
225 $wgLang->formatNum( $n )
227 'href' => $undelTitle->getLocalUrl(
228 'target=' . urlencode( $this->thispage
)
235 $this->mTitle
->getNamespace() !== NS_MEDIAWIKI
&&
236 $wgUser->isAllowed( 'protect' )
238 if ( !$this->mTitle
->getRestrictions( 'create' ) ) {
239 $links['actions']['protect'] = array(
240 'class' => ($action == 'protect') ?
242 'text' => wfMsg( 'protect' ),
244 $this->mTitle
->getLocalUrl( 'action=protect' )
248 $links['actions']['unprotect'] = array(
249 'class' => ($action == 'unprotect') ?
251 'text' => wfMsg( 'unprotect' ),
253 $this->mTitle
->getLocalUrl( 'action=unprotect' )
258 wfProfileOut( __METHOD__
. '-live' );
260 // Checks if the user is logged in
261 if( $this->loggedin
) {
262 // Checks if the user is watching this page
263 if( !$this->mTitle
->userIsWatching() ) {
264 // Adds watch action link
265 $links['actions']['watch'] = array(
267 ( $action == 'watch' or $action == 'unwatch') ?
269 'text' => wfMsg( 'watch' ),
270 'href' => $this->mTitle
->getLocalUrl( 'action=watch' )
273 // Adds unwatch action link
274 $links['actions']['unwatch'] = array(
276 ($action == 'unwatch' or $action == 'watch') ?
278 'text' => wfMsg( 'unwatch' ),
279 'href' => $this->mTitle
->getLocalUrl( 'action=unwatch' )
284 // If it's not content, it's got to be a special page
286 $links['namespaces']['special'] = array(
287 'class' => 'selected',
288 'text' => wfMsg('nstab-special'),
289 'href' => $wgRequest->getRequestURL()
293 // Gets list of language variants
294 $variants = $wgContLang->getVariants();
295 // Checks that language conversion is enabled and variants exist
296 if( $wgEnableVariants && count( $variants ) > 1 ) {
297 // Gets preferred variant
298 $preferred = $wgContLang->getPreferredVariant();
299 // Loops over each variant
301 foreach( $variants as $code ) {
302 // Gets variant name from language code
303 $varname = $wgContLang->getVariantname( $code );
304 // Checks if the variant is marked as disabled
305 if( $varname == 'disable' ) {
306 // Skips this variant
309 // Appends variant link
310 $links['variants'][$vcount] = array(
311 'class' => ( $code == $preferred )?
'selected' : false,
313 'href' => $this->mTitle
->getLocalURL( '', $code )
319 wfProfileOut( __METHOD__
);
326 * QuickTemplate class for Vector skin
329 class VectorTemplate
extends QuickTemplate
{
334 * @var Cached skin object
341 * Outputs the entire contents of the XHTML page
343 public function execute() {
344 global $wgRequest, $wgUseTwoButtonsSearchForm;
346 $this->skin
= $this->data
['skin'];
347 $action = $wgRequest->getText( 'action' );
349 // Suppress warnings to prevent notices about missing indexes in
350 // $this->data (is this really the best way to handle this?)
351 wfSuppressWarnings();
353 // Build additional attributes for navigation urls
354 $nav = $this->skin
->buildNavigationUrls();
355 foreach ( $nav as $section => $links ) {
356 foreach ( $links as $key => $link ) {
357 $nav[$section][$key]['attributes'] =
358 ' id="' . Sanitizer
::escapeId( "ca-$key" ) . '"';
359 if ( $nav[$section][$key]['class'] ) {
360 $nav[$section][$key]['attributes'] .=
361 ' class="' . htmlspecialchars( $link['class'] ) . '"';
363 // We don't want to give the watch tab an accesskey if the page is
364 // being edited, because that conflicts with the accesskey on the
365 // watch checkbox. We also don't want to give the edit tab an
366 // accesskey, because that's fairly superfluous and conflicts with
367 // an accesskey (Ctrl-E) often used for editing in Safari.
369 in_array( $action, array( 'edit', 'submit' ) ) &&
370 in_array( $key, array( 'edit', 'watch', 'unwatch' ) )
372 $nav[$section][$key]['key'] =
373 $this->skin
->tooltip( "ca-$key" );
375 $nav[$section][$key]['key'] =
376 $this->skin
->tooltipAndAccesskey( "ca-$key" );
380 $this->data
['namespace_urls'] = $nav['namespaces'];
381 $this->data
['view_urls'] = $nav['views'];
382 $this->data
['action_urls'] = $nav['actions'];
383 $this->data
['variant_urls'] = $nav['variants'];
385 // Build additional attributes for personal_urls
386 foreach ( $this->data
['personal_urls'] as $key => $item) {
387 $this->data
['personal_urls'][$key]['attributes'] =
388 ' id="' . Sanitizer
::escapeId( "pt-$key" ) . '"';
389 if ( $item['active'] ) {
390 $this->data
['personal_urls'][$key]['attributes'] .=
393 $this->data
['personal_urls'][$key]['key'] =
394 $this->skin
->tooltipAndAccesskey('pt-'.$key);
397 // Generate additional footer links
398 $footerlinks = array(
402 'numberofwatchingusers',
414 // Build list of valid footer links
415 $validFooterLinks = array();
416 foreach( $footerlinks as $category => $links ) {
417 $validFooterLinks[$category] = array();
418 foreach( $links as $link ) {
419 if( isset( $this->data
[$link] ) && $this->data
[$link] ) {
420 $validFooterLinks[$category][] = $link;
425 // Begin content output
426 ?
><!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
427 <html xmlns
="<?php $this->text('xhtmldefaultnamespace') ?>" <?php
foreach($this->data
['xhtmlnamespaces'] as $tag => $ns): ?
>xmlns
:<?php
echo "{$tag}=\"{$ns}\" "; ?
><?php
endforeach ?
>xml
:lang
="<?php $this->text('lang') ?>" lang
="<?php $this->text('lang') ?>" dir
="<?php $this->text('dir') ?>">
429 <meta http
-equiv
="Content-Type" content
="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
430 <title
><?php
$this->text('pagetitle') ?
></title
>
432 <?php
$this->html('headlinks') ?
>
435 <?php
$this->html('csslinks') ?
>
438 <!--[if lt IE
7]><script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath') ?>/common/IEFixes.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"></script
>
439 <meta http
-equiv
="imagetoolbar" content
="no" /><![endif]-->
441 <!-- globalVariablesScript
-->
442 <?php
echo Skin
::makeGlobalVariablesScript( $this->data
); ?
>
443 <!-- /globalVariablesScript
-->
445 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('stylepath' ) ?>/common/wikibits.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"><!-- wikibits js
--></script
>
448 <?php
$this->html('headscripts') ?
>
449 <!-- /headscripts
-->
450 <?php
if($this->data
['jsvarurl']): ?
>
452 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('jsvarurl') ?>"><!-- site js
--></script
>
455 <?php
if($this->data
['pagecss']): ?
>
457 <style type
="text/css"><?php
$this->html('pagecss') ?
></style
>
460 <?php
if($this->data
['usercss']): ?
>
462 <style type
="text/css"><?php
$this->html('usercss') ?
></style
>
465 <?php
if($this->data
['userjs']): ?
>
467 <script type
="<?php $this->text('jsmimetype') ?>" src
="<?php $this->text('userjs' ) ?>"></script
>
470 <?php
if($this->data
['userjsprev']): ?
>
472 <script type
="<?php $this->text('jsmimetype') ?>"><?php
$this->html('userjsprev') ?
></script
>
475 <?php
if($this->data
['trackbackhtml']): ?
>
476 <!-- trackbackhtml
-->
477 <?php
echo $this->data
['trackbackhtml']; ?
>
478 <!-- /trackbackhtml
-->
481 <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') ?>">
482 <div id
="content-base"><div
></div
></div
>
483 <div id
="panel-base"></div
>
489 <a name
="top" id
="top"></a
>
491 <?php
if($this->data
['sitenotice']) { ?
><div id
="siteNotice"><?php
$this->html('sitenotice') ?
></div
><?php
} ?
>
493 <!-- firstHeading
-->
494 <h1 id
="firstHeading" class="firstHeading"><?php
$this->html('title') ?
></h1
>
495 <!-- /firstHeading
-->
497 <div id
="bodyContent">
499 <h3 id
="siteSub"><?php
$this->msg('tagline') ?
></h3
>
502 <div id
="contentSub"><?php
$this->html('subtitle') ?
></div
>
504 <?php
if($this->data
['undelete']): ?
>
506 <div id
="contentSub2"><?php
$this->html('undelete') ?
></div
>
509 <?php
if($this->data
['newtalk'] ): ?
>
511 <div
class="usermessage"><?php
$this->html('newtalk') ?
></div
>
514 <?php
if($this->data
['showjumplinks']): ?
>
516 <div id
="jump-to-nav">
517 <?php
$this->msg('jumpto') ?
> <a href
="#head"><?php
$this->msg('jumptonavigation') ?
></a
>,
518 <a href
="#search"><?php
$this->msg('jumptosearch') ?
></a
>
523 <?php
$this->html('bodytext') ?
>
526 <?php
if($this->data
['catlinks']) { $this->html('catlinks'); } ?
>
528 <!-- dataAfterContent
-->
529 <?php
if($this->data
['dataAfterContent']) { $this->html ('dataAfterContent'); } ?
>
530 <!-- /dataAfterContent
-->
531 <div
class="visualClear"></div
>
533 <!-- /bodyContent
-->
544 <h5
><?php
$this->msg('personaltools') ?
></h5
>
545 <ul
<?php
echo $this->langAttributes() ?
>>
546 <?php
foreach($this->data
['personal_urls'] as $key => $item): ?
>
547 <li
<?
= $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
>
556 <div id
="namespaces">
557 <h5
><?php
$this->msg('namespaces') ?
></h5
>
558 <ul
<?php
echo $this->langAttributes() ?
>>
559 <?php
foreach ($this->data
['namespace_urls'] as $key => $link ): ?
>
560 <li
<?php
echo $link['attributes'] ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></li
>
566 <?php
if ( count( $this->data
['variant_urls'] ) > 0 ): ?
>
568 <h5
><div
class="icon"><span
><?php
$this->msg('variants') ?
></span
></div
></h5
>
570 <ul
<?php
echo $this->langAttributes() ?
>>
571 <?php
foreach ($this->data
['variant_urls'] as $key => $link ): ?
>
572 <li
<?php
echo $link['attributes'] ?
><?php
if(!empty($link['class'])): ?
> class="<?php echo htmlspecialchars($link['class']) ?>"<?php
endif; ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></li
>
582 <?php
if ( count( $this->data
['view_urls'] ) > 0 ): ?
>
584 <h5
><?php
$this->msg('views') ?
></h5
>
585 <ul
<?php
echo $this->langAttributes() ?
>>
586 <?php
foreach ($this->data
['view_urls'] as $key => $link ): ?
>
587 <li
<?php
echo $link['attributes'] ?
><?php
if(!empty($link['class'])): ?
> class="<?php echo htmlspecialchars($link['class']) ?>"<?php
endif; ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></li
>
594 <?php
if ( count( $this->data
['action_urls'] ) > 0 ): ?
>
596 <h5
><div
class="icon"><span
><?php
$this->msg('actions') ?
></span
></div
></h5
>
598 <ul
<?php
echo $this->langAttributes() ?
>>
599 <?php
foreach ($this->data
['action_urls'] as $key => $link ): ?
>
600 <li
<?php
echo $link['attributes'] ?
><?php
if(!empty($link['class'])): ?
> class="<?php echo htmlspecialchars($link['class']) ?>"<?php
endif; ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></li
>
610 <h5
<?php
echo $this->langAttributes( ) ?
>><label
for="searchInput"><?php
$this->msg( 'search') ?
></label
></h5
>
611 <form action
="<?php $this->text( 'wgScript') ?>" id
="searchform">
613 <input type
='hidden' name
="title" value
="<?php $this->text( 'searchtitle') ?>"/>
614 <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; ?
> />
615 <input type
='submit' name
="go" class="searchButton" id
="searchGoButton" value
="<?php $this->msg( 'searcharticle') ?>"<?php
echo $this->skin
->tooltipAndAccesskey( 'search-go' ); ?
> />
616 <?php
if ( $wgUseTwoButtonsSearchForm ): ?
>
617 <input type
='submit' name
="fulltext" class="searchButton" id
="mw-searchButton" value
="<?php $this->msg( 'searchbutton') ?>"<?php
echo $this->skin
->tooltipAndAccesskey( 'search-fulltext' ); ?
> />
619 <div
><a href
="<?php $this->text( 'searchaction') ?>" rel
="search"><?php
$this->msg( 'powersearch-legend') ?
></a
></div
>
634 <script type
="<?php $this->text('jsmimetype') ?>"> if (window
.isMSIE55
) fixalpha(); </script
>
638 $sidebar = $this->data
['sidebar'];
639 $sidebar['TOOLBOX'] = ( !isset( $sidebar['TOOLBOX'] ) );
640 $sidebar['LANGUAGES'] = ( !isset( $sidebar['LANGUAGES'] ) );
641 foreach ( $sidebar as $name => $content ) {
649 $this->languageBox();
652 $this->customBox( $name, $content );
661 <div
class="break"></div
>
666 <?php
if( $this->data
['poweredbyico']): ?
>
667 <li id
="foot-icon-poweredby"><?php
$this->html( 'poweredbyico') ?
></li
>
669 <?php
if( $this->data
['copyrightico']): ?
>
670 <li id
="foot-icon-copyright"><?php
$this->html( 'copyrightico') ?
></li
>
673 <?php
foreach( $validFooterLinks as $category => $links ): ?
>
674 <?php
if ( count( $links ) > 0 ): ?
>
675 <ul id
="foot-<?php echo $category ?>">
676 <?php
foreach( $links as $link ): ?
>
677 <?php
if( isset( $this->data
[$link] ) && $this->data
[$link] ): ?
>
678 <li id
="foot-<?php echo $category ?>-<?php echo $link ?>"><?php
$this->html( $link) ?
></li
>
684 <div style
="clear:both"></div
>
692 <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
>
695 <?php
$this->html( 'bottomscripts'); /* JS call to runBodyOnloadHook */ ?
>
696 <?php
$this->html( 'reporttime') ?
>
697 <?php
if ( $this->data
['debug'] ): ?
>
699 <?php
$this->text( 'debug' ); ?
>
705 // We're done with abusing arrays now...
706 wfRestoreWarnings( );
710 * Outputs a box with a list of tools
712 private function toolBox( ) {
714 <div
class="portal" id
="p-tb">
715 <h5
<?php
echo $this->langAttributes( ) ?
>><?php
$this->msg( 'toolbox') ?
></h5
>
718 <?php
if( $this->data
['notspecialpage']): ?
>
719 <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
>
720 <?php
if( $this->data
['nav_urls']['recentchangeslinked'] ): ?
>
721 <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') ?
></a
></li
>
724 <?php
if( isset( $this->data
['nav_urls']['trackbacklink'])): ?
>
725 <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
>
727 <?php
if( $this->data
['feeds']): ?
>
729 <?php
foreach( $this->data
['feeds'] as $key => $feed): ?
>
730 <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
>
734 <?php
foreach( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages') as $special ): ?
>
735 <?php
if( $this->data
['nav_urls'][$special]): ?
>
736 <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
>
739 <?php
if( !empty( $this->data
['nav_urls']['print']['href'])): ?
>
740 <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
>
742 <?php
if ( !empty( $this->data
['nav_urls']['permalink']['href'] ) ): ?
>
743 <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
>
744 <?php
elseif ( $this->data
['nav_urls']['permalink']['href'] === ''): ?
>
745 <li id
="t-ispermalink"<?php
echo $this->skin
->tooltip( 't-ispermalink') ?
>><?php
$this->msg( 'permalink') ?
></li
>
747 <?php
wfRunHooks( 'VectorTemplateToolboxEnd', array( &$this ) ); ?
>
748 <?php
wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); ?
>
756 * Outputs a box with a list of alternative languages for this page
758 private function languageBox( ) {
759 if( $this->data
['language_urls'] ) {
761 <div
class="portal" id
="p-lang">
762 <h5
<?php
echo $this->langAttributes( ) ?
>><?php
$this->msg( 'otherlanguages') ?
></h5
>
765 <?php
foreach ( $this->data
['language_urls'] as $langlink ): ?
>
766 <li
class="<?php echo htmlspecialchars( $langlink['class'] ) ?>"><a href
="<?php echo htmlspecialchars( $langlink['href'] ) ?>"><?php
echo $langlink['text'] ?
></a
></li
>
776 * Ouptus a box with a custom list of items or HTML content
777 * @param string $bar Message name for title of box
778 * @param mixed $content HTML or array of items to build a list from
780 private function customBox( $bar, $content ) {
782 <div
class="portal" id
='<?php echo Sanitizer::escapeId( "p-$bar" ) ?>'<?php
echo $this->skin
->tooltip( 'p-'.$bar) ?
>>
783 <h5
<?php
echo $this->langAttributes( ) ?
>><?php
$out = wfMsg( $bar ); if ( wfEmptyMsg( $bar, $out)) echo htmlspecialchars( $bar); else echo htmlspecialchars( $out); ?
></h5
>
785 <?php
if ( is_array( $content ) ): ?
>
787 <?php
foreach( $content as $key => $val): ?
>
788 <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
>
792 <?php
echo $content; /* Allow raw HTML block to be defined by extensions */ ?
>
800 * Build attributes describing user language
801 * @return HTML and XML Language attributes
803 private function langAttributes( ) {
804 return 'lang="' . $this->data
['userlang'] . '" xml:lang="' . $this->data
['userlang'] . '"';