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, $wgRequest;
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.
37 $min = $wgRequest->getFuzzyBool( 'debug' ) ? '' : '.min';
38 $out->addHeadItem( 'csshover',
39 '<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
40 htmlspecialchars( $wgLocalStylePath ) .
41 "/{$this->stylename}/csshover{$min}.htc\")}</style><![endif]-->"
46 * Load skin and user CSS files in the correct order
48 * @param $out OutputPage object
50 function setupSkinUserCss( OutputPage $out ){
51 parent::setupSkinUserCss( $out );
52 $out->addModuleStyles( 'skins.vector' );
56 * Builds a structured array of links used for tabs and menus
60 function buildNavigationUrls() {
61 global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle;
62 global $wgDisableLangConversion, $wgVectorUseIconWatch;
64 wfProfileIn( __METHOD__ );
67 'namespaces' => array(),
74 $action = $wgRequest->getVal( 'action', 'view' );
75 $section = $wgRequest->getVal( 'section' );
77 $userCanRead = $this->mTitle->userCanRead();
79 // Checks if page is some kind of content
80 if( $this->iscontent ) {
81 // Gets page objects for the related namespaces
82 $subjectPage = $this->mTitle->getSubjectPage();
83 $talkPage = $this->mTitle->getTalkPage();
85 // Determines if this is a talk page
86 $isTalk = $this->mTitle->isTalkPage();
88 // Generates XML IDs from namespace names
89 $subjectId = $this->mTitle->getNamespaceKey( '' );
91 if ( $subjectId == 'main' ) {
94 $talkId = "{$subjectId}_talk";
97 // Adds namespace links
98 $links['namespaces'][$subjectId] = $this->tabAction(
99 $subjectPage, 'nstab-' . $subjectId, !$isTalk, '', $userCanRead
101 $links['namespaces'][$subjectId]['context'] = 'subject';
102 $links['namespaces'][$talkId] = $this->tabAction(
103 $talkPage, 'talk', $isTalk, '', $userCanRead
105 $links['namespaces'][$talkId]['context'] = 'talk';
107 // Adds view view link
108 if ( $this->mTitle->exists() && $userCanRead ) {
109 $links['views']['view'] = $this->tabAction(
110 $isTalk ? $talkPage : $subjectPage,
111 'vector-view-view', ( $action == 'view' || $action == 'purge' ), '', true
115 wfProfileIn( __METHOD__ . '-edit' );
117 // Checks if user can...
119 // read and edit the current page
120 $userCanRead && $this->mTitle->quickUserCan( 'edit' ) &&
123 $this->mTitle->exists() ||
124 // or they can create one here
125 $this->mTitle->quickUserCan( 'create' )
128 // Builds CSS class for talk page links
129 $isTalkClass = $isTalk ? ' istalk' : '';
131 // Determines if we're in edit mode
133 ( $action == 'edit' || $action == 'submit' ) &&
134 ( $section != 'new' )
136 $links['views']['edit'] = array(
137 'class' => ( $selected ? 'selected' : '' ) . $isTalkClass,
138 'text' => $this->mTitle->exists()
139 ? wfMsg( 'vector-view-edit' )
140 : wfMsg( 'vector-view-create' ),
142 $this->mTitle->getLocalURL( $this->editUrlOptions() )
144 // Checks if this is a current rev of talk page and we should show a new
146 if ( ( $isTalk && $wgArticle && $wgArticle->isCurrent() ) || ( $wgOut->showNewSectionLink() ) ) {
147 // Checks if we should ever show a new section link
148 if ( !$wgOut->forceHideNewSectionLink() ) {
149 // Adds new section link
150 //$links['actions']['addsection']
151 $links['views']['addsection'] = array(
152 'class' => 'collapsible ' . ( $section == 'new' ? 'selected' : false ),
153 'text' => wfMsg( 'vector-action-addsection' ),
154 'href' => $this->mTitle->getLocalURL(
155 'action=edit§ion=new'
160 // Checks if the page has some kind of viewable content
161 } elseif ( $this->mTitle->hasSourceText() && $userCanRead ) {
162 // Adds view source view link
163 $links['views']['viewsource'] = array(
164 'class' => ( $action == 'edit' ) ? 'selected' : false,
165 'text' => wfMsg( 'vector-view-viewsource' ),
167 $this->mTitle->getLocalURL( $this->editUrlOptions() )
170 wfProfileOut( __METHOD__ . '-edit' );
172 wfProfileIn( __METHOD__ . '-live' );
174 // Checks if the page exists
175 if ( $this->mTitle->exists() && $userCanRead ) {
176 // Adds history view link
177 $links['views']['history'] = array(
178 'class' => 'collapsible ' . ( ( $action == 'history' ) ? 'selected' : false ),
179 'text' => wfMsg( 'vector-view-history' ),
180 'href' => $this->mTitle->getLocalURL( 'action=history' ),
184 if( $wgUser->isAllowed( 'delete' ) ) {
185 $links['actions']['delete'] = array(
186 'class' => ( $action == 'delete' ) ? 'selected' : false,
187 'text' => wfMsg( 'vector-action-delete' ),
188 'href' => $this->mTitle->getLocalURL( 'action=delete' )
191 if ( $this->mTitle->quickUserCan( 'move' ) ) {
192 $moveTitle = SpecialPage::getTitleFor(
193 'Movepage', $this->thispage
195 $links['actions']['move'] = array(
196 'class' => $this->mTitle->isSpecial( 'Movepage' ) ?
198 'text' => wfMsg( 'vector-action-move' ),
199 'href' => $moveTitle->getLocalURL()
204 $this->mTitle->getNamespace() !== NS_MEDIAWIKI &&
205 $wgUser->isAllowed( 'protect' )
207 if ( !$this->mTitle->isProtected() ) {
208 $links['actions']['protect'] = array(
209 'class' => ( $action == 'protect' ) ?
211 'text' => wfMsg( 'vector-action-protect' ),
213 $this->mTitle->getLocalURL( 'action=protect' )
217 $links['actions']['unprotect'] = array(
218 'class' => ( $action == 'unprotect' ) ?
220 'text' => wfMsg( 'vector-action-unprotect' ),
222 $this->mTitle->getLocalURL( 'action=unprotect' )
227 // article doesn't exist or is deleted
229 $wgUser->isAllowed( 'deletedhistory' ) &&
230 $wgUser->isAllowed( 'undelete' )
232 $n = $this->mTitle->isDeleted();
234 $undelTitle = SpecialPage::getTitleFor( 'Undelete' );
235 $links['actions']['undelete'] = array(
238 'vector-action-undelete',
240 $wgLang->formatNum( $n )
242 'href' => $undelTitle->getLocalURL(
243 'target=' . urlencode( $this->thispage )
250 $this->mTitle->getNamespace() !== NS_MEDIAWIKI &&
251 $wgUser->isAllowed( 'protect' )
253 if ( !$this->mTitle->getRestrictions( 'create' ) ) {
254 $links['actions']['protect'] = array(
255 'class' => ( $action == 'protect' ) ?
257 'text' => wfMsg( 'vector-action-protect' ),
259 $this->mTitle->getLocalURL( 'action=protect' )
263 $links['actions']['unprotect'] = array(
264 'class' => ( $action == 'unprotect' ) ?
266 'text' => wfMsg( 'vector-action-unprotect' ),
268 $this->mTitle->getLocalURL( 'action=unprotect' )
273 wfProfileOut( __METHOD__ . '-live' );
275 * The following actions use messages which, if made particular to
276 * the Vector skin, would break the Ajax code which makes this
277 * action happen entirely inline. Skin::makeGlobalVariablesScript
278 * defines a set of messages in a javascript object - and these
279 * messages are assumed to be global for all skins. Without making
280 * a change to that procedure these messages will have to remain as
281 * the global versions.
283 // Checks if the user is logged in
284 if ( $this->loggedin ) {
285 if ( $wgVectorUseIconWatch ) {
292 $mode = $this->mTitle->userIsWatching() ? 'unwatch' : 'watch';
293 $links[$place][$mode] = array(
294 'class' => $class . ( ( $action == 'watch' || $action == 'unwatch' ) ? ' selected' : false ),
295 'text' => wfMsg( $mode ), // uses 'watch' or 'unwatch' message
296 'href' => $this->mTitle->getLocalURL( 'action=' . $mode )
299 // This is instead of SkinTemplateTabs - which uses a flat array
300 wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$links ) );
302 // If it's not content, it's got to be a special page
304 $links['namespaces']['special'] = array(
305 'class' => 'selected',
306 'text' => wfMsg( 'nstab-special' ),
307 'href' => $wgRequest->getRequestURL()
309 // Equiv to SkinTemplateBuildContentActionUrlsAfterSpecialPage
310 wfRunHooks( 'SkinTemplateNavigation::SpecialPage', array( &$this, &$links ) );
313 // Gets list of language variants
314 $variants = $wgContLang->getVariants();
315 // Checks that language conversion is enabled and variants exist
316 if( !$wgDisableLangConversion && count( $variants ) > 1 ) {
317 // Gets preferred variant
318 $preferred = $wgContLang->getPreferredVariant();
319 // Loops over each variant
320 foreach( $variants as $code ) {
321 // Gets variant name from language code
322 $varname = $wgContLang->getVariantname( $code );
323 // Checks if the variant is marked as disabled
324 if( $varname == 'disable' ) {
325 // Skips this variant
328 // Appends variant link
329 $links['variants'][] = array(
330 'class' => ( $code == $preferred ) ? 'selected' : false,
332 'href' => $this->mTitle->getLocalURL( '', $code )
337 // Equiv to SkinTemplateContentActions
338 wfRunHooks( 'SkinTemplateNavigation::Universal', array( &$this, &$links ) );
340 wfProfileOut( __METHOD__ );
347 * QuickTemplate class for Vector skin
350 class VectorTemplate extends QuickTemplate {
355 * @var Cached skin object
362 * Outputs the entire contents of the XHTML page
364 public function execute() {
365 global $wgRequest, $wgLang;
367 $this->skin = $this->data['skin'];
368 $action = $wgRequest->getText( 'action' );
370 // Build additional attributes for navigation urls
371 $nav = $this->skin->buildNavigationUrls();
372 foreach ( $nav as $section => $links ) {
373 foreach ( $links as $key => $link ) {
375 if ( isset( $link['context'] ) && $link['context'] == 'subject' ) {
376 $xmlID = 'ca-nstab-' . $xmlID;
377 } else if ( isset( $link['context'] ) && $link['context'] == 'talk' ) {
380 $xmlID = 'ca-' . $xmlID;
382 $nav[$section][$key]['attributes'] =
383 ' id="' . Sanitizer::escapeId( $xmlID ) . '"';
384 if ( $nav[$section][$key]['class'] ) {
385 $nav[$section][$key]['attributes'] .=
386 ' class="' . htmlspecialchars( $link['class'] ) . '"';
387 unset( $nav[$section][$key]['class'] );
389 // We don't want to give the watch tab an accesskey if the page
390 // is being edited, because that conflicts with the accesskey on
391 // the watch checkbox. We also don't want to give the edit tab
392 // an accesskey, because that's fairly superfluous and conflicts
393 // with an accesskey (Ctrl-E) often used for editing in Safari.
395 in_array( $action, array( 'edit', 'submit' ) ) &&
396 in_array( $key, array( 'edit', 'watch', 'unwatch' ) )
398 $nav[$section][$key]['key'] =
399 $this->skin->tooltip( $xmlID );
401 $nav[$section][$key]['key'] =
402 $this->skin->tooltipAndAccesskey( $xmlID );
406 $this->data['namespace_urls'] = $nav['namespaces'];
407 $this->data['view_urls'] = $nav['views'];
408 $this->data['action_urls'] = $nav['actions'];
409 $this->data['variant_urls'] = $nav['variants'];
410 // Build additional attributes for personal_urls
411 foreach ( $this->data['personal_urls'] as $key => $item) {
412 $this->data['personal_urls'][$key]['attributes'] =
413 ' id="' . Sanitizer::escapeId( "pt-$key" ) . '"';
414 if ( isset( $item['active'] ) && $item['active'] ) {
415 $this->data['personal_urls'][$key]['attributes'] .=
418 $this->data['personal_urls'][$key]['key'] =
419 $this->skin->tooltipAndAccesskey('pt-'.$key);
422 // Generate additional footer links
423 $footerlinks = $this->data["footerlinks"];
425 // Reduce footer links down to only those which are being used
426 $validFooterLinks = array();
427 foreach( $footerlinks as $category => $links ) {
428 $validFooterLinks[$category] = array();
429 foreach( $links as $link ) {
430 if( isset( $this->data[$link] ) && $this->data[$link] ) {
431 $validFooterLinks[$category][] = $link;
436 // Generate additional footer icons
437 $footericons = $this->data["footericons"];
438 // Unset any icons which don't have an image
439 foreach ( $footericons as $footerIconsKey => &$footerIconsBlock ) {
440 foreach ( $footerIconsBlock as $footerIconKey => $footerIcon ) {
441 if ( !is_string($footerIcon) && !isset($footerIcon["src"]) ) {
442 unset($footerIconsBlock[$footerIconKey]);
446 // Redo removal of any empty blocks
447 foreach ( $footericons as $footerIconsKey => &$footerIconsBlock ) {
448 if ( count($footerIconsBlock) <= 0 ) {
449 unset($footericons[$footerIconsKey]);
453 // Reverse horizontally rendered navigation elements
454 if ( $wgLang->isRTL() ) {
455 $this->data['view_urls'] =
456 array_reverse( $this->data['view_urls'] );
457 $this->data['namespace_urls'] =
458 array_reverse( $this->data['namespace_urls'] );
459 $this->data['personal_urls'] =
460 array_reverse( $this->data['personal_urls'] );
463 $this->html( 'headelement' );
465 <div id="mw-page-base" class="noprint"></div>
466 <div id="mw-head-base" class="noprint"></div>
468 <div id="content"<?php $this->html('specialpageattributes') ?>>
470 <div id="mw-js-message" style="display:none;"<?php $this->html('userlangattributes') ?>></div>
471 <?php if ( $this->data['sitenotice'] ): ?>
473 <div id="siteNotice"><?php $this->html( 'sitenotice' ) ?></div>
476 <!-- firstHeading -->
477 <h1 id="firstHeading" class="firstHeading"><?php $this->html( 'title' ) ?></h1>
478 <!-- /firstHeading -->
480 <div id="bodyContent">
482 <div id="siteSub"><?php $this->msg( 'tagline' ) ?></div>
485 <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html( 'subtitle' ) ?></div>
487 <?php if ( $this->data['undelete'] ): ?>
489 <div id="contentSub2"><?php $this->html( 'undelete' ) ?></div>
492 <?php if($this->data['newtalk'] ): ?>
494 <div class="usermessage"><?php $this->html( 'newtalk' ) ?></div>
497 <?php if ( $this->data['showjumplinks'] ): ?>
499 <div id="jump-to-nav">
500 <?php $this->msg( 'jumpto' ) ?> <a href="#mw-head"><?php $this->msg( 'jumptonavigation' ) ?></a>,
501 <a href="#p-search"><?php $this->msg( 'jumptosearch' ) ?></a>
506 <?php $this->html( 'bodytext' ) ?>
508 <?php if ( $this->data['catlinks'] ): ?>
510 <?php $this->html( 'catlinks' ); ?>
513 <?php if ( $this->data['dataAfterContent'] ): ?>
514 <!-- dataAfterContent -->
515 <?php $this->html( 'dataAfterContent' ); ?>
516 <!-- /dataAfterContent -->
518 <div class="visualClear"></div>
520 <!-- /bodyContent -->
524 <div id="mw-head" class="noprint">
525 <?php $this->renderNavigation( 'PERSONAL' ); ?>
526 <div id="left-navigation">
527 <?php $this->renderNavigation( array( 'NAMESPACES', 'VARIANTS' ) ); ?>
529 <div id="right-navigation">
530 <?php $this->renderNavigation( array( 'VIEWS', 'ACTIONS', 'SEARCH' ) ); ?>
535 <div id="mw-panel" class="noprint">
537 <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>
539 <?php $this->renderPortals( $this->data['sidebar'] ); ?>
543 <div id="footer"<?php $this->html('userlangattributes') ?>>
544 <?php foreach( $validFooterLinks as $category => $links ): ?>
545 <?php if ( count( $links ) > 0 ): ?>
546 <ul id="footer-<?php echo $category ?>">
547 <?php foreach( $links as $link ): ?>
548 <?php if( isset( $this->data[$link] ) && $this->data[$link] ): ?>
549 <li id="footer-<?php echo $category ?>-<?php echo $link ?>"><?php $this->html( $link ) ?></li>
555 <?php if ( count( $footericons ) > 0 ): ?>
556 <ul id="footer-icons" class="noprint">
557 <?php foreach ( $footericons as $blockName => $footerIcons ): ?>
558 <li id="footer-<?php echo htmlspecialchars($blockName); ?>ico">
559 <?php foreach ( $footerIcons as $icon ): ?>
560 <?php echo $this->skin->makeFooterIcon( $icon ); ?>
567 <div style="clear:both"></div>
570 <?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?>
572 <script type="<?php $this->text('jsmimetype') ?>"> if ( window.isMSIE55 ) fixalpha(); </script>
574 <?php $this->html( 'reporttime' ) ?>
575 <?php if ( $this->data['debug'] ): ?>
576 <!-- Debug output: <?php $this->text( 'debug' ); ?> -->
584 * Render a series of portals
586 private function renderPortals( $portals ) {
587 // Force the rendering of the following portals
588 if ( !isset( $portals['SEARCH'] ) ) $portals['SEARCH'] = true;
589 if ( !isset( $portals['TOOLBOX'] ) ) $portals['TOOLBOX'] = true;
590 if ( !isset( $portals['LANGUAGES'] ) ) $portals['LANGUAGES'] = true;
592 foreach ( $portals as $name => $content ) {
593 echo "\n<!-- {$name} -->\n";
599 <div class="portal" id="p-tb">
600 <h5<?php $this->html('userlangattributes') ?>><?php $this->msg( 'toolbox' ) ?></h5>
603 <?php if( $this->data['notspecialpage'] ): ?>
604 <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>
605 <?php if( $this->data['nav_urls']['recentchangeslinked'] ): ?>
606 <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>
609 <?php if( isset( $this->data['nav_urls']['trackbacklink'] ) ): ?>
610 <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>
612 <?php if( $this->data['feeds']): ?>
614 <?php foreach( $this->data['feeds'] as $key => $feed ): ?>
615 <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>
619 <?php foreach( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages' ) as $special ): ?>
620 <?php if( $this->data['nav_urls'][$special]): ?>
621 <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>
624 <?php if( !empty( $this->data['nav_urls']['print']['href'] ) ): ?>
625 <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>
627 <?php if ( !empty( $this->data['nav_urls']['permalink']['href'] ) ): ?>
628 <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>
629 <?php elseif ( $this->data['nav_urls']['permalink']['href'] === '' ): ?>
630 <li id="t-ispermalink"<?php echo $this->skin->tooltip( 't-ispermalink' ) ?>><?php $this->msg( 'permalink' ) ?></li>
632 <?php wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); ?>
639 if ( $this->data['language_urls'] ) {
641 <div class="portal" id="p-lang">
642 <h5<?php $this->html('userlangattributes') ?>><?php $this->msg( 'otherlanguages' ) ?></h5>
645 <?php foreach ( $this->data['language_urls'] as $langlink ): ?>
646 <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>
656 <div class="portal" id='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php echo $this->skin->tooltip( 'p-' . $name ) ?>>
657 <h5<?php $this->html('userlangattributes') ?>><?php $out = wfMsg( $name ); if ( wfEmptyMsg( $name, $out ) ) echo htmlspecialchars( $name ); else echo htmlspecialchars( $out ); ?></h5>
659 <?php if ( is_array( $content ) ): ?>
661 <?php foreach( $content as $val ): ?>
662 <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>
666 <?php echo $content; /* Allow raw HTML block to be defined by extensions */ ?>
673 echo "\n<!-- /{$name} -->\n";
678 * Render one or more navigations elements by name, automatically reveresed
679 * when UI is in RTL mode
681 private function renderNavigation( $elements ) {
682 global $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser;
684 // If only one element was given, wrap it in an array, allowing more
685 // flexible arguments
686 if ( !is_array( $elements ) ) {
687 $elements = array( $elements );
688 // If there's a series of elements, reverse them when in RTL mode
689 } else if ( wfUILang()->isRTL() ) {
690 $elements = array_reverse( $elements );
693 foreach ( $elements as $name => $element ) {
694 echo "\n<!-- {$name} -->\n";
695 switch ( $element ) {
698 <div id="p-namespaces" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
699 <h5><?php $this->msg('namespaces') ?></h5>
700 <ul<?php $this->html('userlangattributes') ?>>
701 <?php foreach ($this->data['namespace_urls'] as $link ): ?>
702 <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>
710 <div id="p-variants" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
711 <?php if ( $wgVectorShowVariantName ): ?>
713 <?php foreach ( $this->data['variant_urls'] as $link ): ?>
714 <?php if ( stripos( $link['attributes'], 'selected' ) !== false ): ?>
715 <?php echo htmlspecialchars( $link['text'] ) ?>
720 <h5><span><?php $this->msg('variants') ?></span><a href="#"></a></h5>
722 <ul<?php $this->html('userlangattributes') ?>>
723 <?php foreach ( $this->data['variant_urls'] as $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-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
734 <h5><?php $this->msg('views') ?></h5>
735 <ul<?php $this->html('userlangattributes') ?>>
736 <?php foreach ( $this->data['view_urls'] as $link ): ?>
737 <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>
745 <div id="p-cactions" class="vectorMenu<?php if ( count( $this->data['action_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
746 <h5><span><?php $this->msg('actions') ?></span><a href="#"></a></h5>
748 <ul<?php $this->html('userlangattributes') ?>>
749 <?php foreach ($this->data['action_urls'] as $link ): ?>
750 <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
759 <div id="p-personal" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
760 <h5><?php $this->msg('personaltools') ?></h5>
761 <ul<?php $this->html('userlangattributes') ?>>
762 <?php foreach($this->data['personal_urls'] as $item): ?>
763 <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>
772 <h5<?php $this->html('userlangattributes') ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5>
773 <form action="<?php $this->text( 'wgScript' ) ?>" id="searchform">
774 <input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>"/>
775 <?php if ( $wgVectorUseSimpleSearch && $wgUser->getOption( 'vector-simplesearch' ) ): ?>
776 <div id="simpleSearch">
777 <?php if ( $this->data['rtl'] ): ?>
778 <button id="searchButton" type='submit' name='button' <?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?>><img src="<?php echo $this->skin->getSkinStylePath('images/search-rtl.png'); ?>" alt="<?php $this->msg( 'searchbutton' ) ?>" /></button>
780 <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; ?> />
781 <?php if ( !$this->data['rtl'] ): ?>
782 <button id="searchButton" type='submit' name='button' <?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?>><img src="<?php echo $this->skin->getSkinStylePath('images/search-ltr.png'); ?>" alt="<?php $this->msg( 'searchbutton' ) ?>" /></button>
786 <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; ?> />
787 <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg( 'searcharticle' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> />
788 <input type="submit" name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg( 'searchbutton' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> />
796 echo "\n<!-- /{$name} -->\n";