Remove most named character references from output
[lhc/web/wiklou.git] / skins / Vector.php
index 6d3d0ad..d28fcfb 100644 (file)
@@ -23,10 +23,10 @@ class SkinVector extends SkinTemplate {
 
        /**
         * Initializes output page and sets up skin-specific parameters
-        * @param object $out Output page object to initialize
+        * @param $out OutputPage object to initialize
         */
        public function initPage( OutputPage $out ) {
-               global $wgStylePath;
+               global $wgLocalStylePath;
                
                parent::initPage( $out );
 
@@ -35,7 +35,7 @@ class SkinVector extends SkinTemplate {
                // wait for the CSS file to load before fetching the HTC file.
                $out->addScript(
                        '<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
-                               $wgStylePath .
+                               $wgLocalStylePath .
                                '/vector/csshover.htc")}</style><![endif]-->'
                );
        }
@@ -43,7 +43,7 @@ class SkinVector extends SkinTemplate {
        /**
         * Load skin and user css files in the correct order
         * fixes bug 22916
-        * @param object $out OutputPage object
+        * @param $out OutputPage object
         */
 
        function setupSkinUserCss( OutputPage $out ){
@@ -466,7 +466,7 @@ class VectorTemplate extends QuickTemplate {
                <div id="page-base" class="noprint"></div>
                <div id="head-base" class="noprint"></div>
                <!-- content -->
-               <div id="content" <?php $this->html('specialpageattributes') ?>>
+               <div id="content"<?php $this->html('specialpageattributes') ?>>
                        <a id="top"></a>
                        <div id="mw-js-message" style="display:none;"<?php $this->html('userlangattributes') ?>></div>
                        <?php if ( $this->data['sitenotice'] ): ?>
@@ -676,7 +676,7 @@ class VectorTemplate extends QuickTemplate {
         * when UI is in RTL mode
         */
        private function renderNavigation( $elements ) {
-               global $wgContLang, $wgVectorUseSimpleSearch, $wgStylePath;
+               global $wgContLang, $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgStylePath;
 
                // If only one element was given, wrap it in an array, allowing more
                // flexible arguments
@@ -694,28 +694,33 @@ class VectorTemplate extends QuickTemplate {
 ?>
 <div id="p-namespaces" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
        <h5><?php $this->msg('namespaces') ?></h5>
-       <?php if ( count( $this->data['namespace_urls'] ) ): ?>
        <ul<?php $this->html('userlangattributes') ?>>
                <?php foreach ($this->data['namespace_urls'] as $key => $link ): ?>
                        <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>
                <?php endforeach; ?>
        </ul>
-       <?php endif; ?>
 </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">
-               <?php if ( count( $this->data['variant_urls'] ) ): ?>
                <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>
-               <?php endif; ?>
        </div>
 </div>
 <?php
@@ -724,13 +729,11 @@ class VectorTemplate extends QuickTemplate {
 ?>
 <div id="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
        <h5><?php $this->msg('views') ?></h5>
-       <?php if ( count( $this->data['view_urls'] ) ): ?>
        <ul<?php $this->html('userlangattributes') ?>>
                <?php foreach ($this->data['view_urls'] as $key => $link ): ?>
                        <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>
                <?php endforeach; ?>
        </ul>
-       <?php endif; ?>
 </div>
 <?php
                                break;
@@ -739,13 +742,11 @@ class VectorTemplate extends QuickTemplate {
 <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">
-               <?php if ( count( $this->data['action_urls'] ) ): ?>
                <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>
-               <?php endif; ?>
        </div>
 </div>
 <?php
@@ -754,13 +755,11 @@ class VectorTemplate extends QuickTemplate {
 ?>
 <div id="p-personal" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
        <h5><?php $this->msg('personaltools') ?></h5>
-       <?php if ( count( $this->data['personal_urls'] ) ): ?>
        <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>
-       <?php endif; ?>
 </div>
 <?php
                                break;
@@ -773,7 +772,7 @@ class VectorTemplate extends QuickTemplate {
                <?php if ( $wgVectorUseSimpleSearch ): ?>
                <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' ); ?>>&nbsp;</button>
+                       <button id="searchButton" type='submit' name='button' <?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?>>&#160;</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; ?> />