Fix an instance of window.someVar; that slipped through the cracks
[lhc/web/wiklou.git] / skins / Vector.php
index 96db057..16af0c0 100644 (file)
@@ -37,7 +37,7 @@ class SkinVector extends SkinTemplate {
                $out->addScript(
                        '<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
                                htmlspecialchars( $wgLocalStylePath ) .
-                               '/vector/csshover.htc")}</style><![endif]-->'
+                               "/{$this->stylename}/csshover.htc\")}</style><![endif]-->"
                );
        }
 
@@ -47,21 +47,8 @@ class SkinVector extends SkinTemplate {
         * @param $out OutputPage object
         */
        function setupSkinUserCss( OutputPage $out ){
-               global $wgVectorExtraStyles;
-
                parent::setupSkinUserCss( $out );
-
-               // Append skin-specific styles
-               $out->addStyle( 'vector/main-rtl.css', 'screen', '', 'rtl' );
-               $out->addStyle( 'vector/main-ltr.css', 'screen', '', 'ltr' );
-
-               // Add extra stylesheets
-               // THIS IS ONLY USEFUL FOR EXPERIMENTING WITH DIFFERNT STYLE OPTIONS! THIS WILL BE REMOVED IN THE NEAR FUTURE.
-               if ( is_array( $wgVectorExtraStyles ) ) {
-                       foreach ( $wgVectorExtraStyles as $style ) {
-                               $out->addStyle( 'vector/' . $style, 'screen' );
-                       }
-               }
+               $out->addModuleStyles( 'vector' );
        }
 
        /**
@@ -103,15 +90,14 @@ class SkinVector extends SkinTemplate {
                        } else {
                                $talkId = "{$subjectId}_talk";
                        }
-                       $currentId = $isTalk ? $talkId : $subjectId;
 
                        // Adds namespace links
                        $links['namespaces'][$subjectId] = $this->tabAction(
-                               $subjectPage, 'vector-namespace-' . $subjectId, !$isTalk, '', true
+                               $subjectPage, 'nstab-' . $subjectId, !$isTalk, '', true
                        );
                        $links['namespaces'][$subjectId]['context'] = 'subject';
                        $links['namespaces'][$talkId] = $this->tabAction(
-                               $talkPage, 'vector-namespace-talk', $isTalk, '', true
+                               $talkPage, 'talk', $isTalk, '', true
                        );
                        $links['namespaces'][$talkId]['context'] = 'talk';
 
@@ -293,7 +279,7 @@ class SkinVector extends SkinTemplate {
                        // Checks if the user is logged in
                        if ( $this->loggedin ) {
                                if ( $wgVectorUseIconWatch ) {
-                                       $class = 'icon ';
+                                       $class = 'icon';
                                        $place = 'views';
                                } else {
                                        $class = '';
@@ -313,7 +299,7 @@ class SkinVector extends SkinTemplate {
                } else {
                        $links['namespaces']['special'] = array(
                                'class' => 'selected',
-                               'text' => wfMsg( 'vector-namespace-special' ),
+                               'text' => wfMsg( 'nstab-special' ),
                                'href' => $wgRequest->getRequestURL()
                        );
                }
@@ -367,7 +353,7 @@ class VectorTemplate extends QuickTemplate {
         * Outputs the entire contents of the XHTML page
         */
        public function execute() {
-               global $wgRequest, $wgOut, $wgContLang;
+               global $wgRequest, $wgLang;
 
                $this->skin = $this->data['skin'];
                $action = $wgRequest->getText( 'action' );
@@ -459,7 +445,7 @@ class VectorTemplate extends QuickTemplate {
                        }
                }
                // Reverse horizontally rendered navigation elements
-               if ( $wgContLang->isRTL() ) {
+               if ( $wgLang->isRTL() ) {
                        $this->data['view_urls'] =
                                array_reverse( $this->data['view_urls'] );
                        $this->data['namespace_urls'] =
@@ -487,7 +473,7 @@ class VectorTemplate extends QuickTemplate {
                        <!-- bodyContent -->
                        <div id="bodyContent">
                                <!-- tagline -->
-                               <h3 id="siteSub"><?php $this->msg( 'tagline' ) ?></h3>
+                               <div id="siteSub"><?php $this->msg( 'tagline' ) ?></div>
                                <!-- /tagline -->
                                <!-- subtitle -->
                                <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html( 'subtitle' ) ?></div>
@@ -563,10 +549,10 @@ class VectorTemplate extends QuickTemplate {
                        <div style="clear:both"></div>
                </div>
                <!-- /footer -->
+               <?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?>
                <!-- fixalpha -->
                <script type="<?php $this->text('jsmimetype') ?>"> if ( window.isMSIE55 ) fixalpha(); </script>
                <!-- /fixalpha -->
-               <?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?>
                <?php $this->html( 'reporttime' ) ?>
                <?php if ( $this->data['debug'] ): ?>
                <!-- Debug output: <?php $this->text( 'debug' ); ?> -->
@@ -675,14 +661,14 @@ class VectorTemplate extends QuickTemplate {
         * when UI is in RTL mode
         */
        private function renderNavigation( $elements ) {
-               global $wgContLang, $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser;
+               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 ( $wgContLang->isRTL() ) {
+               } else if ( wfUILang()->isRTL() ) {
                        $elements = array_reverse( $elements );
                }
                // Render elements
@@ -695,7 +681,7 @@ class VectorTemplate extends QuickTemplate {
        <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'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><span><?php echo htmlspecialchars( $link['text'] ) ?></span></a></li>
+                       <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>
@@ -730,7 +716,7 @@ class VectorTemplate extends QuickTemplate {
        <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'] ?>><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>
+                       <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>
@@ -771,7 +757,7 @@ class VectorTemplate extends QuickTemplate {
                <?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' ); ?>>&#160;</button>
+                       <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; ?> />