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 "/{$this->stylename}/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( "{$this->stylename}/main-rtl.css", 'screen', '', 'rtl' );
56 $out->addStyle( "{$this->stylename}/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";
107 // Adds namespace links
108 $links['namespaces'][$subjectId] = $this->tabAction(
109 $subjectPage, 'nstab-' . $subjectId, !$isTalk, '', true
111 $links['namespaces'][$subjectId]['context'] = 'subject';
112 $links['namespaces'][$talkId] = $this->tabAction(
113 $talkPage, 'nstab-talk', $isTalk, '', true
115 $links['namespaces'][$talkId]['context'] = 'talk';
117 // Adds view view link
118 if ( $this->mTitle
->exists() ) {
119 $links['views']['view'] = $this->tabAction(
120 $isTalk ?
$talkPage : $subjectPage,
121 'vector-view-view', ( $action == 'view' ), '', true
125 wfProfileIn( __METHOD__
. '-edit' );
127 // Checks if user can...
129 // edit the current page
130 $this->mTitle
->quickUserCan( 'edit' ) &&
133 $this->mTitle
->exists() ||
134 // or they can create one here
135 $this->mTitle
->quickUserCan( 'create' )
138 // Builds CSS class for talk page links
139 $isTalkClass = $isTalk ?
' istalk' : '';
141 // Determines if we're in edit mode
143 ( $action == 'edit' ||
$action == 'submit' ) &&
144 ( $section != 'new' )
146 $links['views']['edit'] = array(
147 'class' => ( $selected ?
'selected' : '' ) . $isTalkClass,
148 'text' => $this->mTitle
->exists()
149 ?
wfMsg( 'vector-view-edit' )
150 : wfMsg( 'vector-view-create' ),
152 $this->mTitle
->getLocalURL( $this->editUrlOptions() )
154 // Checks if this is a current rev of talk page and we should show a new
156 if ( ( $isTalk && $wgArticle->isCurrent() ) ||
( $wgOut->showNewSectionLink() ) ) {
157 // Checks if we should ever show a new section link
158 if ( !$wgOut->forceHideNewSectionLink() ) {
159 // Adds new section link
160 //$links['actions']['addsection']
161 $links['views']['addsection'] = array(
162 'class' => 'collapsible ' . ( $section == 'new' ?
'selected' : false ),
163 'text' => wfMsg( 'vector-action-addsection' ),
164 'href' => $this->mTitle
->getLocalURL(
165 'action=edit§ion=new'
170 // Checks if the page has some kind of viewable content
171 } elseif ( $this->mTitle
->hasSourceText() ) {
172 // Adds view source view link
173 $links['views']['viewsource'] = array(
174 'class' => ( $action == 'edit' ) ?
'selected' : false,
175 'text' => wfMsg( 'vector-view-viewsource' ),
177 $this->mTitle
->getLocalURL( $this->editUrlOptions() )
180 wfProfileOut( __METHOD__
. '-edit' );
182 wfProfileIn( __METHOD__
. '-live' );
184 // Checks if the page exists
185 if ( $this->mTitle
->exists() ) {
186 // Adds history view link
187 $links['views']['history'] = array(
188 'class' => 'collapsible ' . ( ( $action == 'history' ) ?
'selected' : false ),
189 'text' => wfMsg( 'vector-view-history' ),
190 'href' => $this->mTitle
->getLocalURL( 'action=history' ),
194 if( $wgUser->isAllowed( 'delete' ) ) {
195 $links['actions']['delete'] = array(
196 'class' => ( $action == 'delete' ) ?
'selected' : false,
197 'text' => wfMsg( 'vector-action-delete' ),
198 'href' => $this->mTitle
->getLocalURL( 'action=delete' )
201 if ( $this->mTitle
->quickUserCan( 'move' ) ) {
202 $moveTitle = SpecialPage
::getTitleFor(
203 'Movepage', $this->thispage
205 $links['actions']['move'] = array(
206 'class' => $this->mTitle
->isSpecial( 'Movepage' ) ?
208 'text' => wfMsg( 'vector-action-move' ),
209 'href' => $moveTitle->getLocalURL()
214 $this->mTitle
->getNamespace() !== NS_MEDIAWIKI
&&
215 $wgUser->isAllowed( 'protect' )
217 if ( !$this->mTitle
->isProtected() ) {
218 $links['actions']['protect'] = array(
219 'class' => ( $action == 'protect' ) ?
221 'text' => wfMsg( 'vector-action-protect' ),
223 $this->mTitle
->getLocalURL( 'action=protect' )
227 $links['actions']['unprotect'] = array(
228 'class' => ( $action == 'unprotect' ) ?
230 'text' => wfMsg( 'vector-action-unprotect' ),
232 $this->mTitle
->getLocalURL( 'action=unprotect' )
237 // article doesn't exist or is deleted
239 $wgUser->isAllowed( 'deletedhistory' ) &&
240 $wgUser->isAllowed( 'undelete' )
242 if( $n = $this->mTitle
->isDeleted() ) {
243 $undelTitle = SpecialPage
::getTitleFor( 'Undelete' );
244 $links['actions']['undelete'] = array(
247 'vector-action-undelete',
249 $wgLang->formatNum( $n )
251 'href' => $undelTitle->getLocalURL(
252 'target=' . urlencode( $this->thispage
)
259 $this->mTitle
->getNamespace() !== NS_MEDIAWIKI
&&
260 $wgUser->isAllowed( 'protect' )
262 if ( !$this->mTitle
->getRestrictions( 'create' ) ) {
263 $links['actions']['protect'] = array(
264 'class' => ( $action == 'protect' ) ?
266 'text' => wfMsg( 'vector-action-protect' ),
268 $this->mTitle
->getLocalURL( 'action=protect' )
272 $links['actions']['unprotect'] = array(
273 'class' => ( $action == 'unprotect' ) ?
275 'text' => wfMsg( 'vector-action-unprotect' ),
277 $this->mTitle
->getLocalURL( 'action=unprotect' )
282 wfProfileOut( __METHOD__
. '-live' );
284 * The following actions use messages which, if made particular to
285 * the Vector skin, would break the Ajax code which makes this
286 * action happen entirely inline. Skin::makeGlobalVariablesScript
287 * defines a set of messages in a javascript object - and these
288 * messages are assumed to be global for all skins. Without making
289 * a change to that procedure these messages will have to remain as
290 * the global versions.
292 // Checks if the user is logged in
293 if ( $this->loggedin
) {
294 if ( $wgVectorUseIconWatch ) {
301 $mode = $this->mTitle
->userIsWatching() ?
'unwatch' : 'watch';
302 $links[$place][$mode] = array(
303 'class' => $class . ( ( $action == 'watch' ||
$action == 'unwatch' ) ?
' selected' : false ),
304 'text' => wfMsg( $mode ), // uses 'watch' or 'unwatch' message
305 'href' => $this->mTitle
->getLocalURL( 'action=' . $mode )
308 // This is instead of SkinTemplateTabs - which uses a flat array
309 wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$links ) );
311 // If it's not content, it's got to be a special page
313 $links['namespaces']['special'] = array(
314 'class' => 'selected',
315 'text' => wfMsg( 'nstab-special' ),
316 'href' => $wgRequest->getRequestURL()
320 // Gets list of language variants
321 $variants = $wgContLang->getVariants();
322 // Checks that language conversion is enabled and variants exist
323 if( !$wgDisableLangConversion && count( $variants ) > 1 ) {
324 // Gets preferred variant
325 $preferred = $wgContLang->getPreferredVariant();
326 // Loops over each variant
327 foreach( $variants as $code ) {
328 // Gets variant name from language code
329 $varname = $wgContLang->getVariantname( $code );
330 // Checks if the variant is marked as disabled
331 if( $varname == 'disable' ) {
332 // Skips this variant
335 // Appends variant link
336 $links['variants'][] = array(
337 'class' => ( $code == $preferred ) ?
'selected' : false,
339 'href' => $this->mTitle
->getLocalURL( '', $code )
344 wfProfileOut( __METHOD__
);
351 * QuickTemplate class for Vector skin
354 class VectorTemplate
extends QuickTemplate
{
359 * @var Cached skin object
366 * Outputs the entire contents of the XHTML page
368 public function execute() {
369 global $wgRequest, $wgContLang;
371 $this->skin
= $this->data
['skin'];
372 $action = $wgRequest->getText( 'action' );
374 // Build additional attributes for navigation urls
375 $nav = $this->skin
->buildNavigationUrls();
376 foreach ( $nav as $section => $links ) {
377 foreach ( $links as $key => $link ) {
379 if ( isset( $link['context'] ) && $link['context'] == 'subject' ) {
380 $xmlID = 'ca-nstab-' . $xmlID;
381 } else if ( isset( $link['context'] ) && $link['context'] == 'talk' ) {
384 $xmlID = 'ca-' . $xmlID;
386 $nav[$section][$key]['attributes'] =
387 ' id="' . Sanitizer
::escapeId( $xmlID ) . '"';
388 if ( $nav[$section][$key]['class'] ) {
389 $nav[$section][$key]['attributes'] .=
390 ' class="' . htmlspecialchars( $link['class'] ) . '"';
391 unset( $nav[$section][$key]['class'] );
393 // We don't want to give the watch tab an accesskey if the page
394 // is being edited, because that conflicts with the accesskey on
395 // the watch checkbox. We also don't want to give the edit tab
396 // an accesskey, because that's fairly superfluous and conflicts
397 // with an accesskey (Ctrl-E) often used for editing in Safari.
399 in_array( $action, array( 'edit', 'submit' ) ) &&
400 in_array( $key, array( 'edit', 'watch', 'unwatch' ) )
402 $nav[$section][$key]['key'] =
403 $this->skin
->tooltip( $xmlID );
405 $nav[$section][$key]['key'] =
406 $this->skin
->tooltipAndAccesskey( $xmlID );
410 $this->data
['namespace_urls'] = $nav['namespaces'];
411 $this->data
['view_urls'] = $nav['views'];
412 $this->data
['action_urls'] = $nav['actions'];
413 $this->data
['variant_urls'] = $nav['variants'];
414 // Build additional attributes for personal_urls
415 foreach ( $this->data
['personal_urls'] as $key => $item) {
416 $this->data
['personal_urls'][$key]['attributes'] =
417 ' id="' . Sanitizer
::escapeId( "pt-$key" ) . '"';
418 if ( isset( $item['active'] ) && $item['active'] ) {
419 $this->data
['personal_urls'][$key]['attributes'] .=
422 $this->data
['personal_urls'][$key]['key'] =
423 $this->skin
->tooltipAndAccesskey('pt-'.$key);
426 // Generate additional footer links
427 $footerlinks = array(
431 'numberofwatchingusers',
446 $footerlinksClasses = array(
447 'icons' => array( 'noprint' )
450 // Reduce footer links down to only those which are being used
451 $validFooterLinks = array();
452 foreach( $footerlinks as $category => $links ) {
453 $validFooterLinks[$category] = array();
454 foreach( $links as $link ) {
455 if( isset( $this->data
[$link] ) && $this->data
[$link] ) {
456 $validFooterLinks[$category][] = $link;
460 // Reverse horizontally rendered navigation elements
461 if ( $wgContLang->isRTL() ) {
462 $this->data
['view_urls'] =
463 array_reverse( $this->data
['view_urls'] );
464 $this->data
['namespace_urls'] =
465 array_reverse( $this->data
['namespace_urls'] );
466 $this->data
['personal_urls'] =
467 array_reverse( $this->data
['personal_urls'] );
470 $this->html( 'headelement' );
472 <div id
="mw-page-base" class="noprint"></div
>
473 <div id
="mw-head-base" class="noprint"></div
>
475 <div id
="content"<?php
$this->html('specialpageattributes') ?
>>
477 <div id
="mw-js-message" style
="display:none;"<?php
$this->html('userlangattributes') ?
>></div
>
478 <?php
if ( $this->data
['sitenotice'] ): ?
>
480 <div id
="siteNotice"><?php
$this->html( 'sitenotice' ) ?
></div
>
483 <!-- firstHeading
-->
484 <h1 id
="firstHeading" class="firstHeading"><?php
$this->html( 'title' ) ?
></h1
>
485 <!-- /firstHeading
-->
487 <div id
="bodyContent">
489 <div id
="siteSub"><?php
$this->msg( 'tagline' ) ?
></div
>
492 <div id
="contentSub"<?php
$this->html('userlangattributes') ?
>><?php
$this->html( 'subtitle' ) ?
></div
>
494 <?php
if ( $this->data
['undelete'] ): ?
>
496 <div id
="contentSub2"><?php
$this->html( 'undelete' ) ?
></div
>
499 <?php
if($this->data
['newtalk'] ): ?
>
501 <div
class="usermessage"><?php
$this->html( 'newtalk' ) ?
></div
>
504 <?php
if ( $this->data
['showjumplinks'] ): ?
>
506 <div id
="jump-to-nav">
507 <?php
$this->msg( 'jumpto' ) ?
> <a href
="#mw-head"><?php
$this->msg( 'jumptonavigation' ) ?
></a
>,
508 <a href
="#p-search"><?php
$this->msg( 'jumptosearch' ) ?
></a
>
513 <?php
$this->html( 'bodytext' ) ?
>
515 <?php
if ( $this->data
['catlinks'] ): ?
>
517 <?php
$this->html( 'catlinks' ); ?
>
520 <?php
if ( $this->data
['dataAfterContent'] ): ?
>
521 <!-- dataAfterContent
-->
522 <?php
$this->html( 'dataAfterContent' ); ?
>
523 <!-- /dataAfterContent
-->
525 <div
class="visualClear"></div
>
527 <!-- /bodyContent
-->
531 <div id
="mw-head" class="noprint">
532 <?php
$this->renderNavigation( 'PERSONAL' ); ?
>
533 <div id
="left-navigation">
534 <?php
$this->renderNavigation( array( 'NAMESPACES', 'VARIANTS' ) ); ?
>
536 <div id
="right-navigation">
537 <?php
$this->renderNavigation( array( 'VIEWS', 'ACTIONS', 'SEARCH' ) ); ?
>
542 <div id
="mw-panel" class="noprint">
544 <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
>
546 <?php
$this->renderPortals( $this->data
['sidebar'] ); ?
>
550 <div id
="footer"<?php
$this->html('userlangattributes') ?
>>
551 <?php
foreach( $validFooterLinks as $category => $links ): ?
>
552 <?php
if ( count( $links ) > 0 ): ?
>
553 <ul id
="footer-<?php echo $category ?>"<?php
if (isset($footerlinksClasses[$category])) echo ' class="' . implode(" ", $footerlinksClasses[$category]) . '"'; ?
>>
554 <?php
foreach( $links as $link ): ?
>
555 <?php
if( isset( $this->data
[$link] ) && $this->data
[$link] ): ?
>
556 <li id
="footer-<?php echo $category ?>-<?php echo $link ?>"><?php
$this->html( $link ) ?
></li
>
562 <div style
="clear:both"></div
>
566 <script type
="<?php $this->text('jsmimetype') ?>"> if ( window
.isMSIE55
) fixalpha(); </script
>
568 <?php
$this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?
>
569 <?php
$this->html( 'reporttime' ) ?
>
570 <?php
if ( $this->data
['debug'] ): ?
>
571 <!-- Debug output
: <?php
$this->text( 'debug' ); ?
> -->
579 * Render a series of portals
581 private function renderPortals( $portals ) {
582 // Force the rendering of the following portals
583 if ( !isset( $portals['SEARCH'] ) ) $portals['SEARCH'] = true;
584 if ( !isset( $portals['TOOLBOX'] ) ) $portals['TOOLBOX'] = true;
585 if ( !isset( $portals['LANGUAGES'] ) ) $portals['LANGUAGES'] = true;
587 foreach ( $portals as $name => $content ) {
588 echo "\n<!-- {$name} -->\n";
594 <div
class="portal" id
="p-tb">
595 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$this->msg( 'toolbox' ) ?
></h5
>
598 <?php
if( $this->data
['notspecialpage'] ): ?
>
599 <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
>
600 <?php
if( $this->data
['nav_urls']['recentchangeslinked'] ): ?
>
601 <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
>
604 <?php
if( isset( $this->data
['nav_urls']['trackbacklink'] ) ): ?
>
605 <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
>
607 <?php
if( $this->data
['feeds']): ?
>
609 <?php
foreach( $this->data
['feeds'] as $key => $feed ): ?
>
610 <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
>
614 <?php
foreach( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages' ) as $special ): ?
>
615 <?php
if( $this->data
['nav_urls'][$special]): ?
>
616 <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
>
619 <?php
if( !empty( $this->data
['nav_urls']['print']['href'] ) ): ?
>
620 <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
>
622 <?php
if ( !empty( $this->data
['nav_urls']['permalink']['href'] ) ): ?
>
623 <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
>
624 <?php
elseif ( $this->data
['nav_urls']['permalink']['href'] === '' ): ?
>
625 <li id
="t-ispermalink"<?php
echo $this->skin
->tooltip( 't-ispermalink' ) ?
>><?php
$this->msg( 'permalink' ) ?
></li
>
627 <?php
wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); ?
>
634 if ( $this->data
['language_urls'] ) {
636 <div
class="portal" id
="p-lang">
637 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$this->msg( 'otherlanguages' ) ?
></h5
>
640 <?php
foreach ( $this->data
['language_urls'] as $langlink ): ?
>
641 <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
>
651 <div
class="portal" id
='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php
echo $this->skin
->tooltip( 'p-' . $name ) ?
>>
652 <h5
<?php
$this->html('userlangattributes') ?
>><?php
$out = wfMsg( $name ); if ( wfEmptyMsg( $name, $out ) ) echo htmlspecialchars( $name ); else echo htmlspecialchars( $out ); ?
></h5
>
654 <?php
if ( is_array( $content ) ): ?
>
656 <?php
foreach( $content as $key => $val ): ?
>
657 <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
>
661 <?php
echo $content; /* Allow raw HTML block to be defined by extensions */ ?
>
668 echo "\n<!-- /{$name} -->\n";
673 * Render one or more navigations elements by name, automatically reveresed
674 * when UI is in RTL mode
676 private function renderNavigation( $elements ) {
677 global $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser;
679 // If only one element was given, wrap it in an array, allowing more
680 // flexible arguments
681 if ( !is_array( $elements ) ) {
682 $elements = array( $elements );
683 // If there's a series of elements, reverse them when in RTL mode
684 } else if ( wfUILang()->isRTL() ) {
685 $elements = array_reverse( $elements );
688 foreach ( $elements as $name => $element ) {
689 echo "\n<!-- {$name} -->\n";
690 switch ( $element ) {
693 <div id
="p-namespaces" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
694 <h5
><?php
$this->msg('namespaces') ?
></h5
>
695 <ul
<?php
$this->html('userlangattributes') ?
>>
696 <?php
foreach ($this->data
['namespace_urls'] as $key => $link ): ?
>
697 <li
<?php
echo $link['attributes'] ?
>><span
><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></span
></li
>
705 <div id
="p-variants" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
706 <?php
if ( $wgVectorShowVariantName ): ?
>
708 <?php
foreach ( $this->data
['variant_urls'] as $key => $link ): ?
>
709 <?php
if ( stripos( $link['attributes'], 'selected' ) !== false ): ?
>
710 <?php
echo htmlspecialchars( $link['text'] ) ?
>
715 <h5
><span
><?php
$this->msg('variants') ?
></span
><a href
="#"></a
></h5
>
717 <ul
<?php
$this->html('userlangattributes') ?
>>
718 <?php
foreach ( $this->data
['variant_urls'] as $key => $link ): ?
>
719 <li
<?php
echo $link['attributes'] ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></li
>
728 <div id
="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
729 <h5
><?php
$this->msg('views') ?
></h5
>
730 <ul
<?php
$this->html('userlangattributes') ?
>>
731 <?php
foreach ( $this->data
['view_urls'] as $key => $link ): ?
>
732 <li
<?php
echo $link['attributes'] ?
>><span
><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'].'" />' : htmlspecialchars( $link['text'] ) ) ?
></a
></span
></li
>
740 <div id
="p-cactions" class="vectorMenu<?php if ( count( $this->data['action_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
741 <h5
><span
><?php
$this->msg('actions') ?
></span
><a href
="#"></a
></h5
>
743 <ul
<?php
$this->html('userlangattributes') ?
>>
744 <?php
foreach ($this->data
['action_urls'] as $key => $link ): ?
>
745 <li
<?php
echo $link['attributes'] ?
>><a href
="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php
echo $link['key'] ?
>><?php
echo htmlspecialchars( $link['text'] ) ?
></a
></li
>
754 <div id
="p-personal" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
755 <h5
><?php
$this->msg('personaltools') ?
></h5
>
756 <ul
<?php
$this->html('userlangattributes') ?
>>
757 <?php
foreach($this->data
['personal_urls'] as $key => $item): ?
>
758 <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
>
767 <h5
<?php
$this->html('userlangattributes') ?
>><label
for="searchInput"><?php
$this->msg( 'search' ) ?
></label
></h5
>
768 <form action
="<?php $this->text( 'wgScript' ) ?>" id
="searchform">
769 <input type
='hidden' name
="title" value
="<?php $this->text( 'searchtitle' ) ?>"/>
770 <?php
if ( $wgVectorUseSimpleSearch && $wgUser->getOption( 'vector-simplesearch' ) ): ?
>
771 <div id
="simpleSearch">
772 <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; ?
> />
773 <button id
="searchButton" type
='submit' name
='button' <?php
echo $this->skin
->tooltipAndAccesskey( 'search-fulltext' ); ?
>><img src
="<?php echo $GLOBALS['wgStylePath'] . "/{$this->skin
->stylename
}/images
/search
-" . ( $GLOBALS['wgContLang']->isRTL() ? 'rtl' : 'ltr' ) . '.png?' . $GLOBALS['wgStyleVersion'] ?>" alt
="<?php $this->msg( 'searchbutton' ) ?>" /></button
>
776 <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; ?
> />
777 <input type
='submit' name
="go" class="searchButton" id
="searchGoButton" value
="<?php $this->msg( 'searcharticle' ) ?>"<?php
echo $this->skin
->tooltipAndAccesskey( 'search-go' ); ?
> />
778 <input type
="submit" name
="fulltext" class="searchButton" id
="mw-searchButton" value
="<?php $this->msg( 'searchbutton' ) ?>"<?php
echo $this->skin
->tooltipAndAccesskey( 'search-fulltext' ); ?
> />
786 echo "\n<!-- /{$name} -->\n";