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';
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;
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 // Append common IE fixes, which perhaps should be included in all
45 // skins, but for now it seems each skin needs to include them
48 '<!--[if lt IE 7]><script type="' . $wgJsMimeType . '" src="' .
50 '/common/IEFixes.js?' .
53 '<meta http-equiv="imagetoolbar" content="no" /><![endif]-->'
57 * Builds a structured array of links used for tabs and menus
61 function buildNavigationUrls() {
62 global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle;
63 global $wgDisableLangConversion;
65 wfProfileIn( __METHOD__
);
68 'namespaces' => array(),
75 $action = $wgRequest->getVal( 'action', 'view' );
76 $section = $wgRequest->getVal( 'section' );
78 // Checks if page is some kind of content
79 if( $this->iscontent
) {
81 // Gets page objects for the related namespaces
82 $subjectPage = $this->mTitle
->getSubjectPage();
83 $talkPage = $this->mTitle
->getTalkPage();
85 // Determines if this is a talk page
86 $isTalk = $this->mTitle
->isTalkPage();
88 // Generates XML IDs from namespace names
89 $subjectId = $this->mTitle
->getNamespaceKey( '' );
91 if ( $subjectId == 'main' ) {
94 $talkId = "{$subjectId}_talk";
96 $currentId = $isTalk ?
$talkId : $subjectId;
98 // Adds namespace links
99 $links['namespaces'][$subjectId] = $this->tabAction(
100 $subjectPage, 'vector-namespace-' . $subjectId, !$isTalk, '', true
102 $links['namespaces'][$subjectId]['context'] = 'subject';
103 $links['namespaces'][$talkId] = $this->tabAction(
104 $talkPage, 'vector-namespace-talk', $isTalk, '', true
106 $links['namespaces'][$talkId]['context'] = 'talk';
108 // Adds view view link
109 if ( $this->mTitle
->exists() ) {
110 $links['views']['view'] = $this->tabAction(
111 $isTalk ?
$talkPage : $subjectPage,
112 'vector-view-view', ( $action == 'view' ), '', true
116 wfProfileIn( __METHOD__
. '-edit' );
118 // Checks if user can...
120 // edit the current page
121 $this->mTitle
->quickUserCan( 'edit' ) &&
124 $this->mTitle
->exists() ||
125 // or they can create one here
126 $this->mTitle
->quickUserCan( 'create' )
129 // Builds CSS class for talk page links
130 $isTalkClass = $isTalk ?
' istalk' : '';
132 // Determines if we're in edit mode
134 ( $action == 'edit' ||
$action == 'submit' ) &&
135 ( $section != 'new' )
137 $links['views']['edit'] = array(
138 'class' => ( $selected ?
'selected' : '' ) . $isTalkClass,
139 'text' => $this->mTitle
->exists()
140 ?
wfMsg( 'vector-view-edit' )
141 : wfMsg( 'vector-view-create' ),
143 $this->mTitle
->getLocalUrl( $this->editUrlOptions() )
145 // Checks if this is a current rev of talk page and we should show a new
147 if ( ( $isTalk && $wgArticle->isCurrent() ) ||
( $wgOut->showNewSectionLink() ) ) {
148 // Checks if we should ever show a new section link
149 if ( !$wgOut->forceHideNewSectionLink() ) {
150 // Adds new section link
151 $links['actions']['addsection'] = array(
152 'class' => $section == 'new' ?
'selected' : false,
153 'text' => wfMsg( 'vector-action-addsection' ),
154 'href' => $this->mTitle
->getLocalUrl(
155 'action=edit§ion=new'
160 // Checks if the page is known (some kind of viewable content)
161 } elseif ( $this->mTitle
->isKnown() ) {
162 // Adds view source view link
163 $links['views']['viewsource'] = array(
164 'class' => ( $action == 'edit' ) ?
'selected' : false,
165 'text' => wfMsg( 'vector-view-viewsource' ),
167 $this->mTitle
->getLocalUrl( $this->editUrlOptions() )
170 wfProfileOut( __METHOD__
. '-edit' );
172 wfProfileIn( __METHOD__
. '-live' );
174 // Checks if the page exists
175 if ( $this->mTitle
->exists() ) {
176 // Adds history view link
177 $links['views']['history'] = array(
178 'class' => ($action == 'history') ?
'selected' : false,
179 'text' => wfMsg( 'vector-view-history' ),
180 'href' => $this->mTitle
->getLocalUrl( 'action=history' ),
184 if( $wgUser->isAllowed( 'delete' ) ) {
185 $links['actions']['delete'] = array(
186 'class' => ($action == 'delete') ?
'selected' : false,
187 'text' => wfMsg( 'vector-action-delete' ),
188 'href' => $this->mTitle
->getLocalUrl( 'action=delete' )
191 if ( $this->mTitle
->quickUserCan( 'move' ) ) {
192 $moveTitle = SpecialPage
::getTitleFor(
193 'Movepage', $this->thispage
195 $links['actions']['move'] = array(
196 'class' => $this->mTitle
->isSpecial( 'Movepage' ) ?
198 'text' => wfMsg( 'vector-action-move' ),
199 'href' => $moveTitle->getLocalUrl()
204 $this->mTitle
->getNamespace() !== NS_MEDIAWIKI
&&
205 $wgUser->isAllowed( 'protect' )
207 if ( !$this->mTitle
->isProtected() ){
208 $links['actions']['protect'] = array(
209 'class' => ($action == 'protect') ?
211 'text' => wfMsg( 'vector-action-protect' ),
213 $this->mTitle
->getLocalUrl( 'action=protect' )
217 $links['actions']['unprotect'] = array(
218 'class' => ($action == 'unprotect') ?
220 'text' => wfMsg( 'vector-action-unprotect' ),
222 $this->mTitle
->getLocalUrl( 'action=unprotect' )
227 // article doesn't exist or is deleted
229 $wgUser->isAllowed( 'deletedhistory' ) &&
230 $wgUser->isAllowed( 'undelete' )
232 if( $n = $this->mTitle
->isDeleted() ) {
233 $undelTitle = SpecialPage
::getTitleFor( 'Undelete' );
234 $links['actions']['undelete'] = array(
237 'vector-action-undelete',
239 $wgLang->formatNum( $n )
241 'href' => $undelTitle->getLocalUrl(
242 'target=' . urlencode( $this->thispage
)
249 $this->mTitle
->getNamespace() !== NS_MEDIAWIKI
&&
250 $wgUser->isAllowed( 'protect' )
252 if ( !$this->mTitle
->getRestrictions( 'create' ) ) {
253 $links['actions']['protect'] = array(
254 'class' => ($action == 'protect') ?
256 'text' => wfMsg( 'vector-action-protect' ),
258 $this->mTitle
->getLocalUrl( 'action=protect' )
262 $links['actions']['unprotect'] = array(
263 'class' => ($action == 'unprotect') ?
265 'text' => wfMsg( 'vector-action-unprotect' ),
267 $this->mTitle
->getLocalUrl( 'action=unprotect' )
272 wfProfileOut( __METHOD__
. '-live' );
275 * The following actions use messages which, if made particular to
276 * the Vector skin, would break the Ajax code which makes this
277 * action happen entirely inline. Skin::makeGlobalVariablesScript
278 * defines a set of messages in a javascript object - and these
279 * messages are assumed to be global for all skins. Without making
280 * a change to that procedure these messages will have to remain as
281 * the global versions.
283 // Checks if the user is logged in
284 if( $this->loggedin
) {
285 // Checks if the user is watching this page
286 if( !$this->mTitle
->userIsWatching() ) {
287 // Adds watch action link
288 $links['actions']['watch'] = array(
290 ( $action == 'watch' or $action == 'unwatch' ) ?
292 'text' => wfMsg( 'watch' ),
293 'href' => $this->mTitle
->getLocalUrl( 'action=watch' )
296 // Adds unwatch action link
297 $links['actions']['unwatch'] = array(
299 ($action == 'unwatch' or $action == 'watch') ?
301 'text' => wfMsg( 'unwatch' ),
302 'href' => $this->mTitle
->getLocalUrl( 'action=unwatch' )
307 // This is instead of SkinTemplateTabs - which uses a flat array
308 wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$links ) );
310 // If it's not content, it's got to be a special page
312 $links['namespaces']['special'] = array(
313 'class' => 'selected',
314 'text' => wfMsg( 'vector-namespace-special' ),
315 'href' => $wgRequest->getRequestURL()
319 // Gets list of language variants
320 $variants = $wgContLang->getVariants();
321 // Checks that language conversion is enabled and variants exist
322 if( !$wgDisableLangConversion && count( $variants ) > 1 ) {
323 // Gets preferred variant
324 $preferred = $wgContLang->getPreferredVariant();
325 // Loops over each variant
326 foreach( $variants as $code ) {
327 // Gets variant name from language code
328 $varname = $wgContLang->getVariantname( $code );
329 // Checks if the variant is marked as disabled
330 if( $varname == 'disable' ) {
331 // Skips this variant
334 // Appends variant link
335 $links['variants'][] = array(
336 'class' => ( $code == $preferred ) ?
'selected' : false,
338 'href' => $this->mTitle
->getLocalURL( '', $code )
343 wfProfileOut( __METHOD__
);
350 * QuickTemplate class for Vector skin
353 class VectorTemplate
extends QuickTemplate
{
358 * @var Cached skin object
365 * Outputs the entire contents of the XHTML page
367 public function execute() {
368 global $wgRequest, $wgOut, $wgContLang;
370 $this->skin
= $this->data
['skin'];
371 $action = $wgRequest->getText( 'action' );
373 // Suppress warnings to prevent notices about missing indexes in
374 // $this->data (is this really the best way to handle this?)
375 wfSuppressWarnings();
377 // Build additional attributes for navigation urls
378 $nav = $this->skin
->buildNavigationUrls();
379 foreach ( $nav as $section => $links ) {
380 foreach ( $links as $key => $link ) {
382 if ( isset( $link['context'] ) && $link['context'] == 'subject' ) {
383 $xmlID = 'ca-nstab-' . $xmlID;
384 } else if ( isset( $link['context'] ) && $link['context'] == 'talk' ) {
387 $xmlID = 'ca-' . $xmlID;
389 $nav[$section][$key]['attributes'] =
390 ' id="' . Sanitizer
::escapeId( $xmlID ) . '"';
391 if ( $nav[$section][$key]['class'] ) {
392 $nav[$section][$key]['attributes'] .=
393 ' class="' . htmlspecialchars( $link['class'] ) . '"';
394 unset( $nav[$section][$key]['class'] );
396 // We don't want to give the watch tab an accesskey if the page
397 // is being edited, because that conflicts with the accesskey on
398 // the watch checkbox. We also don't want to give the edit tab
399 // an accesskey, because that's fairly superfluous and conflicts
400 // with an accesskey (Ctrl-E) often used for editing in Safari.
402 in_array( $action, array( 'edit', 'submit' ) ) &&
403 in_array( $key, array( 'edit', 'watch', 'unwatch' ) )
405 $nav[$section][$key]['key'] =
406 $this->skin
->tooltip( $xmlID );
408 $nav[$section][$key]['key'] =
409 $this->skin
->tooltipAndAccesskey( $xmlID );
413 $this->data
['namespace_urls'] = $nav['namespaces'];
414 $this->data
['view_urls'] = $nav['views'];
415 $this->data
['action_urls'] = $nav['actions'];
416 $this->data
['variant_urls'] = $nav['variants'];
417 // Build additional attributes for personal_urls
418 foreach ( $this->data
['personal_urls'] as $key => $item) {
419 $this->data
['personal_urls'][$key]['attributes'] =
420 ' id="' . Sanitizer
::escapeId( "pt-$key" ) . '"';
421 if ( $item['active'] ) {
422 $this->data
['personal_urls'][$key]['attributes'] .=
425 $this->data
['personal_urls'][$key]['key'] =
426 $this->skin
->tooltipAndAccesskey('pt-'.$key);
429 // Generate additional footer links
430 $footerlinks = array(
434 'numberofwatchingusers',
445 // Reduce footer links down to only those which are being used
446 $validFooterLinks = array();
447 foreach( $footerlinks as $category => $links ) {
448 $validFooterLinks[$category] = array();
449 foreach( $links as $link ) {
450 if( isset( $this->data
[$link] ) && $this->data
[$link] ) {
451 $validFooterLinks[$category][] = $link;
455 // Reverse horizontally rendered navigation elements
456 if ( $wgContLang->isRTL() ) {
457 $this->data
['view_urls'] =
458 array_reverse( $this->data
['view_urls'] );
459 $this->data
['namespace_urls'] =
460 array_reverse( $this->data
['namespace_urls'] );
461 $this->data
['personal_urls'] =
462 array_reverse( $this->data
['personal_urls'] );
465 echo $wgOut->headElement( $this->skin
);
467 <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' ) ?>">
468 <div id
="page-base" class="noprint"></div
>
469 <div id
="head-base" class="noprint"></div
>
473 <div id
="mw-js-message" style
="display:none;"></div
>
474 <?php
if ( $this->data
['sitenotice'] ): ?
>
476 <div id
="siteNotice"><?php
$this->html( 'sitenotice' ) ?
></div
>
479 <!-- firstHeading
-->
480 <h1 id
="firstHeading" class="firstHeading"><?php
$this->html( 'title' ) ?
></h1
>
481 <!-- /firstHeading
-->
483 <div id
="bodyContent">
485 <h3 id
="siteSub"><?php
$this->msg( 'tagline' ) ?
></h3
>
488 <div id
="contentSub"><?php
$this->html( 'subtitle' ) ?
></div
>
490 <?php
if ( $this->data
['undelete'] ): ?
>
492 <div id
="contentSub2"><?php
$this->html( 'undelete' ) ?
></div
>
495 <?php
if($this->data
['newtalk'] ): ?
>
497 <div
class="usermessage"><?php
$this->html( 'newtalk' ) ?
></div
>
500 <?php
if ( $this->data
['showjumplinks'] ): ?
>
502 <div id
="jump-to-nav">
503 <?php
$this->msg( 'jumpto' ) ?
><a href
="#head"><?php
$this->msg( 'jumptonavigation' ) ?
></a
>,
504 <a href
="#p-search"><?php
$this->msg( 'jumptosearch' ) ?
></a
>
509 <?php
$this->html( 'bodytext' ) ?
>
511 <?php
if ( $this->data
['catlinks'] ): ?
>
513 <?php
$this->html( 'catlinks' ); ?
>
516 <?php
if ( $this->data
['dataAfterContent'] ): ?
>
517 <!-- dataAfterContent
-->
518 <?php
$this->html( 'dataAfterContent' ); ?
>
519 <!-- /dataAfterContent
-->
521 <div
class="visualClear"></div
>
523 <!-- /bodyContent
-->
527 <div id
="head" class="noprint">
528 <?php
$this->renderNavigation( 'PERSONAL' ); ?
>
529 <div id
="left-navigation">
530 <?php
$this->renderNavigation( array( 'NAMESPACES', 'VARIANTS' ) ); ?
>
532 <div id
="right-navigation">
533 <?php
$this->renderNavigation( array( 'VIEWS', 'ACTIONS', 'SEARCH' ) ); ?
>
538 <div id
="panel" class="noprint">
539 <?php
$this->renderPortals( $this->data
['sidebar'] ); ?
>
544 <?php
foreach( $validFooterLinks as $category => $links ): ?
>
545 <?php
if ( count( $links ) > 0 ): ?
>
546 <ul id
="foot-<?php echo $category ?>">
547 <?php
foreach( $links as $link ): ?
>
548 <?php
if( isset( $this->data
[$link] ) && $this->data
[$link] ): ?
>
549 <li id
="foot-<?php echo $category ?>-<?php echo $link ?>"><?php
$this->html( $link ) ?
></li
>
555 <ul id
="foot-icons" class="noprint">
556 <?php
if ( $this->data
['poweredbyico'] ): ?
>
557 <li id
="foot-icon-poweredby"><?php
$this->html( 'poweredbyico' ) ?
></li
>
559 <?php
if ( $this->data
['copyrightico'] ): ?
>
560 <li id
="foot-icon-copyright"><?php
$this->html( 'copyrightico' ) ?
></li
>
563 <div style
="clear:both"></div
>
567 <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
>
570 <script type
="<?php $this->text('jsmimetype') ?>"> if ( window
.isMSIE55
) fixalpha(); </script
>
572 <?php
$this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?
>
573 <?php
$this->html( 'reporttime' ) ?
>
574 <?php
if ( $this->data
['debug'] ): ?
>
575 <!-- Debug output
: <?php
$this->text( 'debug' ); ?
> -->
580 // We're done with abusing arrays now...
585 * Render a series of portals
587 private function renderPortals( $portals ) {
588 // Force the rendering of the following portals
589 if ( !isset( $portals['SEARCH'] ) ) $portals['SEARCH'] = true;
590 if ( !isset( $portals['TOOLBOX'] ) ) $portals['TOOLBOX'] = true;
591 if ( !isset( $portals['LANGUAGES'] ) ) $portals['LANGUAGES'] = true;
593 foreach ( $portals as $name => $content ) {
594 echo "\n<!-- {$name} -->\n";
600 <div
class="portal" id
="p-tb">
601 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$this->msg( 'toolbox' ) ?
></h5
>
604 <?php
if( $this->data
['notspecialpage'] ): ?
>
605 <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
>
606 <?php
if( $this->data
['nav_urls']['recentchangeslinked'] ): ?
>
607 <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
>
610 <?php
if( isset( $this->data
['nav_urls']['trackbacklink'] ) ): ?
>
611 <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
>
613 <?php
if( $this->data
['feeds']): ?
>
615 <?php
foreach( $this->data
['feeds'] as $key => $feed ): ?
>
616 <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
>
620 <?php
foreach( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages' ) as $special ): ?
>
621 <?php
if( $this->data
['nav_urls'][$special]): ?
>
622 <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
>
625 <?php
if( !empty( $this->data
['nav_urls']['print']['href'] ) ): ?
>
626 <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
>
628 <?php
if ( !empty( $this->data
['nav_urls']['permalink']['href'] ) ): ?
>
629 <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
>
630 <?php
elseif ( $this->data
['nav_urls']['permalink']['href'] === '' ): ?
>
631 <li id
="t-ispermalink"<?php
echo $this->skin
->tooltip( 't-ispermalink' ) ?
>><?php
$this->msg( 'permalink' ) ?
></li
>
633 <?php
wfRunHooks( 'VectorTemplateToolboxEnd', array( &$this ) ); ?
>
634 <?php
wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); ?
>
641 if ( $this->data
['language_urls'] ) {
643 <div
class="portal" id
="p-lang">
644 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$this->msg( 'otherlanguages' ) ?
></h5
>
647 <?php
foreach ( $this->data
['language_urls'] as $langlink ): ?
>
648 <li
class="<?php echo htmlspecialchars( $langlink['class'] ) ?>"><a href
="<?php echo htmlspecialchars( $langlink['href'] ) ?>"><?php
echo $langlink['text'] ?
></a
></li
>
658 <div
class="portal" id
='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php
echo $this->skin
->tooltip( 'p-' . $name ) ?
>>
659 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$out = wfMsg( $name ); if ( wfEmptyMsg( $name, $out ) ) echo htmlspecialchars( $name ); else echo htmlspecialchars( $out ); ?
></h5
>
661 <?php
if ( is_array( $content ) ): ?
>
663 <?php
foreach( $content as $key => $val ): ?
>
664 <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
>
668 <?php
echo $content; /* Allow raw HTML block to be defined by extensions */ ?
>
675 echo "\n<!-- /{$name} -->\n";
680 * Render one or more navigations elements by name, automatically reveresed
681 * when UI is in RTL mode
683 private function renderNavigation( $elements ) {
684 global $wgContLang, $wgVectorUseSimpleSearch, $wgStylePath;
686 // If only one element was given, wrap it in an array, allowing more
687 // flexible arguments
688 if ( !is_array( $elements ) ) {
689 $elements = array( $elements );
690 // If there's a series of elements, reverse them when in RTL mode
691 } else if ( $wgContLang->isRTL() ) {
692 $elements = array_reverse( $elements );
695 foreach ( $elements as $name => $element ) {
696 echo "\n<!-- {$name} -->\n";
697 switch ( $element ) {
699 if ( count( $this->data
[ 'namespace_urls' ] ) > 0 ) {
701 <div id
="namespaces" class="vectorTabs">
702 <h5
><?php
$this->msg('namespaces') ?
></h5
>
703 <ul
<?php
$this->html('userlangattributes') ?
>>
704 <?php
foreach ($this->data
['namespace_urls'] as $key => $link ): ?
>
705 <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
>
713 if ( count( $this->data
[ 'variant_urls' ] ) > 0 ) {
715 <div id
="variants" class="vectorMenu">
716 <h5
><span
><?php
$this->msg('variants') ?
></span
><a href
="#"></a
></h5
>
718 <ul
<?php
$this->html('userlangattributes') ?
>>
719 <?php
foreach ($this->data
['variant_urls'] as $key => $link ): ?
>
720 <li
<?php
echo $link['attributes'] ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></li
>
729 if ( count( $this->data
[ 'view_urls' ] ) > 0 ) {
731 <div id
="views" class="vectorTabs">
732 <h5
><?php
$this->msg('views') ?
></h5
>
733 <ul
<?php
$this->html('userlangattributes') ?
>>
734 <?php
foreach ($this->data
['view_urls'] as $key => $link ): ?
>
735 <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
>
743 if ( count( $this->data
[ 'action_urls' ] ) > 0 ) {
745 <div id
="p-cactions" class="vectorMenu">
746 <h5
><span
><?php
$this->msg('actions') ?
></span
><a href
="#"></a
></h5
>
748 <ul
<?php
$this->html('userlangattributes') ?
>>
749 <?php
foreach ($this->data
['action_urls'] as $key => $link ): ?
>
750 <li
<?php
echo $link['attributes'] ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></li
>
759 if ( count( $this->data
['personal_urls'] ) > 0 ) {
761 <div id
="p-personal">
762 <h5
><?php
$this->msg('personaltools') ?
></h5
>
763 <ul
<?php
$this->html('userlangattributes') ?
>>
764 <?php
foreach($this->data
['personal_urls'] as $key => $item): ?
>
765 <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
>
775 <h5
<?php
$this->html('userlangattributes') ?
>><label
for="searchInput"><?php
$this->msg( 'search' ) ?
></label
></h5
>
776 <form action
="<?php $this->text( 'wgScript' ) ?>" id
="searchform">
777 <input type
='hidden' name
="title" value
="<?php $this->text( 'searchtitle' ) ?>"/>
778 <?php
if ( $wgVectorUseSimpleSearch ): ?
>
779 <div id
="simpleSearch">
780 <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; ?
> />
781 <button id
="searchButton" type
='submit' name
='fulltext' <?php
echo $this->skin
->tooltipAndAccesskey( 'search-fulltext' ); ?
>> 
;</button
>
784 <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; ?
> />
785 <input type
='submit' name
="go" class="searchButton" id
="searchGoButton" value
="<?php $this->msg( 'searcharticle' ) ?>"<?php
echo $this->skin
->tooltipAndAccesskey( 'search-go' ); ?
> />
786 <input type
="submit" name
="fulltext" class="searchButton" id
="mw-searchButton" value
="<?php $this->msg( 'searchbutton' ) ?>"<?php
echo $this->skin
->tooltipAndAccesskey( 'search-fulltext' ); ?
> />
794 echo "\n<!-- /{$name} -->\n";