3 * Vector - Branch of MonoBook which has many usability improvements and
4 * somewhat cleaner code.
11 if( !defined( 'MEDIAWIKI' ) ) {
16 * SkinTemplate class for Vector skin
19 class SkinVector
extends SkinTemplate
{
22 var $skinname = 'vector', $stylename = 'vector',
23 $template = 'VectorTemplate', $useHeadElement = true;
26 * Initializes output page and sets up skin-specific parameters
27 * @param $out OutputPage object to initialize
29 public function initPage( OutputPage
$out ) {
30 global $wgLocalStylePath;
32 parent
::initPage( $out );
34 // Append CSS which includes IE only behavior fixes for hover support -
35 // this is better than including this in a CSS fille since it doesn't
36 // wait for the CSS file to load before fetching the HTC file.
38 '<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
39 htmlspecialchars( $wgLocalStylePath ) .
40 '/vector/csshover.htc")}</style><![endif]-->'
45 * Load skin and user CSS files in the correct order
47 * @param $out OutputPage object
49 function setupSkinUserCss( OutputPage
$out ){
50 global $wgVectorExtraStyles;
52 parent
::setupSkinUserCss( $out );
54 // Append skin-specific styles
55 $out->addStyle( 'vector/main-rtl.css', 'screen', '', 'rtl' );
56 $out->addStyle( 'vector/main-ltr.css', 'screen', '', 'ltr' );
58 // Add extra stylesheets
59 // THIS IS ONLY USEFUL FOR EXPERIMENTING WITH DIFFERNT STYLE OPTIONS! THIS WILL BE REMOVED IN THE NEAR FUTURE.
60 if ( is_array( $wgVectorExtraStyles ) ) {
61 foreach ( $wgVectorExtraStyles as $style ) {
62 $out->addStyle( 'vector/' . $style, 'screen' );
68 * Builds a structured array of links used for tabs and menus
72 function buildNavigationUrls() {
73 global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle;
74 global $wgDisableLangConversion, $wgVectorUseIconWatch;
76 wfProfileIn( __METHOD__
);
79 'namespaces' => array(),
86 $action = $wgRequest->getVal( 'action', 'view' );
87 $section = $wgRequest->getVal( 'section' );
89 // Checks if page is some kind of content
90 if( $this->iscontent
) {
91 // Gets page objects for the related namespaces
92 $subjectPage = $this->mTitle
->getSubjectPage();
93 $talkPage = $this->mTitle
->getTalkPage();
95 // Determines if this is a talk page
96 $isTalk = $this->mTitle
->isTalkPage();
98 // Generates XML IDs from namespace names
99 $subjectId = $this->mTitle
->getNamespaceKey( '' );
101 if ( $subjectId == 'main' ) {
104 $talkId = "{$subjectId}_talk";
106 $currentId = $isTalk ?
$talkId : $subjectId;
108 // Adds namespace links
109 $links['namespaces'][$subjectId] = $this->tabAction(
110 $subjectPage, 'vector-namespace-' . $subjectId, !$isTalk, '', true
112 $links['namespaces'][$subjectId]['context'] = 'subject';
113 $links['namespaces'][$talkId] = $this->tabAction(
114 $talkPage, 'vector-namespace-talk', $isTalk, '', true
116 $links['namespaces'][$talkId]['context'] = 'talk';
118 // Adds view view link
119 if ( $this->mTitle
->exists() ) {
120 $links['views']['view'] = $this->tabAction(
121 $isTalk ?
$talkPage : $subjectPage,
122 'vector-view-view', ( $action == 'view' ), '', true
126 wfProfileIn( __METHOD__
. '-edit' );
128 // Checks if user can...
130 // edit the current page
131 $this->mTitle
->quickUserCan( 'edit' ) &&
134 $this->mTitle
->exists() ||
135 // or they can create one here
136 $this->mTitle
->quickUserCan( 'create' )
139 // Builds CSS class for talk page links
140 $isTalkClass = $isTalk ?
' istalk' : '';
142 // Determines if we're in edit mode
144 ( $action == 'edit' ||
$action == 'submit' ) &&
145 ( $section != 'new' )
147 $links['views']['edit'] = array(
148 'class' => ( $selected ?
'selected' : '' ) . $isTalkClass,
149 'text' => $this->mTitle
->exists()
150 ?
wfMsg( 'vector-view-edit' )
151 : wfMsg( 'vector-view-create' ),
153 $this->mTitle
->getLocalURL( $this->editUrlOptions() )
155 // Checks if this is a current rev of talk page and we should show a new
157 if ( ( $isTalk && $wgArticle->isCurrent() ) ||
( $wgOut->showNewSectionLink() ) ) {
158 // Checks if we should ever show a new section link
159 if ( !$wgOut->forceHideNewSectionLink() ) {
160 // Adds new section link
161 //$links['actions']['addsection']
162 $links['views']['addsection'] = array(
163 'class' => 'collapsible ' . ( $section == 'new' ?
'selected' : false ),
164 'text' => wfMsg( 'vector-action-addsection' ),
165 'href' => $this->mTitle
->getLocalURL(
166 'action=edit§ion=new'
171 // Checks if the page has some kind of viewable content
172 } elseif ( $this->mTitle
->hasSourceText() ) {
173 // Adds view source view link
174 $links['views']['viewsource'] = array(
175 'class' => ( $action == 'edit' ) ?
'selected' : false,
176 'text' => wfMsg( 'vector-view-viewsource' ),
178 $this->mTitle
->getLocalURL( $this->editUrlOptions() )
181 wfProfileOut( __METHOD__
. '-edit' );
183 wfProfileIn( __METHOD__
. '-live' );
185 // Checks if the page exists
186 if ( $this->mTitle
->exists() ) {
187 // Adds history view link
188 $links['views']['history'] = array(
189 'class' => 'collapsible ' . ( ( $action == 'history' ) ?
'selected' : false ),
190 'text' => wfMsg( 'vector-view-history' ),
191 'href' => $this->mTitle
->getLocalURL( 'action=history' ),
195 if( $wgUser->isAllowed( 'delete' ) ) {
196 $links['actions']['delete'] = array(
197 'class' => ( $action == 'delete' ) ?
'selected' : false,
198 'text' => wfMsg( 'vector-action-delete' ),
199 'href' => $this->mTitle
->getLocalURL( 'action=delete' )
202 if ( $this->mTitle
->quickUserCan( 'move' ) ) {
203 $moveTitle = SpecialPage
::getTitleFor(
204 'Movepage', $this->thispage
206 $links['actions']['move'] = array(
207 'class' => $this->mTitle
->isSpecial( 'Movepage' ) ?
209 'text' => wfMsg( 'vector-action-move' ),
210 'href' => $moveTitle->getLocalURL()
215 $this->mTitle
->getNamespace() !== NS_MEDIAWIKI
&&
216 $wgUser->isAllowed( 'protect' )
218 if ( !$this->mTitle
->isProtected() ) {
219 $links['actions']['protect'] = array(
220 'class' => ( $action == 'protect' ) ?
222 'text' => wfMsg( 'vector-action-protect' ),
224 $this->mTitle
->getLocalURL( 'action=protect' )
228 $links['actions']['unprotect'] = array(
229 'class' => ( $action == 'unprotect' ) ?
231 'text' => wfMsg( 'vector-action-unprotect' ),
233 $this->mTitle
->getLocalURL( 'action=unprotect' )
238 // article doesn't exist or is deleted
240 $wgUser->isAllowed( 'deletedhistory' ) &&
241 $wgUser->isAllowed( 'undelete' )
243 if( $n = $this->mTitle
->isDeleted() ) {
244 $undelTitle = SpecialPage
::getTitleFor( 'Undelete' );
245 $links['actions']['undelete'] = array(
248 'vector-action-undelete',
250 $wgLang->formatNum( $n )
252 'href' => $undelTitle->getLocalURL(
253 'target=' . urlencode( $this->thispage
)
260 $this->mTitle
->getNamespace() !== NS_MEDIAWIKI
&&
261 $wgUser->isAllowed( 'protect' )
263 if ( !$this->mTitle
->getRestrictions( 'create' ) ) {
264 $links['actions']['protect'] = array(
265 'class' => ( $action == 'protect' ) ?
267 'text' => wfMsg( 'vector-action-protect' ),
269 $this->mTitle
->getLocalURL( 'action=protect' )
273 $links['actions']['unprotect'] = array(
274 'class' => ( $action == 'unprotect' ) ?
276 'text' => wfMsg( 'vector-action-unprotect' ),
278 $this->mTitle
->getLocalURL( 'action=unprotect' )
283 wfProfileOut( __METHOD__
. '-live' );
285 * The following actions use messages which, if made particular to
286 * the Vector skin, would break the Ajax code which makes this
287 * action happen entirely inline. Skin::makeGlobalVariablesScript
288 * defines a set of messages in a javascript object - and these
289 * messages are assumed to be global for all skins. Without making
290 * a change to that procedure these messages will have to remain as
291 * the global versions.
293 // Checks if the user is logged in
294 if ( $this->loggedin
) {
295 if ( $wgVectorUseIconWatch ) {
302 $mode = $this->mTitle
->userIsWatching() ?
'unwatch' : 'watch';
303 $links[$place][$mode] = array(
304 'class' => $class . ( ( $action == 'watch' ||
$action == 'unwatch' ) ?
' selected' : false ),
305 'text' => wfMsg( $mode ), // uses 'watch' or 'unwatch' message
306 'href' => $this->mTitle
->getLocalURL( 'action=' . $mode )
309 // This is instead of SkinTemplateTabs - which uses a flat array
310 wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$links ) );
312 // If it's not content, it's got to be a special page
314 $links['namespaces']['special'] = array(
315 'class' => 'selected',
316 'text' => wfMsg( 'vector-namespace-special' ),
317 'href' => $wgRequest->getRequestURL()
321 // Gets list of language variants
322 $variants = $wgContLang->getVariants();
323 // Checks that language conversion is enabled and variants exist
324 if( !$wgDisableLangConversion && count( $variants ) > 1 ) {
325 // Gets preferred variant
326 $preferred = $wgContLang->getPreferredVariant();
327 // Loops over each variant
328 foreach( $variants as $code ) {
329 // Gets variant name from language code
330 $varname = $wgContLang->getVariantname( $code );
331 // Checks if the variant is marked as disabled
332 if( $varname == 'disable' ) {
333 // Skips this variant
336 // Appends variant link
337 $links['variants'][] = array(
338 'class' => ( $code == $preferred ) ?
'selected' : false,
340 'href' => $this->mTitle
->getLocalURL( '', $code )
345 wfProfileOut( __METHOD__
);
352 * QuickTemplate class for Vector skin
355 class VectorTemplate
extends QuickTemplate
{
360 * @var Cached skin object
367 * Outputs the entire contents of the XHTML page
369 public function execute() {
370 global $wgRequest, $wgOut, $wgContLang;
372 $this->skin
= $this->data
['skin'];
373 $action = $wgRequest->getText( 'action' );
375 // Build additional attributes for navigation urls
376 $nav = $this->skin
->buildNavigationUrls();
377 foreach ( $nav as $section => $links ) {
378 foreach ( $links as $key => $link ) {
380 if ( isset( $link['context'] ) && $link['context'] == 'subject' ) {
381 $xmlID = 'ca-nstab-' . $xmlID;
382 } else if ( isset( $link['context'] ) && $link['context'] == 'talk' ) {
385 $xmlID = 'ca-' . $xmlID;
387 $nav[$section][$key]['attributes'] =
388 ' id="' . Sanitizer
::escapeId( $xmlID ) . '"';
389 if ( $nav[$section][$key]['class'] ) {
390 $nav[$section][$key]['attributes'] .=
391 ' class="' . htmlspecialchars( $link['class'] ) . '"';
392 unset( $nav[$section][$key]['class'] );
394 // We don't want to give the watch tab an accesskey if the page
395 // is being edited, because that conflicts with the accesskey on
396 // the watch checkbox. We also don't want to give the edit tab
397 // an accesskey, because that's fairly superfluous and conflicts
398 // with an accesskey (Ctrl-E) often used for editing in Safari.
400 in_array( $action, array( 'edit', 'submit' ) ) &&
401 in_array( $key, array( 'edit', 'watch', 'unwatch' ) )
403 $nav[$section][$key]['key'] =
404 $this->skin
->tooltip( $xmlID );
406 $nav[$section][$key]['key'] =
407 $this->skin
->tooltipAndAccesskey( $xmlID );
411 $this->data
['namespace_urls'] = $nav['namespaces'];
412 $this->data
['view_urls'] = $nav['views'];
413 $this->data
['action_urls'] = $nav['actions'];
414 $this->data
['variant_urls'] = $nav['variants'];
415 // Build additional attributes for personal_urls
416 foreach ( $this->data
['personal_urls'] as $key => $item) {
417 $this->data
['personal_urls'][$key]['attributes'] =
418 ' id="' . Sanitizer
::escapeId( "pt-$key" ) . '"';
419 if ( isset( $item['active'] ) && $item['active'] ) {
420 $this->data
['personal_urls'][$key]['attributes'] .=
423 $this->data
['personal_urls'][$key]['key'] =
424 $this->skin
->tooltipAndAccesskey('pt-'.$key);
427 // Generate additional footer links
428 $footerlinks = array(
432 'numberofwatchingusers',
447 $footerlinksClasses = array(
448 'icons' => array( 'noprint' )
451 // Reduce footer links down to only those which are being used
452 $validFooterLinks = array();
453 foreach( $footerlinks as $category => $links ) {
454 $validFooterLinks[$category] = array();
455 foreach( $links as $link ) {
456 if( isset( $this->data
[$link] ) && $this->data
[$link] ) {
457 $validFooterLinks[$category][] = $link;
461 // Reverse horizontally rendered navigation elements
462 if ( $wgContLang->isRTL() ) {
463 $this->data
['view_urls'] =
464 array_reverse( $this->data
['view_urls'] );
465 $this->data
['namespace_urls'] =
466 array_reverse( $this->data
['namespace_urls'] );
467 $this->data
['personal_urls'] =
468 array_reverse( $this->data
['personal_urls'] );
471 $this->html( 'headelement' );
473 <div id
="mw-page-base" class="noprint"></div
>
474 <div id
="mw-head-base" class="noprint"></div
>
476 <div id
="content"<?php
$this->html('specialpageattributes') ?
>>
478 <div id
="mw-js-message" style
="display:none;"<?php
$this->html('userlangattributes') ?
>></div
>
479 <?php
if ( $this->data
['sitenotice'] ): ?
>
481 <div id
="siteNotice"><?php
$this->html( 'sitenotice' ) ?
></div
>
484 <!-- firstHeading
-->
485 <h1 id
="firstHeading" class="firstHeading"><?php
$this->html( 'title' ) ?
></h1
>
486 <!-- /firstHeading
-->
488 <div id
="bodyContent">
490 <h3 id
="siteSub"><?php
$this->msg( 'tagline' ) ?
></h3
>
493 <div id
="contentSub"<?php
$this->html('userlangattributes') ?
>><?php
$this->html( 'subtitle' ) ?
></div
>
495 <?php
if ( $this->data
['undelete'] ): ?
>
497 <div id
="contentSub2"><?php
$this->html( 'undelete' ) ?
></div
>
500 <?php
if($this->data
['newtalk'] ): ?
>
502 <div
class="usermessage"><?php
$this->html( 'newtalk' ) ?
></div
>
505 <?php
if ( $this->data
['showjumplinks'] ): ?
>
507 <div id
="jump-to-nav">
508 <?php
$this->msg( 'jumpto' ) ?
> <a href
="#mw-head"><?php
$this->msg( 'jumptonavigation' ) ?
></a
>,
509 <a href
="#p-search"><?php
$this->msg( 'jumptosearch' ) ?
></a
>
514 <?php
$this->html( 'bodytext' ) ?
>
516 <?php
if ( $this->data
['catlinks'] ): ?
>
518 <?php
$this->html( 'catlinks' ); ?
>
521 <?php
if ( $this->data
['dataAfterContent'] ): ?
>
522 <!-- dataAfterContent
-->
523 <?php
$this->html( 'dataAfterContent' ); ?
>
524 <!-- /dataAfterContent
-->
526 <div
class="visualClear"></div
>
528 <!-- /bodyContent
-->
532 <div id
="mw-head" class="noprint">
533 <?php
$this->renderNavigation( 'PERSONAL' ); ?
>
534 <div id
="left-navigation">
535 <?php
$this->renderNavigation( array( 'NAMESPACES', 'VARIANTS' ) ); ?
>
537 <div id
="right-navigation">
538 <?php
$this->renderNavigation( array( 'VIEWS', 'ACTIONS', 'SEARCH' ) ); ?
>
543 <div id
="mw-panel" class="noprint">
545 <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
>
547 <?php
$this->renderPortals( $this->data
['sidebar'] ); ?
>
551 <div id
="footer"<?php
$this->html('userlangattributes') ?
>>
552 <?php
foreach( $validFooterLinks as $category => $links ): ?
>
553 <?php
if ( count( $links ) > 0 ): ?
>
554 <ul id
="footer-<?php echo $category ?>"<?php
if (isset($footerlinksClasses[$category])) echo ' class="' . implode(" ", $footerlinksClasses[$category]) . '"'; ?
>>
555 <?php
foreach( $links as $link ): ?
>
556 <?php
if( isset( $this->data
[$link] ) && $this->data
[$link] ): ?
>
557 <li id
="footer-<?php echo $category ?>-<?php echo $link ?>"><?php
$this->html( $link ) ?
></li
>
563 <div style
="clear:both"></div
>
567 <script type
="<?php $this->text('jsmimetype') ?>"> if ( window
.isMSIE55
) fixalpha(); </script
>
569 <?php
$this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?
>
570 <?php
$this->html( 'reporttime' ) ?
>
571 <?php
if ( $this->data
['debug'] ): ?
>
572 <!-- Debug output
: <?php
$this->text( 'debug' ); ?
> -->
580 * Render a series of portals
582 private function renderPortals( $portals ) {
583 // Force the rendering of the following portals
584 if ( !isset( $portals['SEARCH'] ) ) $portals['SEARCH'] = true;
585 if ( !isset( $portals['TOOLBOX'] ) ) $portals['TOOLBOX'] = true;
586 if ( !isset( $portals['LANGUAGES'] ) ) $portals['LANGUAGES'] = true;
588 foreach ( $portals as $name => $content ) {
589 echo "\n<!-- {$name} -->\n";
595 <div
class="portal" id
="p-tb">
596 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$this->msg( 'toolbox' ) ?
></h5
>
599 <?php
if( $this->data
['notspecialpage'] ): ?
>
600 <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
>
601 <?php
if( $this->data
['nav_urls']['recentchangeslinked'] ): ?
>
602 <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
>
605 <?php
if( isset( $this->data
['nav_urls']['trackbacklink'] ) ): ?
>
606 <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
>
608 <?php
if( $this->data
['feeds']): ?
>
610 <?php
foreach( $this->data
['feeds'] as $key => $feed ): ?
>
611 <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
>
615 <?php
foreach( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages' ) as $special ): ?
>
616 <?php
if( $this->data
['nav_urls'][$special]): ?
>
617 <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
>
620 <?php
if( !empty( $this->data
['nav_urls']['print']['href'] ) ): ?
>
621 <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
>
623 <?php
if ( !empty( $this->data
['nav_urls']['permalink']['href'] ) ): ?
>
624 <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
>
625 <?php
elseif ( $this->data
['nav_urls']['permalink']['href'] === '' ): ?
>
626 <li id
="t-ispermalink"<?php
echo $this->skin
->tooltip( 't-ispermalink' ) ?
>><?php
$this->msg( 'permalink' ) ?
></li
>
628 <?php
wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); ?
>
635 if ( $this->data
['language_urls'] ) {
637 <div
class="portal" id
="p-lang">
638 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$this->msg( 'otherlanguages' ) ?
></h5
>
641 <?php
foreach ( $this->data
['language_urls'] as $langlink ): ?
>
642 <li
class="<?php echo htmlspecialchars( $langlink['class'] ) ?>"><a href
="<?php echo htmlspecialchars( $langlink['href'] ) ?>" title
="<?php echo htmlspecialchars( $langlink['title'] ) ?>"><?php
echo $langlink['text'] ?
></a
></li
>
652 <div
class="portal" id
='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php
echo $this->skin
->tooltip( 'p-' . $name ) ?
>>
653 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$out = wfMsg( $name ); if ( wfEmptyMsg( $name, $out ) ) echo htmlspecialchars( $name ); else echo htmlspecialchars( $out ); ?
></h5
>
655 <?php
if ( is_array( $content ) ): ?
>
657 <?php
foreach( $content as $key => $val ): ?
>
658 <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
>
662 <?php
echo $content; /* Allow raw HTML block to be defined by extensions */ ?
>
669 echo "\n<!-- /{$name} -->\n";
674 * Render one or more navigations elements by name, automatically reveresed
675 * when UI is in RTL mode
677 private function renderNavigation( $elements ) {
678 global $wgContLang, $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser;
680 // If only one element was given, wrap it in an array, allowing more
681 // flexible arguments
682 if ( !is_array( $elements ) ) {
683 $elements = array( $elements );
684 // If there's a series of elements, reverse them when in RTL mode
685 } else if ( $wgContLang->isRTL() ) {
686 $elements = array_reverse( $elements );
689 foreach ( $elements as $name => $element ) {
690 echo "\n<!-- {$name} -->\n";
691 switch ( $element ) {
694 <div id
="p-namespaces" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
695 <h5
><?php
$this->msg('namespaces') ?
></h5
>
696 <ul
<?php
$this->html('userlangattributes') ?
>>
697 <?php
foreach ($this->data
['namespace_urls'] as $key => $link ): ?
>
698 <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
>
706 <div id
="p-variants" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
707 <?php
if ( $wgVectorShowVariantName ): ?
>
709 <?php
foreach ( $this->data
['variant_urls'] as $key => $link ): ?
>
710 <?php
if ( stripos( $link['attributes'], 'selected' ) !== false ): ?
>
711 <?php
echo htmlspecialchars( $link['text'] ) ?
>
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 <div id
="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
730 <h5
><?php
$this->msg('views') ?
></h5
>
731 <ul
<?php
$this->html('userlangattributes') ?
>>
732 <?php
foreach ( $this->data
['view_urls'] as $key => $link ): ?
>
733 <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
>
741 <div id
="p-cactions" class="vectorMenu<?php if ( count( $this->data['action_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
742 <h5
><span
><?php
$this->msg('actions') ?
></span
><a href
="#"></a
></h5
>
744 <ul
<?php
$this->html('userlangattributes') ?
>>
745 <?php
foreach ($this->data
['action_urls'] as $key => $link ): ?
>
746 <li
<?php
echo $link['attributes'] ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></li
>
755 <div id
="p-personal" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
756 <h5
><?php
$this->msg('personaltools') ?
></h5
>
757 <ul
<?php
$this->html('userlangattributes') ?
>>
758 <?php
foreach($this->data
['personal_urls'] as $key => $item): ?
>
759 <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
>
768 <h5
<?php
$this->html('userlangattributes') ?
>><label
for="searchInput"><?php
$this->msg( 'search' ) ?
></label
></h5
>
769 <form action
="<?php $this->text( 'wgScript' ) ?>" id
="searchform">
770 <input type
='hidden' name
="title" value
="<?php $this->text( 'searchtitle' ) ?>"/>
771 <?php
if ( $wgVectorUseSimpleSearch && $wgUser->getOption( 'vector-simplesearch' ) ): ?
>
772 <div id
="simpleSearch">
773 <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; ?
> />
774 <button id
="searchButton" type
='submit' name
='button' <?php
echo $this->skin
->tooltipAndAccesskey( 'search-fulltext' ); ?
>> </button>
777 <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; ?
> />
778 <input type
='submit' name
="go" class="searchButton" id
="searchGoButton" value
="<?php $this->msg( 'searcharticle' ) ?>"<?php
echo $this->skin
->tooltipAndAccesskey( 'search-go' ); ?
> />
779 <input type
="submit" name
="fulltext" class="searchButton" id
="mw-searchButton" value
="<?php $this->msg( 'searchbutton' ) ?>"<?php
echo $this->skin
->tooltipAndAccesskey( 'search-fulltext' ); ?
> />
787 echo "\n<!-- /{$name} -->\n";