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 ) {
31 parent
::initPage( $out );
33 // Append CSS which includes IE only behavior fixes for hover support -
34 // this is better than including this in a CSS fille since it doesn't
35 // wait for the CSS file to load before fetching the HTC file.
37 '<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
39 '/vector/csshover.htc")}</style><![endif]-->'
44 * Load skin and user css files in the correct order
46 * @param object $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, $wgStylePath;
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
) {
92 // Gets page objects for the related namespaces
93 $subjectPage = $this->mTitle
->getSubjectPage();
94 $talkPage = $this->mTitle
->getTalkPage();
96 // Determines if this is a talk page
97 $isTalk = $this->mTitle
->isTalkPage();
99 // Generates XML IDs from namespace names
100 $subjectId = $this->mTitle
->getNamespaceKey( '' );
102 if ( $subjectId == 'main' ) {
105 $talkId = "{$subjectId}_talk";
107 $currentId = $isTalk ?
$talkId : $subjectId;
109 // Adds namespace links
110 $links['namespaces'][$subjectId] = $this->tabAction(
111 $subjectPage, 'vector-namespace-' . $subjectId, !$isTalk, '', true
113 $links['namespaces'][$subjectId]['context'] = 'subject';
114 $links['namespaces'][$talkId] = $this->tabAction(
115 $talkPage, 'vector-namespace-talk', $isTalk, '', true
117 $links['namespaces'][$talkId]['context'] = 'talk';
119 // Adds view view link
120 if ( $this->mTitle
->exists() ) {
121 $links['views']['view'] = $this->tabAction(
122 $isTalk ?
$talkPage : $subjectPage,
123 'vector-view-view', ( $action == 'view' ), '', true
127 wfProfileIn( __METHOD__
. '-edit' );
129 // Checks if user can...
131 // edit the current page
132 $this->mTitle
->quickUserCan( 'edit' ) &&
135 $this->mTitle
->exists() ||
136 // or they can create one here
137 $this->mTitle
->quickUserCan( 'create' )
140 // Builds CSS class for talk page links
141 $isTalkClass = $isTalk ?
' istalk' : '';
143 // Determines if we're in edit mode
145 ( $action == 'edit' ||
$action == 'submit' ) &&
146 ( $section != 'new' )
148 $links['views']['edit'] = array(
149 'class' => ( $selected ?
'selected' : '' ) . $isTalkClass,
150 'text' => $this->mTitle
->exists()
151 ?
wfMsg( 'vector-view-edit' )
152 : wfMsg( 'vector-view-create' ),
154 $this->mTitle
->getLocalUrl( $this->editUrlOptions() )
156 // Checks if this is a current rev of talk page and we should show a new
158 if ( ( $isTalk && $wgArticle->isCurrent() ) ||
( $wgOut->showNewSectionLink() ) ) {
159 // Checks if we should ever show a new section link
160 if ( !$wgOut->forceHideNewSectionLink() ) {
161 // Adds new section link
162 //$links['actions']['addsection']
163 $links['views']['addsection'] = array(
164 'class' => 'collapsible ' . ( $section == 'new' ?
'selected' : false ),
165 'text' => wfMsg( 'vector-action-addsection' ),
166 'href' => $this->mTitle
->getLocalUrl(
167 'action=edit§ion=new'
172 // Checks if the page is known (some kind of viewable content)
173 } elseif ( $this->mTitle
->isKnown() ) {
174 // Adds view source view link
175 $links['views']['viewsource'] = array(
176 'class' => ( $action == 'edit' ) ?
'selected' : false,
177 'text' => wfMsg( 'vector-view-viewsource' ),
179 $this->mTitle
->getLocalUrl( $this->editUrlOptions() )
182 wfProfileOut( __METHOD__
. '-edit' );
184 wfProfileIn( __METHOD__
. '-live' );
186 // Checks if the page exists
187 if ( $this->mTitle
->exists() ) {
188 // Adds history view link
189 $links['views']['history'] = array(
190 'class' => 'collapsible ' . ( ($action == 'history') ?
'selected' : false ),
191 'text' => wfMsg( 'vector-view-history' ),
192 'href' => $this->mTitle
->getLocalUrl( 'action=history' ),
196 if( $wgUser->isAllowed( 'delete' ) ) {
197 $links['actions']['delete'] = array(
198 'class' => ($action == 'delete') ?
'selected' : false,
199 'text' => wfMsg( 'vector-action-delete' ),
200 'href' => $this->mTitle
->getLocalUrl( 'action=delete' )
203 if ( $this->mTitle
->quickUserCan( 'move' ) ) {
204 $moveTitle = SpecialPage
::getTitleFor(
205 'Movepage', $this->thispage
207 $links['actions']['move'] = array(
208 'class' => $this->mTitle
->isSpecial( 'Movepage' ) ?
210 'text' => wfMsg( 'vector-action-move' ),
211 'href' => $moveTitle->getLocalUrl()
216 $this->mTitle
->getNamespace() !== NS_MEDIAWIKI
&&
217 $wgUser->isAllowed( 'protect' )
219 if ( !$this->mTitle
->isProtected() ){
220 $links['actions']['protect'] = array(
221 'class' => ($action == 'protect') ?
223 'text' => wfMsg( 'vector-action-protect' ),
225 $this->mTitle
->getLocalUrl( 'action=protect' )
229 $links['actions']['unprotect'] = array(
230 'class' => ($action == 'unprotect') ?
232 'text' => wfMsg( 'vector-action-unprotect' ),
234 $this->mTitle
->getLocalUrl( 'action=unprotect' )
239 // article doesn't exist or is deleted
241 $wgUser->isAllowed( 'deletedhistory' ) &&
242 $wgUser->isAllowed( 'undelete' )
244 if( $n = $this->mTitle
->isDeleted() ) {
245 $undelTitle = SpecialPage
::getTitleFor( 'Undelete' );
246 $links['actions']['undelete'] = array(
249 'vector-action-undelete',
251 $wgLang->formatNum( $n )
253 'href' => $undelTitle->getLocalUrl(
254 'target=' . urlencode( $this->thispage
)
261 $this->mTitle
->getNamespace() !== NS_MEDIAWIKI
&&
262 $wgUser->isAllowed( 'protect' )
264 if ( !$this->mTitle
->getRestrictions( 'create' ) ) {
265 $links['actions']['protect'] = array(
266 'class' => ($action == 'protect') ?
268 'text' => wfMsg( 'vector-action-protect' ),
270 $this->mTitle
->getLocalUrl( 'action=protect' )
274 $links['actions']['unprotect'] = array(
275 'class' => ($action == 'unprotect') ?
277 'text' => wfMsg( 'vector-action-unprotect' ),
279 $this->mTitle
->getLocalUrl( 'action=unprotect' )
284 wfProfileOut( __METHOD__
. '-live' );
286 * The following actions use messages which, if made particular to
287 * the Vector skin, would break the Ajax code which makes this
288 * action happen entirely inline. Skin::makeGlobalVariablesScript
289 * defines a set of messages in a javascript object - and these
290 * messages are assumed to be global for all skins. Without making
291 * a change to that procedure these messages will have to remain as
292 * the global versions.
294 // Checks if the user is logged in
295 if ( $this->loggedin
) {
296 if ( $wgVectorUseIconWatch ) {
303 $mode = $this->mTitle
->userIsWatching() ?
'unwatch' : 'watch';
304 $links[$place][$mode] = array(
305 'class' => $class . ( ( $action == 'watch' ||
$action == 'unwatch' ) ?
' selected' : false ),
306 'text' => wfMsg( $mode ), // uses 'watch' or 'unwatch' message
307 'href' => $this->mTitle
->getLocalUrl( 'action=' . $mode )
310 // This is instead of SkinTemplateTabs - which uses a flat array
311 wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$links ) );
313 // If it's not content, it's got to be a special page
315 $links['namespaces']['special'] = array(
316 'class' => 'selected',
317 'text' => wfMsg( 'vector-namespace-special' ),
318 'href' => $wgRequest->getRequestURL()
322 // Gets list of language variants
323 $variants = $wgContLang->getVariants();
324 // Checks that language conversion is enabled and variants exist
325 if( !$wgDisableLangConversion && count( $variants ) > 1 ) {
326 // Gets preferred variant
327 $preferred = $wgContLang->getPreferredVariant();
328 // Loops over each variant
329 foreach( $variants as $code ) {
330 // Gets variant name from language code
331 $varname = $wgContLang->getVariantname( $code );
332 // Checks if the variant is marked as disabled
333 if( $varname == 'disable' ) {
334 // Skips this variant
337 // Appends variant link
338 $links['variants'][] = array(
339 'class' => ( $code == $preferred ) ?
'selected' : false,
341 'href' => $this->mTitle
->getLocalURL( '', $code )
346 wfProfileOut( __METHOD__
);
353 * QuickTemplate class for Vector skin
356 class VectorTemplate
extends QuickTemplate
{
361 * @var Cached skin object
368 * Outputs the entire contents of the XHTML page
370 public function execute() {
371 global $wgRequest, $wgOut, $wgContLang;
373 $this->skin
= $this->data
['skin'];
374 $action = $wgRequest->getText( 'action' );
376 // Build additional attributes for navigation urls
377 $nav = $this->skin
->buildNavigationUrls();
378 foreach ( $nav as $section => $links ) {
379 foreach ( $links as $key => $link ) {
381 if ( isset( $link['context'] ) && $link['context'] == 'subject' ) {
382 $xmlID = 'ca-nstab-' . $xmlID;
383 } else if ( isset( $link['context'] ) && $link['context'] == 'talk' ) {
386 $xmlID = 'ca-' . $xmlID;
388 $nav[$section][$key]['attributes'] =
389 ' id="' . Sanitizer
::escapeId( $xmlID ) . '"';
390 if ( $nav[$section][$key]['class'] ) {
391 $nav[$section][$key]['attributes'] .=
392 ' class="' . htmlspecialchars( $link['class'] ) . '"';
393 unset( $nav[$section][$key]['class'] );
395 // We don't want to give the watch tab an accesskey if the page
396 // is being edited, because that conflicts with the accesskey on
397 // the watch checkbox. We also don't want to give the edit tab
398 // an accesskey, because that's fairly superfluous and conflicts
399 // with an accesskey (Ctrl-E) often used for editing in Safari.
401 in_array( $action, array( 'edit', 'submit' ) ) &&
402 in_array( $key, array( 'edit', 'watch', 'unwatch' ) )
404 $nav[$section][$key]['key'] =
405 $this->skin
->tooltip( $xmlID );
407 $nav[$section][$key]['key'] =
408 $this->skin
->tooltipAndAccesskey( $xmlID );
412 $this->data
['namespace_urls'] = $nav['namespaces'];
413 $this->data
['view_urls'] = $nav['views'];
414 $this->data
['action_urls'] = $nav['actions'];
415 $this->data
['variant_urls'] = $nav['variants'];
416 // Build additional attributes for personal_urls
417 foreach ( $this->data
['personal_urls'] as $key => $item) {
418 $this->data
['personal_urls'][$key]['attributes'] =
419 ' id="' . Sanitizer
::escapeId( "pt-$key" ) . '"';
420 if ( isset( $item['active'] ) && $item['active'] ) {
421 $this->data
['personal_urls'][$key]['attributes'] .=
424 $this->data
['personal_urls'][$key]['key'] =
425 $this->skin
->tooltipAndAccesskey('pt-'.$key);
428 // Generate additional footer links
429 $footerlinks = array(
433 'numberofwatchingusers',
444 // Reduce footer links down to only those which are being used
445 $validFooterLinks = array();
446 foreach( $footerlinks as $category => $links ) {
447 $validFooterLinks[$category] = array();
448 foreach( $links as $link ) {
449 if( isset( $this->data
[$link] ) && $this->data
[$link] ) {
450 $validFooterLinks[$category][] = $link;
454 // Reverse horizontally rendered navigation elements
455 if ( $wgContLang->isRTL() ) {
456 $this->data
['view_urls'] =
457 array_reverse( $this->data
['view_urls'] );
458 $this->data
['namespace_urls'] =
459 array_reverse( $this->data
['namespace_urls'] );
460 $this->data
['personal_urls'] =
461 array_reverse( $this->data
['personal_urls'] );
464 $this->html( 'headelement' );
466 <div id
="page-base" class="noprint"></div
>
467 <div id
="head-base" class="noprint"></div
>
469 <div id
="content" <?php
$this->html('specialpageattributes') ?
>>
471 <div id
="mw-js-message" style
="display:none;"<?php
$this->html('userlangattributes') ?
>></div
>
472 <?php
if ( $this->data
['sitenotice'] ): ?
>
474 <div id
="siteNotice"><?php
$this->html( 'sitenotice' ) ?
></div
>
477 <!-- firstHeading
-->
478 <h1 id
="firstHeading" class="firstHeading"><?php
$this->html( 'title' ) ?
></h1
>
479 <!-- /firstHeading
-->
481 <div id
="bodyContent">
483 <h3 id
="siteSub"><?php
$this->msg( 'tagline' ) ?
></h3
>
486 <div id
="contentSub"<?php
$this->html('userlangattributes') ?
>><?php
$this->html( 'subtitle' ) ?
></div
>
488 <?php
if ( $this->data
['undelete'] ): ?
>
490 <div id
="contentSub2"><?php
$this->html( 'undelete' ) ?
></div
>
493 <?php
if($this->data
['newtalk'] ): ?
>
495 <div
class="usermessage"><?php
$this->html( 'newtalk' ) ?
></div
>
498 <?php
if ( $this->data
['showjumplinks'] ): ?
>
500 <div id
="jump-to-nav">
501 <?php
$this->msg( 'jumpto' ) ?
><a href
="#head"><?php
$this->msg( 'jumptonavigation' ) ?
></a
>,
502 <a href
="#p-search"><?php
$this->msg( 'jumptosearch' ) ?
></a
>
507 <?php
$this->html( 'bodytext' ) ?
>
509 <?php
if ( $this->data
['catlinks'] ): ?
>
511 <?php
$this->html( 'catlinks' ); ?
>
514 <?php
if ( $this->data
['dataAfterContent'] ): ?
>
515 <!-- dataAfterContent
-->
516 <?php
$this->html( 'dataAfterContent' ); ?
>
517 <!-- /dataAfterContent
-->
519 <div
class="visualClear"></div
>
521 <!-- /bodyContent
-->
525 <div id
="head" class="noprint">
526 <?php
$this->renderNavigation( 'PERSONAL' ); ?
>
527 <div id
="left-navigation">
528 <?php
$this->renderNavigation( array( 'NAMESPACES', 'VARIANTS' ) ); ?
>
530 <div id
="right-navigation">
531 <?php
$this->renderNavigation( array( 'VIEWS', 'ACTIONS', 'SEARCH' ) ); ?
>
536 <div id
="panel" class="noprint">
538 <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
>
540 <?php
$this->renderPortals( $this->data
['sidebar'] ); ?
>
544 <div id
="footer"<?php
$this->html('userlangattributes') ?
>>
545 <?php
foreach( $validFooterLinks as $category => $links ): ?
>
546 <?php
if ( count( $links ) > 0 ): ?
>
547 <ul id
="footer-<?php echo $category ?>">
548 <?php
foreach( $links as $link ): ?
>
549 <?php
if( isset( $this->data
[$link] ) && $this->data
[$link] ): ?
>
550 <li id
="footer-<?php echo $category ?>-<?php echo $link ?>"><?php
$this->html( $link ) ?
></li
>
556 <ul id
="footer-icons" class="noprint">
557 <?php
if ( $this->data
['poweredbyico'] ): ?
>
558 <li id
="footer-icon-poweredby"><?php
$this->html( 'poweredbyico' ) ?
></li
>
560 <?php
if ( $this->data
['copyrightico'] ): ?
>
561 <li id
="footer-icon-copyright"><?php
$this->html( 'copyrightico' ) ?
></li
>
564 <div style
="clear:both"></div
>
568 <script type
="<?php $this->text('jsmimetype') ?>"> if ( window
.isMSIE55
) fixalpha(); </script
>
570 <?php
$this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?
>
571 <?php
$this->html( 'reporttime' ) ?
>
572 <?php
if ( $this->data
['debug'] ): ?
>
573 <!-- Debug output
: <?php
$this->text( 'debug' ); ?
> -->
581 * Render a series of portals
583 private function renderPortals( $portals ) {
584 // Force the rendering of the following portals
585 if ( !isset( $portals['SEARCH'] ) ) $portals['SEARCH'] = true;
586 if ( !isset( $portals['TOOLBOX'] ) ) $portals['TOOLBOX'] = true;
587 if ( !isset( $portals['LANGUAGES'] ) ) $portals['LANGUAGES'] = true;
589 foreach ( $portals as $name => $content ) {
590 echo "\n<!-- {$name} -->\n";
596 <div
class="portal" id
="p-tb">
597 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$this->msg( 'toolbox' ) ?
></h5
>
600 <?php
if( $this->data
['notspecialpage'] ): ?
>
601 <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
>
602 <?php
if( $this->data
['nav_urls']['recentchangeslinked'] ): ?
>
603 <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
>
606 <?php
if( isset( $this->data
['nav_urls']['trackbacklink'] ) ): ?
>
607 <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
>
609 <?php
if( $this->data
['feeds']): ?
>
611 <?php
foreach( $this->data
['feeds'] as $key => $feed ): ?
>
612 <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
>
616 <?php
foreach( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages' ) as $special ): ?
>
617 <?php
if( $this->data
['nav_urls'][$special]): ?
>
618 <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
>
621 <?php
if( !empty( $this->data
['nav_urls']['print']['href'] ) ): ?
>
622 <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
>
624 <?php
if ( !empty( $this->data
['nav_urls']['permalink']['href'] ) ): ?
>
625 <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
>
626 <?php
elseif ( $this->data
['nav_urls']['permalink']['href'] === '' ): ?
>
627 <li id
="t-ispermalink"<?php
echo $this->skin
->tooltip( 't-ispermalink' ) ?
>><?php
$this->msg( 'permalink' ) ?
></li
>
629 <?php
wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); ?
>
636 if ( $this->data
['language_urls'] ) {
638 <div
class="portal" id
="p-lang">
639 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$this->msg( 'otherlanguages' ) ?
></h5
>
642 <?php
foreach ( $this->data
['language_urls'] as $langlink ): ?
>
643 <li
class="<?php echo htmlspecialchars( $langlink['class'] ) ?>"><a href
="<?php echo htmlspecialchars( $langlink['href'] ) ?>"><?php
echo $langlink['text'] ?
></a
></li
>
653 <div
class="portal" id
='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php
echo $this->skin
->tooltip( 'p-' . $name ) ?
>>
654 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$out = wfMsg( $name ); if ( wfEmptyMsg( $name, $out ) ) echo htmlspecialchars( $name ); else echo htmlspecialchars( $out ); ?
></h5
>
656 <?php
if ( is_array( $content ) ): ?
>
658 <?php
foreach( $content as $key => $val ): ?
>
659 <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
>
663 <?php
echo $content; /* Allow raw HTML block to be defined by extensions */ ?
>
670 echo "\n<!-- /{$name} -->\n";
675 * Render one or more navigations elements by name, automatically reveresed
676 * when UI is in RTL mode
678 private function renderNavigation( $elements ) {
679 global $wgContLang, $wgVectorUseSimpleSearch, $wgStylePath;
681 // If only one element was given, wrap it in an array, allowing more
682 // flexible arguments
683 if ( !is_array( $elements ) ) {
684 $elements = array( $elements );
685 // If there's a series of elements, reverse them when in RTL mode
686 } else if ( $wgContLang->isRTL() ) {
687 $elements = array_reverse( $elements );
690 foreach ( $elements as $name => $element ) {
691 echo "\n<!-- {$name} -->\n";
692 switch ( $element ) {
695 <div id
="p-namespaces" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
696 <h5
><?php
$this->msg('namespaces') ?
></h5
>
697 <ul
<?php
$this->html('userlangattributes') ?
>>
698 <?php
foreach ($this->data
['namespace_urls'] as $key => $link ): ?
>
699 <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
>
707 <div id
="p-variants" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
708 <h5
><span
><?php
$this->msg('variants') ?
></span
><a href
="#"></a
></h5
>
710 <ul
<?php
$this->html('userlangattributes') ?
>>
711 <?php
foreach ($this->data
['variant_urls'] as $key => $link ): ?
>
712 <li
<?php
echo $link['attributes'] ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></li
>
721 <div id
="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
722 <h5
><?php
$this->msg('views') ?
></h5
>
723 <ul
<?php
$this->html('userlangattributes') ?
>>
724 <?php
foreach ($this->data
['view_urls'] as $key => $link ): ?
>
725 <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
>
733 <div id
="p-cactions" class="vectorMenu<?php if ( count( $this->data['action_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
734 <h5
><span
><?php
$this->msg('actions') ?
></span
><a href
="#"></a
></h5
>
736 <ul
<?php
$this->html('userlangattributes') ?
>>
737 <?php
foreach ($this->data
['action_urls'] as $key => $link ): ?
>
738 <li
<?php
echo $link['attributes'] ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></li
>
747 <div id
="p-personal" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
748 <h5
><?php
$this->msg('personaltools') ?
></h5
>
749 <ul
<?php
$this->html('userlangattributes') ?
>>
750 <?php
foreach($this->data
['personal_urls'] as $key => $item): ?
>
751 <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
>
760 <h5
<?php
$this->html('userlangattributes') ?
>><label
for="searchInput"><?php
$this->msg( 'search' ) ?
></label
></h5
>
761 <form action
="<?php $this->text( 'wgScript' ) ?>" id
="searchform">
762 <input type
='hidden' name
="title" value
="<?php $this->text( 'searchtitle' ) ?>"/>
763 <?php
if ( $wgVectorUseSimpleSearch ): ?
>
764 <div id
="simpleSearch">
765 <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; ?
> />
766 <button id
="searchButton" type
='submit' name
='button' <?php
echo $this->skin
->tooltipAndAccesskey( 'search-fulltext' ); ?
>> 
;</button
>
769 <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; ?
> />
770 <input type
='submit' name
="go" class="searchButton" id
="searchGoButton" value
="<?php $this->msg( 'searcharticle' ) ?>"<?php
echo $this->skin
->tooltipAndAccesskey( 'search-go' ); ?
> />
771 <input type
="submit" name
="fulltext" class="searchButton" id
="mw-searchButton" value
="<?php $this->msg( 'searchbutton' ) ?>"<?php
echo $this->skin
->tooltipAndAccesskey( 'search-fulltext' ); ?
> />
779 echo "\n<!-- /{$name} -->\n";