+ break;
+ }
+ echo "\n<!-- /{$name} -->\n";
+ }
+ }
+
+ /**
+ * Render one or more navigations elements by name, automatically reveresed
+ * when UI is in RTL mode
+ */
+ private function renderNavigation( $elements ) {
+ global $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser;
+
+ // If only one element was given, wrap it in an array, allowing more
+ // flexible arguments
+ if ( !is_array( $elements ) ) {
+ $elements = array( $elements );
+ // If there's a series of elements, reverse them when in RTL mode
+ } else if ( wfUILang()->isRTL() ) {
+ $elements = array_reverse( $elements );
+ }
+ // Render elements
+ foreach ( $elements as $name => $element ) {
+ echo "\n<!-- {$name} -->\n";
+ switch ( $element ) {
+ case 'NAMESPACES':
+?>
+<div id="p-namespaces" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
+ <h5><?php $this->msg('namespaces') ?></h5>
+ <ul<?php $this->html('userlangattributes') ?>>
+ <?php foreach ($this->data['namespace_urls'] as $key => $link ): ?>
+ <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>
+ <?php endforeach; ?>
+ </ul>
+</div>
+<?php
+ break;
+ case 'VARIANTS':
+?>
+<div id="p-variants" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
+ <?php if ( $wgVectorShowVariantName ): ?>
+ <h4>
+ <?php foreach ( $this->data['variant_urls'] as $key => $link ): ?>
+ <?php if ( stripos( $link['attributes'], 'selected' ) !== false ): ?>
+ <?php echo htmlspecialchars( $link['text'] ) ?>
+ <?php endif; ?>
+ <?php endforeach; ?>
+ </h4>
+ <?php endif; ?>
+ <h5><span><?php $this->msg('variants') ?></span><a href="#"></a></h5>
+ <div class="menu">
+ <ul<?php $this->html('userlangattributes') ?>>
+ <?php foreach ( $this->data['variant_urls'] as $key => $link ): ?>
+ <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
+ <?php endforeach; ?>
+ </ul>
+ </div>
+</div>
+<?php
+ break;
+ case 'VIEWS':
+?>
+<div id="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
+ <h5><?php $this->msg('views') ?></h5>
+ <ul<?php $this->html('userlangattributes') ?>>
+ <?php foreach ( $this->data['view_urls'] as $key => $link ): ?>
+ <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>
+ <?php endforeach; ?>
+ </ul>
+</div>
+<?php
+ break;
+ case 'ACTIONS':
+?>
+<div id="p-cactions" class="vectorMenu<?php if ( count( $this->data['action_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
+ <h5><span><?php $this->msg('actions') ?></span><a href="#"></a></h5>
+ <div class="menu">
+ <ul<?php $this->html('userlangattributes') ?>>
+ <?php foreach ($this->data['action_urls'] as $key => $link ): ?>
+ <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
+ <?php endforeach; ?>
+ </ul>
+ </div>
+</div>
+<?php
+ break;
+ case 'PERSONAL':
+?>
+<div id="p-personal" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
+ <h5><?php $this->msg('personaltools') ?></h5>
+ <ul<?php $this->html('userlangattributes') ?>>
+ <?php foreach($this->data['personal_urls'] as $key => $item): ?>
+ <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>
+ <?php endforeach; ?>
+ </ul>
+</div>
+<?php
+ break;
+ case 'SEARCH':
+?>
+<div id="p-search">
+ <h5<?php $this->html('userlangattributes') ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5>
+ <form action="<?php $this->text( 'wgScript' ) ?>" id="searchform">
+ <input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>"/>
+ <?php if ( $wgVectorUseSimpleSearch && $wgUser->getOption( 'vector-simplesearch' ) ): ?>
+ <div id="simpleSearch">
+ <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; ?> />
+ <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>
+ </div>
+ <?php else: ?>
+ <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; ?> />
+ <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg( 'searcharticle' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> />
+ <input type="submit" name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg( 'searchbutton' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> />
+ <?php endif; ?>
+ </form>
+</div>
+<?php
+
+ break;
+ }
+ echo "\n<!-- /{$name} -->\n";
+ }