Use member variable defaults for SkinTemplate
[lhc/web/wiklou.git] / skins / Vector.php
index d209a01..5007a5f 100644 (file)
@@ -18,18 +18,17 @@ if( !defined( 'MEDIAWIKI' ) )
 class SkinVector extends SkinTemplate {
 
        /* Functions */
+       var $skinname = $stylename = 'vector',
+               $template = 'VectorTemplate';
 
        /**
         * Initializes output page and sets up skin-specific parameters
         * @param object $out Output page object to initialize
         */
        public function initPage( OutputPage $out ) {
-               global $wgStylePath;
+               global $wgStylePath, $wgJsMimeType, $wgStyleVersion;
                
                parent::initPage( $out );
-               $this->skinname  = 'vector';
-               $this->stylename = 'vector';
-               $this->template  = 'VectorTemplate';
                
                // Append skin-specific styles
                $out->addStyle( 'vector/main-rtl.css', 'screen', '', 'rtl' );
@@ -42,6 +41,17 @@ class SkinVector extends SkinTemplate {
                                $wgStylePath .
                                '/vector/csshover.htc")}</style><![endif]-->'
                );
+               // Append common IE fixes, which perhaps should be included in all
+               // skins, but for now it seems each skin needs to include them
+               // explicitly
+               $out->addScript(
+                       '<!--[if lt IE 7]><script type="' . $wgJsMimeType . '" src="' .
+                               $wgStylePath .
+                               '/common/IEFixes.js?' .
+                               $wgStyleVersion .
+                               '"></script>' .
+                               '<meta http-equiv="imagetoolbar" content="no" /><![endif]-->'
+               );
        }
        /**
         * Builds a structured array of links used for tabs and menus
@@ -671,7 +681,7 @@ class VectorTemplate extends QuickTemplate {
         * when UI is in RTL mode
         */
        private function renderNavigation( $elements ) {
-               global $wgContLang, $wgUseTwoButtonsSearchForm;
+               global $wgContLang, $wgVectorUseSimpleSearch, $wgStylePath;
                
                // If only one element was given, wrap it in an array, allowing more
                // flexible arguments
@@ -707,7 +717,7 @@ class VectorTemplate extends QuickTemplate {
        <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>
+                               <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo str_replace( ' ', '&nbsp;', htmlspecialchars( $link['text'] ) ) ?></a></li>
                        <?php endforeach; ?>
                </ul>
        </div>
@@ -737,7 +747,7 @@ class VectorTemplate extends QuickTemplate {
        <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>
+                               <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo str_replace( ' ', '&nbsp;', htmlspecialchars( $link['text'] ) ) ?></a></li>
                        <?php endforeach; ?>
                </ul>
        </div>
@@ -765,12 +775,15 @@ class VectorTemplate extends QuickTemplate {
        <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 ): ?>
+               <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='fulltext' <?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?>>&nbsp;</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' ); ?> />
-               <?php if ( $wgUseTwoButtonsSearchForm ): ?>
                <input type="submit" name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg( 'searchbutton' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> />
-               <?php else: ?>
-               <div><a href="<?php $this->text( 'searchaction' ) ?>" rel="search"><?php $this->msg( 'powersearch-legend' ) ?></a></div>
                <?php endif; ?>
        </form>
 </div>