c82da20099f62a8a50ab6c95d73bd37d8fa4fb46
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
{
23 * Initializes output page and sets up skin-specific parameters
24 * @param object $out Output page object to initialize
26 public function initPage( OutputPage
$out ) {
29 parent
::initPage( $out );
30 $this->skinname
= 'vector';
31 $this->stylename
= 'vector';
32 $this->template
= 'VectorTemplate';
34 // Append skin-specific styles
35 $out->addStyle( 'vector/main-rtl.css', 'screen', '', 'rtl' );
36 $out->addStyle( 'vector/main-ltr.css', 'screen', '', 'ltr' );
37 // Append CSS which includes IE only behavior fixes for hover support -
38 // this is better than including this in a CSS fille since it doesn't
39 // wait for the CSS file to load before fetching the HTC file.
41 '<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
43 '/vector/csshover.htc")}</style><![endif]-->'
47 * Builds a structured array of links used for tabs and menus
51 function buildNavigationUrls() {
52 global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle;
53 global $wgDisableLangConversion;
55 wfProfileIn( __METHOD__
);
58 'namespaces' => array(),
65 $action = $wgRequest->getVal( 'action', 'view' );
66 $section = $wgRequest->getVal( 'section' );
68 // Checks if page is some kind of content
69 if( $this->iscontent
) {
71 // Gets page objects for the related namespaces
72 $subjectPage = $this->mTitle
->getSubjectPage();
73 $talkPage = $this->mTitle
->getTalkPage();
75 // Determines if this is a talk page
76 $isTalk = $this->mTitle
->isTalkPage();
78 // Generates XML IDs from namespace names
79 $subjectId = $this->mTitle
->getNamespaceKey( '' );
81 if ( $subjectId == 'main' ) {
84 $talkId = "{$subjectId}_talk";
86 $currentId = $isTalk ?
$talkId : $subjectId;
88 // Adds namespace links
89 $links['namespaces'][$subjectId] = $this->tabAction(
90 $subjectPage, 'vector-namespace-' . $subjectId, !$isTalk, '', true
92 $links['namespaces'][$subjectId]['context'] = 'subject';
93 $links['namespaces'][$talkId] = $this->tabAction(
94 $talkPage, 'vector-namespace-talk', $isTalk, '', true
96 $links['namespaces'][$talkId]['context'] = 'talk';
98 // Adds view view link
99 if ( $this->mTitle
->exists() ) {
100 $links['views']['view'] = $this->tabAction(
101 $isTalk ?
$talkPage : $subjectPage,
102 'vector-view-view', ( $action == 'view' ), '', true
106 wfProfileIn( __METHOD__
. '-edit' );
108 // Checks if user can...
110 // edit the current page
111 $this->mTitle
->quickUserCan( 'edit' ) &&
114 $this->mTitle
->exists() ||
115 // or they can create one here
116 $this->mTitle
->quickUserCan( 'create' )
119 // Builds CSS class for talk page links
120 $isTalkClass = $isTalk ?
' istalk' : '';
122 // Determines if we're in edit mode
124 ( $action == 'edit' ||
$action == 'submit' ) &&
125 ( $section != 'new' )
127 $links['views']['edit'] = array(
128 'class' => ( $selected ?
'selected' : '' ) . $isTalkClass,
129 'text' => $this->mTitle
->exists()
130 ?
wfMsg( 'vector-view-edit' )
131 : wfMsg( 'vector-view-create' ),
133 $this->mTitle
->getLocalUrl( $this->editUrlOptions() )
135 // Checks if this is a current rev of talk page and we should show a new
137 if ( ( $isTalk && $wgArticle->isCurrent() ) ||
( $wgOut->showNewSectionLink() ) ) {
138 // Checks if we should ever show a new section link
139 if ( !$wgOut->forceHideNewSectionLink() ) {
140 // Adds new section link
141 $links['actions']['addsection'] = array(
142 'class' => $section == 'new' ?
'selected' : false,
143 'text' => wfMsg( 'vector-action-addsection' ),
144 'href' => $this->mTitle
->getLocalUrl(
145 'action=edit§ion=new'
150 // Checks if the page is known (some kind of viewable content)
151 } elseif ( $this->mTitle
->isKnown() ) {
152 // Adds view source view link
153 $links['views']['viewsource'] = array(
154 'class' => ( $action == 'edit' ) ?
'selected' : false,
155 'text' => wfMsg( 'vector-view-viewsource' ),
157 $this->mTitle
->getLocalUrl( $this->editUrlOptions() )
160 wfProfileOut( __METHOD__
. '-edit' );
162 wfProfileIn( __METHOD__
. '-live' );
164 // Checks if the page exists
165 if ( $this->mTitle
->exists() ) {
166 // Adds history view link
167 $links['views']['history'] = array(
168 'class' => ($action == 'history') ?
'selected' : false,
169 'text' => wfMsg( 'vector-view-history' ),
170 'href' => $this->mTitle
->getLocalUrl( 'action=history' ),
174 if( $wgUser->isAllowed( 'delete' ) ) {
175 $links['actions']['delete'] = array(
176 'class' => ($action == 'delete') ?
'selected' : false,
177 'text' => wfMsg( 'vector-action-delete' ),
178 'href' => $this->mTitle
->getLocalUrl( 'action=delete' )
181 if ( $this->mTitle
->quickUserCan( 'move' ) ) {
182 $moveTitle = SpecialPage
::getTitleFor(
183 'Movepage', $this->thispage
185 $links['actions']['move'] = array(
186 'class' => $this->mTitle
->isSpecial( 'Movepage' ) ?
188 'text' => wfMsg( 'vector-action-move' ),
189 'href' => $moveTitle->getLocalUrl()
194 $this->mTitle
->getNamespace() !== NS_MEDIAWIKI
&&
195 $wgUser->isAllowed( 'protect' )
197 if ( !$this->mTitle
->isProtected() ){
198 $links['actions']['protect'] = array(
199 'class' => ($action == 'protect') ?
201 'text' => wfMsg( 'vector-action-protect' ),
203 $this->mTitle
->getLocalUrl( 'action=protect' )
207 $links['actions']['unprotect'] = array(
208 'class' => ($action == 'unprotect') ?
210 'text' => wfMsg( 'vector-action-unprotect' ),
212 $this->mTitle
->getLocalUrl( 'action=unprotect' )
217 // article doesn't exist or is deleted
219 $wgUser->isAllowed( 'deletedhistory' ) &&
220 $wgUser->isAllowed( 'undelete' )
222 if( $n = $this->mTitle
->isDeleted() ) {
223 $undelTitle = SpecialPage
::getTitleFor( 'Undelete' );
224 $links['actions']['undelete'] = array(
227 'vector-action-undelete',
229 $wgLang->formatNum( $n )
231 'href' => $undelTitle->getLocalUrl(
232 'target=' . urlencode( $this->thispage
)
239 $this->mTitle
->getNamespace() !== NS_MEDIAWIKI
&&
240 $wgUser->isAllowed( 'protect' )
242 if ( !$this->mTitle
->getRestrictions( 'create' ) ) {
243 $links['actions']['protect'] = array(
244 'class' => ($action == 'protect') ?
246 'text' => wfMsg( 'vector-action-protect' ),
248 $this->mTitle
->getLocalUrl( 'action=protect' )
252 $links['actions']['unprotect'] = array(
253 'class' => ($action == 'unprotect') ?
255 'text' => wfMsg( 'vector-action-unprotect' ),
257 $this->mTitle
->getLocalUrl( 'action=unprotect' )
262 wfProfileOut( __METHOD__
. '-live' );
265 * The following actions use messages which, if made particular to
266 * the Vector skin, would break the Ajax code which makes this
267 * action happen entirely inline. Skin::makeGlobalVariablesScript
268 * defines a set of messages in a javascript object - and these
269 * messages are assumed to be global for all skins. Without making
270 * a change to that procedure these messages will have to remain as
271 * the global versions.
273 // Checks if the user is logged in
274 if( $this->loggedin
) {
275 // Checks if the user is watching this page
276 if( !$this->mTitle
->userIsWatching() ) {
277 // Adds watch action link
278 $links['actions']['watch'] = array(
280 ( $action == 'watch' or $action == 'unwatch' ) ?
282 'text' => wfMsg( 'watch' ),
283 'href' => $this->mTitle
->getLocalUrl( 'action=watch' )
286 // Adds unwatch action link
287 $links['actions']['unwatch'] = array(
289 ($action == 'unwatch' or $action == 'watch') ?
291 'text' => wfMsg( 'unwatch' ),
292 'href' => $this->mTitle
->getLocalUrl( 'action=unwatch' )
297 // This is instead of SkinTemplateTabs - which uses a flat array
298 wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$links ) );
300 // If it's not content, it's got to be a special page
302 $links['namespaces']['special'] = array(
303 'class' => 'selected',
304 'text' => wfMsg( 'vector-namespace-special' ),
305 'href' => $wgRequest->getRequestURL()
309 // Gets list of language variants
310 $variants = $wgContLang->getVariants();
311 // Checks that language conversion is enabled and variants exist
312 if( !$wgDisableLangConversion && count( $variants ) > 1 ) {
313 // Gets preferred variant
314 $preferred = $wgContLang->getPreferredVariant();
315 // Loops over each variant
316 foreach( $variants as $code ) {
317 // Gets variant name from language code
318 $varname = $wgContLang->getVariantname( $code );
319 // Checks if the variant is marked as disabled
320 if( $varname == 'disable' ) {
321 // Skips this variant
324 // Appends variant link
325 $links['variants'][] = array(
326 'class' => ( $code == $preferred ) ?
'selected' : false,
328 'href' => $this->mTitle
->getLocalURL( '', $code )
333 wfProfileOut( __METHOD__
);
340 * QuickTemplate class for Vector skin
343 class VectorTemplate
extends QuickTemplate
{
348 * @var Cached skin object
355 * Outputs the entire contents of the XHTML page
357 public function execute() {
358 global $wgRequest, $wgOut, $wgContLang;
360 $this->skin
= $this->data
['skin'];
361 $action = $wgRequest->getText( 'action' );
363 // Suppress warnings to prevent notices about missing indexes in
364 // $this->data (is this really the best way to handle this?)
365 wfSuppressWarnings();
367 // Build additional attributes for navigation urls
368 $nav = $this->skin
->buildNavigationUrls();
369 foreach ( $nav as $section => $links ) {
370 foreach ( $links as $key => $link ) {
372 if ( isset( $link['context'] ) && $link['context'] == 'subject' ) {
373 $xmlID = 'ca-nstab-' . $xmlID;
374 } else if ( isset( $link['context'] ) && $link['context'] == 'talk' ) {
377 $xmlID = 'ca-' . $xmlID;
379 $nav[$section][$key]['attributes'] =
380 ' id="' . Sanitizer
::escapeId( $xmlID ) . '"';
381 if ( $nav[$section][$key]['class'] ) {
382 $nav[$section][$key]['attributes'] .=
383 ' class="' . htmlspecialchars( $link['class'] ) . '"';
384 unset( $nav[$section][$key]['class'] );
386 // We don't want to give the watch tab an accesskey if the page
387 // is being edited, because that conflicts with the accesskey on
388 // the watch checkbox. We also don't want to give the edit tab
389 // an accesskey, because that's fairly superfluous and conflicts
390 // with an accesskey (Ctrl-E) often used for editing in Safari.
392 in_array( $action, array( 'edit', 'submit' ) ) &&
393 in_array( $key, array( 'edit', 'watch', 'unwatch' ) )
395 $nav[$section][$key]['key'] =
396 $this->skin
->tooltip( $xmlID );
398 $nav[$section][$key]['key'] =
399 $this->skin
->tooltipAndAccesskey( $xmlID );
403 $this->data
['namespace_urls'] = $nav['namespaces'];
404 $this->data
['view_urls'] = $nav['views'];
405 $this->data
['action_urls'] = $nav['actions'];
406 $this->data
['variant_urls'] = $nav['variants'];
407 // Build additional attributes for personal_urls
408 foreach ( $this->data
['personal_urls'] as $key => $item) {
409 $this->data
['personal_urls'][$key]['attributes'] =
410 ' id="' . Sanitizer
::escapeId( "pt-$key" ) . '"';
411 if ( $item['active'] ) {
412 $this->data
['personal_urls'][$key]['attributes'] .=
415 $this->data
['personal_urls'][$key]['key'] =
416 $this->skin
->tooltipAndAccesskey('pt-'.$key);
419 // Generate additional footer links
420 $footerlinks = array(
424 'numberofwatchingusers',
435 // Reduce footer links down to only those which are being used
436 $validFooterLinks = array();
437 foreach( $footerlinks as $category => $links ) {
438 $validFooterLinks[$category] = array();
439 foreach( $links as $link ) {
440 if( isset( $this->data
[$link] ) && $this->data
[$link] ) {
441 $validFooterLinks[$category][] = $link;
445 // Reverse horizontally rendered navigation elements
446 if ( $wgContLang->isRTL() ) {
447 $this->data
['view_urls'] =
448 array_reverse( $this->data
['view_urls'] );
449 $this->data
['namespace_urls'] =
450 array_reverse( $this->data
['namespace_urls'] );
451 $this->data
['personal_urls'] =
452 array_reverse( $this->data
['personal_urls'] );
455 echo $wgOut->headElement( $this->skin
);
457 <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' ) ?>">
458 <div id
="page-base" class="noprint"></div
>
459 <div id
="head-base" class="noprint"></div
>
463 <div id
="mw-js-message" style
="display:none;"></div
>
464 <?php
if ( $this->data
['sitenotice'] ): ?
>
466 <div id
="siteNotice"><?php
$this->html( 'sitenotice' ) ?
></div
>
469 <!-- firstHeading
-->
470 <h1 id
="firstHeading" class="firstHeading"><?php
$this->html( 'title' ) ?
></h1
>
471 <!-- /firstHeading
-->
473 <div id
="bodyContent">
475 <h3 id
="siteSub"><?php
$this->msg( 'tagline' ) ?
></h3
>
478 <div id
="contentSub"><?php
$this->html( 'subtitle' ) ?
></div
>
480 <?php
if ( $this->data
['undelete'] ): ?
>
482 <div id
="contentSub2"><?php
$this->html( 'undelete' ) ?
></div
>
485 <?php
if($this->data
['newtalk'] ): ?
>
487 <div
class="usermessage"><?php
$this->html( 'newtalk' ) ?
></div
>
490 <?php
if ( $this->data
['showjumplinks'] ): ?
>
492 <div id
="jump-to-nav">
493 <?php
$this->msg( 'jumpto' ) ?
><a href
="#head"><?php
$this->msg( 'jumptonavigation' ) ?
></a
>,
494 <a href
="#search"><?php
$this->msg( 'jumptosearch' ) ?
></a
>
499 <?php
$this->html( 'bodytext' ) ?
>
501 <?php
if ( $this->data
['catlinks'] ): ?
>
503 <?php
$this->html( 'catlinks' ); ?
>
506 <?php
if ( $this->data
['dataAfterContent'] ): ?
>
507 <!-- dataAfterContent
-->
508 <?php
$this->html( 'dataAfterContent' ); ?
>
509 <!-- /dataAfterContent
-->
511 <div
class="visualClear"></div
>
513 <!-- /bodyContent
-->
517 <div id
="head" class="noprint">
518 <?php
$this->renderNavigation( 'PERSONAL' ); ?
>
519 <div id
="left-navigation">
520 <?php
$this->renderNavigation( array( 'NAMESPACES', 'VARIANTS' ) ); ?
>
522 <div id
="right-navigation">
523 <?php
$this->renderNavigation( array( 'VIEWS', 'ACTIONS', 'SEARCH' ) ); ?
>
528 <div id
="panel" class="noprint">
529 <?php
$this->renderPortals( $this->data
['sidebar'] ); ?
>
534 <?php
foreach( $validFooterLinks as $category => $links ): ?
>
535 <?php
if ( count( $links ) > 0 ): ?
>
536 <ul id
="foot-<?php echo $category ?>">
537 <?php
foreach( $links as $link ): ?
>
538 <?php
if( isset( $this->data
[$link] ) && $this->data
[$link] ): ?
>
539 <li id
="foot-<?php echo $category ?>-<?php echo $link ?>"><?php
$this->html( $link ) ?
></li
>
545 <ul id
="foot-icons" class="noprint">
546 <?php
if ( $this->data
['poweredbyico'] ): ?
>
547 <li id
="foot-icon-poweredby"><?php
$this->html( 'poweredbyico' ) ?
></li
>
549 <?php
if ( $this->data
['copyrightico'] ): ?
>
550 <li id
="foot-icon-copyright"><?php
$this->html( 'copyrightico' ) ?
></li
>
553 <div style
="clear:both"></div
>
557 <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
>
560 <script type
="<?php $this->text('jsmimetype') ?>"> if ( window
.isMSIE55
) fixalpha(); </script
>
562 <?php
$this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?
>
563 <?php
$this->html( 'reporttime' ) ?
>
564 <?php
if ( $this->data
['debug'] ): ?
>
565 <!-- Debug output
: <?php
$this->text( 'debug' ); ?
> -->
570 // We're done with abusing arrays now...
575 * Render a series of portals
577 private function renderPortals( $portals ) {
578 // Force the rendering of the following portals
579 if ( !isset( $portals['SEARCH'] ) ) $portals['SEARCH'] = true;
580 if ( !isset( $portals['TOOLBOX'] ) ) $portals['TOOLBOX'] = true;
581 if ( !isset( $portals['LANGUAGES'] ) ) $portals['LANGUAGES'] = true;
583 foreach ( $portals as $name => $content ) {
584 echo "\n<!-- {$name} -->\n";
590 <div
class="portal" id
="p-tb">
591 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$this->msg( 'toolbox' ) ?
></h5
>
594 <?php
if( $this->data
['notspecialpage'] ): ?
>
595 <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
>
596 <?php
if( $this->data
['nav_urls']['recentchangeslinked'] ): ?
>
597 <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
>
600 <?php
if( isset( $this->data
['nav_urls']['trackbacklink'] ) ): ?
>
601 <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
>
603 <?php
if( $this->data
['feeds']): ?
>
605 <?php
foreach( $this->data
['feeds'] as $key => $feed ): ?
>
606 <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
>
610 <?php
foreach( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages' ) as $special ): ?
>
611 <?php
if( $this->data
['nav_urls'][$special]): ?
>
612 <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
>
615 <?php
if( !empty( $this->data
['nav_urls']['print']['href'] ) ): ?
>
616 <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
>
618 <?php
if ( !empty( $this->data
['nav_urls']['permalink']['href'] ) ): ?
>
619 <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
>
620 <?php
elseif ( $this->data
['nav_urls']['permalink']['href'] === '' ): ?
>
621 <li id
="t-ispermalink"<?php
echo $this->skin
->tooltip( 't-ispermalink' ) ?
>><?php
$this->msg( 'permalink' ) ?
></li
>
623 <?php
wfRunHooks( 'VectorTemplateToolboxEnd', array( &$this ) ); ?
>
624 <?php
wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); ?
>
631 if ( $this->data
['language_urls'] ) {
633 <div
class="portal" id
="p-lang">
634 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$this->msg( 'otherlanguages' ) ?
></h5
>
637 <?php
foreach ( $this->data
['language_urls'] as $langlink ): ?
>
638 <li
class="<?php echo htmlspecialchars( $langlink['class'] ) ?>"><a href
="<?php echo htmlspecialchars( $langlink['href'] ) ?>"><?php
echo $langlink['text'] ?
></a
></li
>
648 <div
class="portal" id
='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php
echo $this->skin
->tooltip( 'p-' . $name ) ?
>>
649 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$out = wfMsg( $name ); if ( wfEmptyMsg( $name, $out ) ) echo htmlspecialchars( $name ); else echo htmlspecialchars( $out ); ?
></h5
>
651 <?php
if ( is_array( $content ) ): ?
>
653 <?php
foreach( $content as $key => $val ): ?
>
654 <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
>
658 <?php
echo $content; /* Allow raw HTML block to be defined by extensions */ ?
>
665 echo "\n<!-- /{$name} -->\n";
670 * Render one or more navigations elements by name, automatically reveresed
671 * when UI is in RTL mode
673 private function renderNavigation( $elements ) {
674 global $wgContLang, $wgUseTwoButtonsSearchForm;
676 // If only one element was given, wrap it in an array, allowing more
677 // flexible arguments
678 if ( !is_array( $elements ) ) {
679 $elements = array( $elements );
680 // If there's a series of elements, reverse them when in RTL mode
681 } else if ( $wgContLang->isRTL() ) {
682 $elements = array_reverse( $elements );
685 foreach ( $elements as $name => $element ) {
686 echo "\n<!-- {$name} -->\n";
687 switch ( $element ) {
689 if ( count( $this->data
[ 'namespace_urls' ] ) > 0 ) {
691 <div id
="namespaces" class="vectorTabs">
692 <h5
><?php
$this->msg('namespaces') ?
></h5
>
693 <ul
<?php
$this->html('userlangattributes') ?
>>
694 <?php
foreach ($this->data
['namespace_urls'] as $key => $link ): ?
>
695 <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
>
703 if ( count( $this->data
[ 'variant_urls' ] ) > 0 ) {
705 <div id
="variants" class="vectorMenu">
706 <h5
><span
><?php
$this->msg('variants') ?
></span
><a href
="#"> 
;</a
></h5
>
708 <ul
<?php
$this->html('userlangattributes') ?
>>
709 <?php
foreach ($this->data
['variant_urls'] as $key => $link ): ?
>
710 <li
<?php
echo $link['attributes'] ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></li
>
719 if ( count( $this->data
[ 'view_urls' ] ) > 0 ) {
721 <div id
="views" class="vectorTabs">
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'] ?
>><span
><?php
echo htmlspecialchars( $link['text'] ) ?
></span
></a
></li
>
733 if ( count( $this->data
[ 'action_urls' ] ) > 0 ) {
735 <div id
="p-cactions" class="vectorMenu">
736 <h5
><span
><?php
$this->msg('actions') ?
></span
><a href
="#"> 
;</a
></h5
>
738 <ul
<?php
$this->html('userlangattributes') ?
>>
739 <?php
foreach ($this->data
['action_urls'] as $key => $link ): ?
>
740 <li
<?php
echo $link['attributes'] ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></li
>
749 if ( count( $this->data
['personal_urls'] ) > 0 ) {
751 <div id
="p-personal">
752 <h5
><?php
$this->msg('personaltools') ?
></h5
>
753 <ul
<?php
$this->html('userlangattributes') ?
>>
754 <?php
foreach($this->data
['personal_urls'] as $key => $item): ?
>
755 <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
>
765 <h5
<?php
$this->html('userlangattributes') ?
>><label
for="searchInput"><?php
$this->msg( 'search' ) ?
></label
></h5
>
766 <form action
="<?php $this->text( 'wgScript' ) ?>" id
="searchform">
767 <input type
='hidden' name
="title" value
="<?php $this->text( 'searchtitle' ) ?>"/>
768 <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; ?
> />
769 <input type
='submit' name
="go" class="searchButton" id
="searchGoButton" value
="<?php $this->msg( 'searcharticle' ) ?>"<?php
echo $this->skin
->tooltipAndAccesskey( 'search-go' ); ?
> />
770 <?php
if ( $wgUseTwoButtonsSearchForm ): ?
>
771 <input type
="submit" name
="fulltext" class="searchButton" id
="mw-searchButton" value
="<?php $this->msg( 'searchbutton' ) ?>"<?php
echo $this->skin
->tooltipAndAccesskey( 'search-fulltext' ); ?
> />
773 <div
><a href
="<?php $this->text( 'searchaction' ) ?>" rel
="search"><?php
$this->msg( 'powersearch-legend' ) ?
></a
></div
>
780 echo "\n<!-- /{$name} -->\n";