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' );
53 * Builds a structured array of links used for tabs and menus
57 function buildNavigationUrls() {
58 global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle, $wgStylePath;
59 global $wgDisableLangConversion, $wgVectorUseIconWatch;
61 wfProfileIn( __METHOD__
);
64 'namespaces' => array(),
71 $action = $wgRequest->getVal( 'action', 'view' );
72 $section = $wgRequest->getVal( 'section' );
74 // Checks if page is some kind of content
75 if( $this->iscontent
) {
77 // Gets page objects for the related namespaces
78 $subjectPage = $this->mTitle
->getSubjectPage();
79 $talkPage = $this->mTitle
->getTalkPage();
81 // Determines if this is a talk page
82 $isTalk = $this->mTitle
->isTalkPage();
84 // Generates XML IDs from namespace names
85 $subjectId = $this->mTitle
->getNamespaceKey( '' );
87 if ( $subjectId == 'main' ) {
90 $talkId = "{$subjectId}_talk";
92 $currentId = $isTalk ?
$talkId : $subjectId;
94 // Adds namespace links
95 $links['namespaces'][$subjectId] = $this->tabAction(
96 $subjectPage, 'vector-namespace-' . $subjectId, !$isTalk, '', true
98 $links['namespaces'][$subjectId]['context'] = 'subject';
99 $links['namespaces'][$talkId] = $this->tabAction(
100 $talkPage, 'vector-namespace-talk', $isTalk, '', true
102 $links['namespaces'][$talkId]['context'] = 'talk';
104 // Adds view view link
105 if ( $this->mTitle
->exists() ) {
106 $links['views']['view'] = $this->tabAction(
107 $isTalk ?
$talkPage : $subjectPage,
108 'vector-view-view', ( $action == 'view' ), '', true
112 wfProfileIn( __METHOD__
. '-edit' );
114 // Checks if user can...
116 // edit the current page
117 $this->mTitle
->quickUserCan( 'edit' ) &&
120 $this->mTitle
->exists() ||
121 // or they can create one here
122 $this->mTitle
->quickUserCan( 'create' )
125 // Builds CSS class for talk page links
126 $isTalkClass = $isTalk ?
' istalk' : '';
128 // Determines if we're in edit mode
130 ( $action == 'edit' ||
$action == 'submit' ) &&
131 ( $section != 'new' )
133 $links['views']['edit'] = array(
134 'class' => ( $selected ?
'selected' : '' ) . $isTalkClass,
135 'text' => $this->mTitle
->exists()
136 ?
wfMsg( 'vector-view-edit' )
137 : wfMsg( 'vector-view-create' ),
139 $this->mTitle
->getLocalUrl( $this->editUrlOptions() )
141 // Checks if this is a current rev of talk page and we should show a new
143 if ( ( $isTalk && $wgArticle->isCurrent() ) ||
( $wgOut->showNewSectionLink() ) ) {
144 // Checks if we should ever show a new section link
145 if ( !$wgOut->forceHideNewSectionLink() ) {
146 // Adds new section link
147 //$links['actions']['addsection']
148 $links['views']['addsection'] = array(
149 'class' => 'collapsible ' . ( $section == 'new' ?
'selected' : false ),
150 'text' => wfMsg( 'vector-action-addsection' ),
151 'href' => $this->mTitle
->getLocalUrl(
152 'action=edit§ion=new'
157 // Checks if the page is known (some kind of viewable content)
158 } elseif ( $this->mTitle
->isKnown() ) {
159 // Adds view source view link
160 $links['views']['viewsource'] = array(
161 'class' => ( $action == 'edit' ) ?
'selected' : false,
162 'text' => wfMsg( 'vector-view-viewsource' ),
164 $this->mTitle
->getLocalUrl( $this->editUrlOptions() )
167 wfProfileOut( __METHOD__
. '-edit' );
169 wfProfileIn( __METHOD__
. '-live' );
171 // Checks if the page exists
172 if ( $this->mTitle
->exists() ) {
173 // Adds history view link
174 $links['views']['history'] = array(
175 'class' => 'collapsible ' . ( ($action == 'history') ?
'selected' : false ),
176 'text' => wfMsg( 'vector-view-history' ),
177 'href' => $this->mTitle
->getLocalUrl( 'action=history' ),
181 if( $wgUser->isAllowed( 'delete' ) ) {
182 $links['actions']['delete'] = array(
183 'class' => ($action == 'delete') ?
'selected' : false,
184 'text' => wfMsg( 'vector-action-delete' ),
185 'href' => $this->mTitle
->getLocalUrl( 'action=delete' )
188 if ( $this->mTitle
->quickUserCan( 'move' ) ) {
189 $moveTitle = SpecialPage
::getTitleFor(
190 'Movepage', $this->thispage
192 $links['actions']['move'] = array(
193 'class' => $this->mTitle
->isSpecial( 'Movepage' ) ?
195 'text' => wfMsg( 'vector-action-move' ),
196 'href' => $moveTitle->getLocalUrl()
201 $this->mTitle
->getNamespace() !== NS_MEDIAWIKI
&&
202 $wgUser->isAllowed( 'protect' )
204 if ( !$this->mTitle
->isProtected() ){
205 $links['actions']['protect'] = array(
206 'class' => ($action == 'protect') ?
208 'text' => wfMsg( 'vector-action-protect' ),
210 $this->mTitle
->getLocalUrl( 'action=protect' )
214 $links['actions']['unprotect'] = array(
215 'class' => ($action == 'unprotect') ?
217 'text' => wfMsg( 'vector-action-unprotect' ),
219 $this->mTitle
->getLocalUrl( 'action=unprotect' )
224 // article doesn't exist or is deleted
226 $wgUser->isAllowed( 'deletedhistory' ) &&
227 $wgUser->isAllowed( 'undelete' )
229 if( $n = $this->mTitle
->isDeleted() ) {
230 $undelTitle = SpecialPage
::getTitleFor( 'Undelete' );
231 $links['actions']['undelete'] = array(
234 'vector-action-undelete',
236 $wgLang->formatNum( $n )
238 'href' => $undelTitle->getLocalUrl(
239 'target=' . urlencode( $this->thispage
)
246 $this->mTitle
->getNamespace() !== NS_MEDIAWIKI
&&
247 $wgUser->isAllowed( 'protect' )
249 if ( !$this->mTitle
->getRestrictions( 'create' ) ) {
250 $links['actions']['protect'] = array(
251 'class' => ($action == 'protect') ?
253 'text' => wfMsg( 'vector-action-protect' ),
255 $this->mTitle
->getLocalUrl( 'action=protect' )
259 $links['actions']['unprotect'] = array(
260 'class' => ($action == 'unprotect') ?
262 'text' => wfMsg( 'vector-action-unprotect' ),
264 $this->mTitle
->getLocalUrl( 'action=unprotect' )
269 wfProfileOut( __METHOD__
. '-live' );
271 * The following actions use messages which, if made particular to
272 * the Vector skin, would break the Ajax code which makes this
273 * action happen entirely inline. Skin::makeGlobalVariablesScript
274 * defines a set of messages in a javascript object - and these
275 * messages are assumed to be global for all skins. Without making
276 * a change to that procedure these messages will have to remain as
277 * the global versions.
279 // Checks if the user is logged in
280 if ( $this->loggedin
) {
281 if ( $wgVectorUseIconWatch ) {
288 $mode = $this->mTitle
->userIsWatching() ?
'unwatch' : 'watch';
289 $links[$place][$mode] = array(
290 'class' => $class . ( ( $action == 'watch' ||
$action == 'unwatch' ) ?
' selected' : false ),
291 'text' => wfMsg( $mode ), // uses 'watch' or 'unwatch' message
292 'href' => $this->mTitle
->getLocalUrl( 'action=' . $mode )
295 // This is instead of SkinTemplateTabs - which uses a flat array
296 wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$links ) );
298 // If it's not content, it's got to be a special page
300 $links['namespaces']['special'] = array(
301 'class' => 'selected',
302 'text' => wfMsg( 'vector-namespace-special' ),
303 'href' => $wgRequest->getRequestURL()
307 // Gets list of language variants
308 $variants = $wgContLang->getVariants();
309 // Checks that language conversion is enabled and variants exist
310 if( !$wgDisableLangConversion && count( $variants ) > 1 ) {
311 // Gets preferred variant
312 $preferred = $wgContLang->getPreferredVariant();
313 // Loops over each variant
314 foreach( $variants as $code ) {
315 // Gets variant name from language code
316 $varname = $wgContLang->getVariantname( $code );
317 // Checks if the variant is marked as disabled
318 if( $varname == 'disable' ) {
319 // Skips this variant
322 // Appends variant link
323 $links['variants'][] = array(
324 'class' => ( $code == $preferred ) ?
'selected' : false,
326 'href' => $this->mTitle
->getLocalURL( '', $code )
331 wfProfileOut( __METHOD__
);
338 * QuickTemplate class for Vector skin
341 class VectorTemplate
extends QuickTemplate
{
346 * @var Cached skin object
353 * Outputs the entire contents of the XHTML page
355 public function execute() {
356 global $wgRequest, $wgOut, $wgContLang;
358 $this->skin
= $this->data
['skin'];
359 $action = $wgRequest->getText( 'action' );
361 // Build additional attributes for navigation urls
362 $nav = $this->skin
->buildNavigationUrls();
363 foreach ( $nav as $section => $links ) {
364 foreach ( $links as $key => $link ) {
366 if ( isset( $link['context'] ) && $link['context'] == 'subject' ) {
367 $xmlID = 'ca-nstab-' . $xmlID;
368 } else if ( isset( $link['context'] ) && $link['context'] == 'talk' ) {
371 $xmlID = 'ca-' . $xmlID;
373 $nav[$section][$key]['attributes'] =
374 ' id="' . Sanitizer
::escapeId( $xmlID ) . '"';
375 if ( $nav[$section][$key]['class'] ) {
376 $nav[$section][$key]['attributes'] .=
377 ' class="' . htmlspecialchars( $link['class'] ) . '"';
378 unset( $nav[$section][$key]['class'] );
380 // We don't want to give the watch tab an accesskey if the page
381 // is being edited, because that conflicts with the accesskey on
382 // the watch checkbox. We also don't want to give the edit tab
383 // an accesskey, because that's fairly superfluous and conflicts
384 // with an accesskey (Ctrl-E) often used for editing in Safari.
386 in_array( $action, array( 'edit', 'submit' ) ) &&
387 in_array( $key, array( 'edit', 'watch', 'unwatch' ) )
389 $nav[$section][$key]['key'] =
390 $this->skin
->tooltip( $xmlID );
392 $nav[$section][$key]['key'] =
393 $this->skin
->tooltipAndAccesskey( $xmlID );
397 $this->data
['namespace_urls'] = $nav['namespaces'];
398 $this->data
['view_urls'] = $nav['views'];
399 $this->data
['action_urls'] = $nav['actions'];
400 $this->data
['variant_urls'] = $nav['variants'];
401 // Build additional attributes for personal_urls
402 foreach ( $this->data
['personal_urls'] as $key => $item) {
403 $this->data
['personal_urls'][$key]['attributes'] =
404 ' id="' . Sanitizer
::escapeId( "pt-$key" ) . '"';
405 if ( isset( $item['active'] ) && $item['active'] ) {
406 $this->data
['personal_urls'][$key]['attributes'] .=
409 $this->data
['personal_urls'][$key]['key'] =
410 $this->skin
->tooltipAndAccesskey('pt-'.$key);
413 // Generate additional footer links
414 $footerlinks = array(
418 'numberofwatchingusers',
429 // Reduce footer links down to only those which are being used
430 $validFooterLinks = array();
431 foreach( $footerlinks as $category => $links ) {
432 $validFooterLinks[$category] = array();
433 foreach( $links as $link ) {
434 if( isset( $this->data
[$link] ) && $this->data
[$link] ) {
435 $validFooterLinks[$category][] = $link;
439 // Reverse horizontally rendered navigation elements
440 if ( $wgContLang->isRTL() ) {
441 $this->data
['view_urls'] =
442 array_reverse( $this->data
['view_urls'] );
443 $this->data
['namespace_urls'] =
444 array_reverse( $this->data
['namespace_urls'] );
445 $this->data
['personal_urls'] =
446 array_reverse( $this->data
['personal_urls'] );
449 $this->html( 'headelement' );
451 <div id
="page-base" class="noprint"></div
>
452 <div id
="head-base" class="noprint"></div
>
454 <div id
="content" <?php
$this->html('specialpageattributes') ?
>>
456 <div id
="mw-js-message" style
="display:none;" <?php
$this->html('userlangattributes') ?
>></div
>
457 <?php
if ( $this->data
['sitenotice'] ): ?
>
459 <div id
="siteNotice"><?php
$this->html( 'sitenotice' ) ?
></div
>
462 <!-- firstHeading
-->
463 <h1 id
="firstHeading" class="firstHeading"><?php
$this->html( 'title' ) ?
></h1
>
464 <!-- /firstHeading
-->
466 <div id
="bodyContent">
468 <h3 id
="siteSub"><?php
$this->msg( 'tagline' ) ?
></h3
>
471 <div id
="contentSub" <?php
$this->html('userlangattributes') ?
>><?php
$this->html( 'subtitle' ) ?
></div
>
473 <?php
if ( $this->data
['undelete'] ): ?
>
475 <div id
="contentSub2"><?php
$this->html( 'undelete' ) ?
></div
>
478 <?php
if($this->data
['newtalk'] ): ?
>
480 <div
class="usermessage"><?php
$this->html( 'newtalk' ) ?
></div
>
483 <?php
if ( $this->data
['showjumplinks'] ): ?
>
485 <div id
="jump-to-nav">
486 <?php
$this->msg( 'jumpto' ) ?
><a href
="#head"><?php
$this->msg( 'jumptonavigation' ) ?
></a
>,
487 <a href
="#p-search"><?php
$this->msg( 'jumptosearch' ) ?
></a
>
492 <?php
$this->html( 'bodytext' ) ?
>
494 <?php
if ( $this->data
['catlinks'] ): ?
>
496 <?php
$this->html( 'catlinks' ); ?
>
499 <?php
if ( $this->data
['dataAfterContent'] ): ?
>
500 <!-- dataAfterContent
-->
501 <?php
$this->html( 'dataAfterContent' ); ?
>
502 <!-- /dataAfterContent
-->
504 <div
class="visualClear"></div
>
506 <!-- /bodyContent
-->
510 <div id
="head" class="noprint">
511 <?php
$this->renderNavigation( 'PERSONAL' ); ?
>
512 <div id
="left-navigation">
513 <?php
$this->renderNavigation( array( 'NAMESPACES', 'VARIANTS' ) ); ?
>
515 <div id
="right-navigation">
516 <?php
$this->renderNavigation( array( 'VIEWS', 'ACTIONS', 'SEARCH' ) ); ?
>
521 <div id
="panel" class="noprint">
523 <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
>
525 <?php
$this->renderPortals( $this->data
['sidebar'] ); ?
>
529 <div id
="footer" <?php
$this->html('userlangattributes') ?
>>
530 <?php
foreach( $validFooterLinks as $category => $links ): ?
>
531 <?php
if ( count( $links ) > 0 ): ?
>
532 <ul id
="footer-<?php echo $category ?>">
533 <?php
foreach( $links as $link ): ?
>
534 <?php
if( isset( $this->data
[$link] ) && $this->data
[$link] ): ?
>
535 <li id
="footer-<?php echo $category ?>-<?php echo $link ?>"><?php
$this->html( $link ) ?
></li
>
541 <ul id
="footer-icons" class="noprint">
542 <?php
if ( $this->data
['poweredbyico'] ): ?
>
543 <li id
="footer-icon-poweredby"><?php
$this->html( 'poweredbyico' ) ?
></li
>
545 <?php
if ( $this->data
['copyrightico'] ): ?
>
546 <li id
="footer-icon-copyright"><?php
$this->html( 'copyrightico' ) ?
></li
>
549 <div style
="clear:both"></div
>
553 <script type
="<?php $this->text('jsmimetype') ?>"> if ( window
.isMSIE55
) fixalpha(); </script
>
555 <?php
$this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?
>
556 <?php
$this->html( 'reporttime' ) ?
>
557 <?php
if ( $this->data
['debug'] ): ?
>
558 <!-- Debug output
: <?php
$this->text( 'debug' ); ?
> -->
566 * Render a series of portals
568 private function renderPortals( $portals ) {
569 // Force the rendering of the following portals
570 if ( !isset( $portals['SEARCH'] ) ) $portals['SEARCH'] = true;
571 if ( !isset( $portals['TOOLBOX'] ) ) $portals['TOOLBOX'] = true;
572 if ( !isset( $portals['LANGUAGES'] ) ) $portals['LANGUAGES'] = true;
574 foreach ( $portals as $name => $content ) {
575 echo "\n<!-- {$name} -->\n";
581 <div
class="portal" id
="p-tb">
582 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$this->msg( 'toolbox' ) ?
></h5
>
585 <?php
if( $this->data
['notspecialpage'] ): ?
>
586 <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
>
587 <?php
if( $this->data
['nav_urls']['recentchangeslinked'] ): ?
>
588 <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
>
591 <?php
if( isset( $this->data
['nav_urls']['trackbacklink'] ) ): ?
>
592 <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
>
594 <?php
if( $this->data
['feeds']): ?
>
596 <?php
foreach( $this->data
['feeds'] as $key => $feed ): ?
>
597 <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
>
601 <?php
foreach( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages' ) as $special ): ?
>
602 <?php
if( $this->data
['nav_urls'][$special]): ?
>
603 <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
>
606 <?php
if( !empty( $this->data
['nav_urls']['print']['href'] ) ): ?
>
607 <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
>
609 <?php
if ( !empty( $this->data
['nav_urls']['permalink']['href'] ) ): ?
>
610 <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
>
611 <?php
elseif ( $this->data
['nav_urls']['permalink']['href'] === '' ): ?
>
612 <li id
="t-ispermalink"<?php
echo $this->skin
->tooltip( 't-ispermalink' ) ?
>><?php
$this->msg( 'permalink' ) ?
></li
>
614 <?php
wfRunHooks( 'VectorTemplateToolboxEnd', array( &$this ) ); ?
>
615 <?php
wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); ?
>
622 if ( $this->data
['language_urls'] ) {
624 <div
class="portal" id
="p-lang">
625 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$this->msg( 'otherlanguages' ) ?
></h5
>
628 <?php
foreach ( $this->data
['language_urls'] as $langlink ): ?
>
629 <li
class="<?php echo htmlspecialchars( $langlink['class'] ) ?>"><a href
="<?php echo htmlspecialchars( $langlink['href'] ) ?>"><?php
echo $langlink['text'] ?
></a
></li
>
639 <div
class="portal" id
='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php
echo $this->skin
->tooltip( 'p-' . $name ) ?
>>
640 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$out = wfMsg( $name ); if ( wfEmptyMsg( $name, $out ) ) echo htmlspecialchars( $name ); else echo htmlspecialchars( $out ); ?
></h5
>
642 <?php
if ( is_array( $content ) ): ?
>
644 <?php
foreach( $content as $key => $val ): ?
>
645 <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
>
649 <?php
echo $content; /* Allow raw HTML block to be defined by extensions */ ?
>
656 echo "\n<!-- /{$name} -->\n";
661 * Render one or more navigations elements by name, automatically reveresed
662 * when UI is in RTL mode
664 private function renderNavigation( $elements ) {
665 global $wgContLang, $wgVectorUseSimpleSearch, $wgStylePath;
667 // If only one element was given, wrap it in an array, allowing more
668 // flexible arguments
669 if ( !is_array( $elements ) ) {
670 $elements = array( $elements );
671 // If there's a series of elements, reverse them when in RTL mode
672 } else if ( $wgContLang->isRTL() ) {
673 $elements = array_reverse( $elements );
676 foreach ( $elements as $name => $element ) {
677 echo "\n<!-- {$name} -->\n";
678 switch ( $element ) {
681 <div id
="p-namespaces" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
682 <h5
><?php
$this->msg('namespaces') ?
></h5
>
683 <ul
<?php
$this->html('userlangattributes') ?
>>
684 <?php
foreach ($this->data
['namespace_urls'] as $key => $link ): ?
>
685 <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
>
693 <div id
="p-variants" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
694 <h5
><span
><?php
$this->msg('variants') ?
></span
><a href
="#"></a
></h5
>
696 <ul
<?php
$this->html('userlangattributes') ?
>>
697 <?php
foreach ($this->data
['variant_urls'] as $key => $link ): ?
>
698 <li
<?php
echo $link['attributes'] ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></li
>
707 <div id
="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
708 <h5
><?php
$this->msg('views') ?
></h5
>
709 <ul
<?php
$this->html('userlangattributes') ?
>>
710 <?php
foreach ($this->data
['view_urls'] as $key => $link ): ?
>
711 <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
>
719 <div id
="p-cactions" class="vectorMenu<?php if ( count( $this->data['action_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
720 <h5
><span
><?php
$this->msg('actions') ?
></span
><a href
="#"></a
></h5
>
722 <ul
<?php
$this->html('userlangattributes') ?
>>
723 <?php
foreach ($this->data
['action_urls'] as $key => $link ): ?
>
724 <li
<?php
echo $link['attributes'] ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></li
>
733 <div id
="p-personal" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
734 <h5
><?php
$this->msg('personaltools') ?
></h5
>
735 <ul
<?php
$this->html('userlangattributes') ?
>>
736 <?php
foreach($this->data
['personal_urls'] as $key => $item): ?
>
737 <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
>
746 <h5
<?php
$this->html('userlangattributes') ?
>><label
for="searchInput"><?php
$this->msg( 'search' ) ?
></label
></h5
>
747 <form action
="<?php $this->text( 'wgScript' ) ?>" id
="searchform">
748 <input type
='hidden' name
="title" value
="<?php $this->text( 'searchtitle' ) ?>"/>
749 <?php
if ( $wgVectorUseSimpleSearch ): ?
>
750 <div id
="simpleSearch">
751 <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; ?
> />
752 <button id
="searchButton" type
='submit' name
='button' <?php
echo $this->skin
->tooltipAndAccesskey( 'search-fulltext' ); ?
>> 
;</button
>
755 <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; ?
> />
756 <input type
='submit' name
="go" class="searchButton" id
="searchGoButton" value
="<?php $this->msg( 'searcharticle' ) ?>"<?php
echo $this->skin
->tooltipAndAccesskey( 'search-go' ); ?
> />
757 <input type
="submit" name
="fulltext" class="searchButton" id
="mw-searchButton" value
="<?php $this->msg( 'searchbutton' ) ?>"<?php
echo $this->skin
->tooltipAndAccesskey( 'search-fulltext' ); ?
> />
765 echo "\n<!-- /{$name} -->\n";