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
{
21 var $skinname = 'vector', $stylename = 'vector',
22 $template = 'VectorTemplate', $useHeadElement = true;
25 * Initializes output page and sets up skin-specific parameters
26 * @param object $out Output page object to initialize
28 public function initPage( OutputPage
$out ) {
29 global $wgStylePath, $wgJsMimeType, $wgStyleVersion, $wgScriptPath, $wgVectorExtraStyles;
31 parent
::initPage( $out );
33 // Append skin-specific styles
34 $out->addStyle( 'vector/main-rtl.css', 'screen', '', 'rtl' );
35 $out->addStyle( 'vector/main-ltr.css', 'screen', '', 'ltr' );
36 // Append CSS which includes IE only behavior fixes for hover support -
37 // this is better than including this in a CSS fille since it doesn't
38 // wait for the CSS file to load before fetching the HTC file.
40 '<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
42 '/vector/csshover.htc")}</style><![endif]-->'
44 // Add extra stylesheets
45 // THIS IS ONLY USEFUL FOR EXPERIMENTING WITH DIFFERNT STYLE OPTIONS! THIS WILL BE REMOVED IN THE NEAR FUTURE.
46 if ( is_array( $wgVectorExtraStyles ) ) {
47 foreach ( $wgVectorExtraStyles as $style ) {
48 $out->addStyle( 'vector/' . $style, 'screen' );
51 // Append common IE fixes, which perhaps should be included in all
52 // skins, but for now it seems each skin needs to include them
55 '<!--[if lt IE 7]><script type="' . $wgJsMimeType . '" src="' .
57 '/common/IEFixes.js?' .
60 '<meta http-equiv="imagetoolbar" content="no" /><![endif]-->'
64 * Builds a structured array of links used for tabs and menus
68 function buildNavigationUrls() {
69 global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle, $wgStylePath;
70 global $wgDisableLangConversion, $wgVectorUseIconWatch;
72 wfProfileIn( __METHOD__
);
75 'namespaces' => array(),
82 $action = $wgRequest->getVal( 'action', 'view' );
83 $section = $wgRequest->getVal( 'section' );
85 // Checks if page is some kind of content
86 if( $this->iscontent
) {
88 // Gets page objects for the related namespaces
89 $subjectPage = $this->mTitle
->getSubjectPage();
90 $talkPage = $this->mTitle
->getTalkPage();
92 // Determines if this is a talk page
93 $isTalk = $this->mTitle
->isTalkPage();
95 // Generates XML IDs from namespace names
96 $subjectId = $this->mTitle
->getNamespaceKey( '' );
98 if ( $subjectId == 'main' ) {
101 $talkId = "{$subjectId}_talk";
103 $currentId = $isTalk ?
$talkId : $subjectId;
105 // Adds namespace links
106 $links['namespaces'][$subjectId] = $this->tabAction(
107 $subjectPage, 'vector-namespace-' . $subjectId, !$isTalk, '', true
109 $links['namespaces'][$subjectId]['context'] = 'subject';
110 $links['namespaces'][$talkId] = $this->tabAction(
111 $talkPage, 'vector-namespace-talk', $isTalk, '', true
113 $links['namespaces'][$talkId]['context'] = 'talk';
115 // Adds view view link
116 if ( $this->mTitle
->exists() ) {
117 $links['views']['view'] = $this->tabAction(
118 $isTalk ?
$talkPage : $subjectPage,
119 'vector-view-view', ( $action == 'view' ), '', true
123 wfProfileIn( __METHOD__
. '-edit' );
125 // Checks if user can...
127 // edit the current page
128 $this->mTitle
->quickUserCan( 'edit' ) &&
131 $this->mTitle
->exists() ||
132 // or they can create one here
133 $this->mTitle
->quickUserCan( 'create' )
136 // Builds CSS class for talk page links
137 $isTalkClass = $isTalk ?
' istalk' : '';
139 // Determines if we're in edit mode
141 ( $action == 'edit' ||
$action == 'submit' ) &&
142 ( $section != 'new' )
144 $links['views']['edit'] = array(
145 'class' => ( $selected ?
'selected' : '' ) . $isTalkClass,
146 'text' => $this->mTitle
->exists()
147 ?
wfMsg( 'vector-view-edit' )
148 : wfMsg( 'vector-view-create' ),
150 $this->mTitle
->getLocalUrl( $this->editUrlOptions() )
152 // Checks if this is a current rev of talk page and we should show a new
154 if ( ( $isTalk && $wgArticle->isCurrent() ) ||
( $wgOut->showNewSectionLink() ) ) {
155 // Checks if we should ever show a new section link
156 if ( !$wgOut->forceHideNewSectionLink() ) {
157 // Adds new section link
158 //$links['actions']['addsection']
159 $links['views']['addsection'] = array(
160 'class' => 'collapsible ' . ( $section == 'new' ?
'selected' : false ),
161 'text' => wfMsg( 'vector-action-addsection' ),
162 'href' => $this->mTitle
->getLocalUrl(
163 'action=edit§ion=new'
168 // Checks if the page is known (some kind of viewable content)
169 } elseif ( $this->mTitle
->isKnown() ) {
170 // Adds view source view link
171 $links['views']['viewsource'] = array(
172 'class' => ( $action == 'edit' ) ?
'selected' : false,
173 'text' => wfMsg( 'vector-view-viewsource' ),
175 $this->mTitle
->getLocalUrl( $this->editUrlOptions() )
178 wfProfileOut( __METHOD__
. '-edit' );
180 wfProfileIn( __METHOD__
. '-live' );
182 // Checks if the page exists
183 if ( $this->mTitle
->exists() ) {
184 // Adds history view link
185 $links['views']['history'] = array(
186 'class' => 'collapsible ' . ( ($action == 'history') ?
'selected' : false ),
187 'text' => wfMsg( 'vector-view-history' ),
188 'href' => $this->mTitle
->getLocalUrl( 'action=history' ),
192 if( $wgUser->isAllowed( 'delete' ) ) {
193 $links['actions']['delete'] = array(
194 'class' => ($action == 'delete') ?
'selected' : false,
195 'text' => wfMsg( 'vector-action-delete' ),
196 'href' => $this->mTitle
->getLocalUrl( 'action=delete' )
199 if ( $this->mTitle
->quickUserCan( 'move' ) ) {
200 $moveTitle = SpecialPage
::getTitleFor(
201 'Movepage', $this->thispage
203 $links['actions']['move'] = array(
204 'class' => $this->mTitle
->isSpecial( 'Movepage' ) ?
206 'text' => wfMsg( 'vector-action-move' ),
207 'href' => $moveTitle->getLocalUrl()
212 $this->mTitle
->getNamespace() !== NS_MEDIAWIKI
&&
213 $wgUser->isAllowed( 'protect' )
215 if ( !$this->mTitle
->isProtected() ){
216 $links['actions']['protect'] = array(
217 'class' => ($action == 'protect') ?
219 'text' => wfMsg( 'vector-action-protect' ),
221 $this->mTitle
->getLocalUrl( 'action=protect' )
225 $links['actions']['unprotect'] = array(
226 'class' => ($action == 'unprotect') ?
228 'text' => wfMsg( 'vector-action-unprotect' ),
230 $this->mTitle
->getLocalUrl( 'action=unprotect' )
235 // article doesn't exist or is deleted
237 $wgUser->isAllowed( 'deletedhistory' ) &&
238 $wgUser->isAllowed( 'undelete' )
240 if( $n = $this->mTitle
->isDeleted() ) {
241 $undelTitle = SpecialPage
::getTitleFor( 'Undelete' );
242 $links['actions']['undelete'] = array(
245 'vector-action-undelete',
247 $wgLang->formatNum( $n )
249 'href' => $undelTitle->getLocalUrl(
250 'target=' . urlencode( $this->thispage
)
257 $this->mTitle
->getNamespace() !== NS_MEDIAWIKI
&&
258 $wgUser->isAllowed( 'protect' )
260 if ( !$this->mTitle
->getRestrictions( 'create' ) ) {
261 $links['actions']['protect'] = array(
262 'class' => ($action == 'protect') ?
264 'text' => wfMsg( 'vector-action-protect' ),
266 $this->mTitle
->getLocalUrl( 'action=protect' )
270 $links['actions']['unprotect'] = array(
271 'class' => ($action == 'unprotect') ?
273 'text' => wfMsg( 'vector-action-unprotect' ),
275 $this->mTitle
->getLocalUrl( 'action=unprotect' )
280 wfProfileOut( __METHOD__
. '-live' );
282 * The following actions use messages which, if made particular to
283 * the Vector skin, would break the Ajax code which makes this
284 * action happen entirely inline. Skin::makeGlobalVariablesScript
285 * defines a set of messages in a javascript object - and these
286 * messages are assumed to be global for all skins. Without making
287 * a change to that procedure these messages will have to remain as
288 * the global versions.
290 // Checks if the user is logged in
291 if ( $this->loggedin
) {
292 if ( $wgVectorUseIconWatch ) {
299 $mode = $this->mTitle
->userIsWatching() ?
'unwatch' : 'watch';
300 $links[$place][$mode] = array(
301 'class' => $class . ( ( $action == 'watch' ||
$action == 'unwatch' ) ?
' selected' : false ),
302 'text' => wfMsg( $mode ), // uses 'watch' or 'unwatch' message
303 'href' => $this->mTitle
->getLocalUrl( 'action=' . $mode )
306 // This is instead of SkinTemplateTabs - which uses a flat array
307 wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$links ) );
309 // If it's not content, it's got to be a special page
311 $links['namespaces']['special'] = array(
312 'class' => 'selected',
313 'text' => wfMsg( 'vector-namespace-special' ),
314 'href' => $wgRequest->getRequestURL()
318 // Gets list of language variants
319 $variants = $wgContLang->getVariants();
320 // Checks that language conversion is enabled and variants exist
321 if( !$wgDisableLangConversion && count( $variants ) > 1 ) {
322 // Gets preferred variant
323 $preferred = $wgContLang->getPreferredVariant();
324 // Loops over each variant
325 foreach( $variants as $code ) {
326 // Gets variant name from language code
327 $varname = $wgContLang->getVariantname( $code );
328 // Checks if the variant is marked as disabled
329 if( $varname == 'disable' ) {
330 // Skips this variant
333 // Appends variant link
334 $links['variants'][] = array(
335 'class' => ( $code == $preferred ) ?
'selected' : false,
337 'href' => $this->mTitle
->getLocalURL( '', $code )
342 wfProfileOut( __METHOD__
);
349 * QuickTemplate class for Vector skin
352 class VectorTemplate
extends QuickTemplate
{
357 * @var Cached skin object
364 * Outputs the entire contents of the XHTML page
366 public function execute() {
367 global $wgRequest, $wgOut, $wgContLang;
369 $this->skin
= $this->data
['skin'];
370 $action = $wgRequest->getText( 'action' );
372 // Build additional attributes for navigation urls
373 $nav = $this->skin
->buildNavigationUrls();
374 foreach ( $nav as $section => $links ) {
375 foreach ( $links as $key => $link ) {
377 if ( isset( $link['context'] ) && $link['context'] == 'subject' ) {
378 $xmlID = 'ca-nstab-' . $xmlID;
379 } else if ( isset( $link['context'] ) && $link['context'] == 'talk' ) {
382 $xmlID = 'ca-' . $xmlID;
384 $nav[$section][$key]['attributes'] =
385 ' id="' . Sanitizer
::escapeId( $xmlID ) . '"';
386 if ( $nav[$section][$key]['class'] ) {
387 $nav[$section][$key]['attributes'] .=
388 ' class="' . htmlspecialchars( $link['class'] ) . '"';
389 unset( $nav[$section][$key]['class'] );
391 // We don't want to give the watch tab an accesskey if the page
392 // is being edited, because that conflicts with the accesskey on
393 // the watch checkbox. We also don't want to give the edit tab
394 // an accesskey, because that's fairly superfluous and conflicts
395 // with an accesskey (Ctrl-E) often used for editing in Safari.
397 in_array( $action, array( 'edit', 'submit' ) ) &&
398 in_array( $key, array( 'edit', 'watch', 'unwatch' ) )
400 $nav[$section][$key]['key'] =
401 $this->skin
->tooltip( $xmlID );
403 $nav[$section][$key]['key'] =
404 $this->skin
->tooltipAndAccesskey( $xmlID );
408 $this->data
['namespace_urls'] = $nav['namespaces'];
409 $this->data
['view_urls'] = $nav['views'];
410 $this->data
['action_urls'] = $nav['actions'];
411 $this->data
['variant_urls'] = $nav['variants'];
412 // Build additional attributes for personal_urls
413 foreach ( $this->data
['personal_urls'] as $key => $item) {
414 $this->data
['personal_urls'][$key]['attributes'] =
415 ' id="' . Sanitizer
::escapeId( "pt-$key" ) . '"';
416 if ( isset( $item['active'] ) && $item['active'] ) {
417 $this->data
['personal_urls'][$key]['attributes'] .=
420 $this->data
['personal_urls'][$key]['key'] =
421 $this->skin
->tooltipAndAccesskey('pt-'.$key);
424 // Generate additional footer links
425 $footerlinks = array(
429 'numberofwatchingusers',
440 // Reduce footer links down to only those which are being used
441 $validFooterLinks = array();
442 foreach( $footerlinks as $category => $links ) {
443 $validFooterLinks[$category] = array();
444 foreach( $links as $link ) {
445 if( isset( $this->data
[$link] ) && $this->data
[$link] ) {
446 $validFooterLinks[$category][] = $link;
450 // Reverse horizontally rendered navigation elements
451 if ( $wgContLang->isRTL() ) {
452 $this->data
['view_urls'] =
453 array_reverse( $this->data
['view_urls'] );
454 $this->data
['namespace_urls'] =
455 array_reverse( $this->data
['namespace_urls'] );
456 $this->data
['personal_urls'] =
457 array_reverse( $this->data
['personal_urls'] );
460 $this->html( 'headelement' );
462 <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' ) ?>" dir
="<?php $this->text( 'dir' ) ?>">
463 <div id
="page-base" class="noprint"></div
>
464 <div id
="head-base" class="noprint"></div
>
468 <div id
="mw-js-message" style
="display:none;"></div
>
469 <?php
if ( $this->data
['sitenotice'] ): ?
>
471 <div id
="siteNotice"><?php
$this->html( 'sitenotice' ) ?
></div
>
474 <!-- firstHeading
-->
475 <h1 id
="firstHeading" class="firstHeading"><?php
$this->html( 'title' ) ?
></h1
>
476 <!-- /firstHeading
-->
478 <div id
="bodyContent">
480 <h3 id
="siteSub"><?php
$this->msg( 'tagline' ) ?
></h3
>
483 <div id
="contentSub"><?php
$this->html( 'subtitle' ) ?
></div
>
485 <?php
if ( $this->data
['undelete'] ): ?
>
487 <div id
="contentSub2"><?php
$this->html( 'undelete' ) ?
></div
>
490 <?php
if($this->data
['newtalk'] ): ?
>
492 <div
class="usermessage"><?php
$this->html( 'newtalk' ) ?
></div
>
495 <?php
if ( $this->data
['showjumplinks'] ): ?
>
497 <div id
="jump-to-nav">
498 <?php
$this->msg( 'jumpto' ) ?
><a href
="#head"><?php
$this->msg( 'jumptonavigation' ) ?
></a
>,
499 <a href
="#p-search"><?php
$this->msg( 'jumptosearch' ) ?
></a
>
504 <?php
$this->html( 'bodytext' ) ?
>
506 <?php
if ( $this->data
['catlinks'] ): ?
>
508 <?php
$this->html( 'catlinks' ); ?
>
511 <?php
if ( $this->data
['dataAfterContent'] ): ?
>
512 <!-- dataAfterContent
-->
513 <?php
$this->html( 'dataAfterContent' ); ?
>
514 <!-- /dataAfterContent
-->
516 <div
class="visualClear"></div
>
518 <!-- /bodyContent
-->
522 <div id
="head" class="noprint">
523 <?php
$this->renderNavigation( 'PERSONAL' ); ?
>
524 <div id
="left-navigation">
525 <?php
$this->renderNavigation( array( 'NAMESPACES', 'VARIANTS' ) ); ?
>
527 <div id
="right-navigation">
528 <?php
$this->renderNavigation( array( 'VIEWS', 'ACTIONS', 'SEARCH' ) ); ?
>
533 <div id
="panel" class="noprint">
535 <div id
="p-logo"><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
></div
>
537 <?php
$this->renderPortals( $this->data
['sidebar'] ); ?
>
542 <?php
foreach( $validFooterLinks as $category => $links ): ?
>
543 <?php
if ( count( $links ) > 0 ): ?
>
544 <ul id
="footer-<?php echo $category ?>">
545 <?php
foreach( $links as $link ): ?
>
546 <?php
if( isset( $this->data
[$link] ) && $this->data
[$link] ): ?
>
547 <li id
="footer-<?php echo $category ?>-<?php echo $link ?>"><?php
$this->html( $link ) ?
></li
>
553 <ul id
="footer-icons" class="noprint">
554 <?php
if ( $this->data
['poweredbyico'] ): ?
>
555 <li id
="footer-icon-poweredby"><?php
$this->html( 'poweredbyico' ) ?
></li
>
557 <?php
if ( $this->data
['copyrightico'] ): ?
>
558 <li id
="footer-icon-copyright"><?php
$this->html( 'copyrightico' ) ?
></li
>
561 <div style
="clear:both"></div
>
565 <script type
="<?php $this->text('jsmimetype') ?>"> if ( window
.isMSIE55
) fixalpha(); </script
>
567 <?php
$this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?
>
568 <?php
$this->html( 'reporttime' ) ?
>
569 <?php
if ( $this->data
['debug'] ): ?
>
570 <!-- Debug output
: <?php
$this->text( 'debug' ); ?
> -->
578 * Render a series of portals
580 private function renderPortals( $portals ) {
581 // Force the rendering of the following portals
582 if ( !isset( $portals['SEARCH'] ) ) $portals['SEARCH'] = true;
583 if ( !isset( $portals['TOOLBOX'] ) ) $portals['TOOLBOX'] = true;
584 if ( !isset( $portals['LANGUAGES'] ) ) $portals['LANGUAGES'] = true;
586 foreach ( $portals as $name => $content ) {
587 echo "\n<!-- {$name} -->\n";
593 <div
class="portal" id
="p-tb">
594 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$this->msg( 'toolbox' ) ?
></h5
>
597 <?php
if( $this->data
['notspecialpage'] ): ?
>
598 <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
>
599 <?php
if( $this->data
['nav_urls']['recentchangeslinked'] ): ?
>
600 <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
>
603 <?php
if( isset( $this->data
['nav_urls']['trackbacklink'] ) ): ?
>
604 <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
>
606 <?php
if( $this->data
['feeds']): ?
>
608 <?php
foreach( $this->data
['feeds'] as $key => $feed ): ?
>
609 <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
>
613 <?php
foreach( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages' ) as $special ): ?
>
614 <?php
if( $this->data
['nav_urls'][$special]): ?
>
615 <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
>
618 <?php
if( !empty( $this->data
['nav_urls']['print']['href'] ) ): ?
>
619 <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
>
621 <?php
if ( !empty( $this->data
['nav_urls']['permalink']['href'] ) ): ?
>
622 <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
>
623 <?php
elseif ( $this->data
['nav_urls']['permalink']['href'] === '' ): ?
>
624 <li id
="t-ispermalink"<?php
echo $this->skin
->tooltip( 't-ispermalink' ) ?
>><?php
$this->msg( 'permalink' ) ?
></li
>
626 <?php
wfRunHooks( 'VectorTemplateToolboxEnd', array( &$this ) ); ?
>
627 <?php
wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); ?
>
634 if ( $this->data
['language_urls'] ) {
636 <div
class="portal" id
="p-lang">
637 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$this->msg( 'otherlanguages' ) ?
></h5
>
640 <?php
foreach ( $this->data
['language_urls'] as $langlink ): ?
>
641 <li
class="<?php echo htmlspecialchars( $langlink['class'] ) ?>"><a href
="<?php echo htmlspecialchars( $langlink['href'] ) ?>"><?php
echo $langlink['text'] ?
></a
></li
>
651 <div
class="portal" id
='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php
echo $this->skin
->tooltip( 'p-' . $name ) ?
>>
652 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$out = wfMsg( $name ); if ( wfEmptyMsg( $name, $out ) ) echo htmlspecialchars( $name ); else echo htmlspecialchars( $out ); ?
></h5
>
654 <?php
if ( is_array( $content ) ): ?
>
656 <?php
foreach( $content as $key => $val ): ?
>
657 <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
>
661 <?php
echo $content; /* Allow raw HTML block to be defined by extensions */ ?
>
668 echo "\n<!-- /{$name} -->\n";
673 * Render one or more navigations elements by name, automatically reveresed
674 * when UI is in RTL mode
676 private function renderNavigation( $elements ) {
677 global $wgContLang, $wgVectorUseSimpleSearch, $wgStylePath;
679 // If only one element was given, wrap it in an array, allowing more
680 // flexible arguments
681 if ( !is_array( $elements ) ) {
682 $elements = array( $elements );
683 // If there's a series of elements, reverse them when in RTL mode
684 } else if ( $wgContLang->isRTL() ) {
685 $elements = array_reverse( $elements );
688 foreach ( $elements as $name => $element ) {
689 echo "\n<!-- {$name} -->\n";
690 switch ( $element ) {
693 <div id
="p-namespaces" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
694 <h5
><?php
$this->msg('namespaces') ?
></h5
>
695 <ul
<?php
$this->html('userlangattributes') ?
>>
696 <?php
foreach ($this->data
['namespace_urls'] as $key => $link ): ?
>
697 <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
>
705 <div id
="p-variants" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
706 <h5
><span
><?php
$this->msg('variants') ?
></span
><a href
="#"></a
></h5
>
708 <ul
<?php
$this->html('userlangattributes') ?
>>
709 <?php
foreach ($this->data
['variant_urls'] as $key => $link ): ?
>
710 <li
<?php
echo $link['attributes'] ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></li
>
719 <div id
="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
720 <h5
><?php
$this->msg('views') ?
></h5
>
721 <ul
<?php
$this->html('userlangattributes') ?
>>
722 <?php
foreach ($this->data
['view_urls'] as $key => $link ): ?
>
723 <li
<?php
echo $link['attributes'] ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo (array_key_exists('img',$link) ?
'<img src="'.$link['img'].'" alt="'.$link['text'].'" />' : '<span>'.htmlspecialchars( $link['text'] ).'</span>') ?
></a
></li
>
731 <div id
="p-cactions" class="vectorMenu<?php if ( count( $this->data['action_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
732 <h5
><span
><?php
$this->msg('actions') ?
></span
><a href
="#"></a
></h5
>
734 <ul
<?php
$this->html('userlangattributes') ?
>>
735 <?php
foreach ($this->data
['action_urls'] as $key => $link ): ?
>
736 <li
<?php
echo $link['attributes'] ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></li
>
745 <div id
="p-personal" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
746 <h5
><?php
$this->msg('personaltools') ?
></h5
>
747 <ul
<?php
$this->html('userlangattributes') ?
>>
748 <?php
foreach($this->data
['personal_urls'] as $key => $item): ?
>
749 <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
>
758 <h5
<?php
$this->html('userlangattributes') ?
>><label
for="searchInput"><?php
$this->msg( 'search' ) ?
></label
></h5
>
759 <form action
="<?php $this->text( 'wgScript' ) ?>" id
="searchform">
760 <input type
='hidden' name
="title" value
="<?php $this->text( 'searchtitle' ) ?>"/>
761 <?php
if ( $wgVectorUseSimpleSearch ): ?
>
762 <div id
="simpleSearch">
763 <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; ?
> />
764 <button id
="searchButton" type
='submit' name
='button' <?php
echo $this->skin
->tooltipAndAccesskey( 'search-fulltext' ); ?
>> 
;</button
>
767 <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; ?
> />
768 <input type
='submit' name
="go" class="searchButton" id
="searchGoButton" value
="<?php $this->msg( 'searcharticle' ) ?>"<?php
echo $this->skin
->tooltipAndAccesskey( 'search-go' ); ?
> />
769 <input type
="submit" name
="fulltext" class="searchButton" id
="mw-searchButton" value
="<?php $this->msg( 'searchbutton' ) ?>"<?php
echo $this->skin
->tooltipAndAccesskey( 'search-fulltext' ); ?
> />
777 echo "\n<!-- /{$name} -->\n";