Implement getSkinStylePath and getCommonStylePath for image paths used directly in...
authorDaniel Friesen <dantman@users.mediawiki.org>
Sat, 4 Dec 2010 14:45:14 +0000 (14:45 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Sat, 4 Dec 2010 14:45:14 +0000 (14:45 +0000)
includes/Skin.php
skins/Vector.php

index f59742f..badafb6 100644 (file)
@@ -2036,6 +2036,16 @@ class Skin extends Linker {
                }
        }
 
+       function getCommonStylePath( $fname ) {
+               global $wgStylePath, $wgStyleVersion;
+               return "{$wgStylePath}/common/$name?$wgStyleVersion";
+       }
+
+       function getSkinStylePath( $fname ) {
+               global $wgStylePath, $wgStyleVersion;
+               return "{$wgStylePath}/{$this->stylename}/$fname?$wgStyleVersion";
+       }
+
        /* these are used extensively in SkinTemplate, but also some other places */
        static function makeMainPageUrl( $urlaction = '' ) {
                $title = Title::newMainPage();
index 469569d..edad705 100644 (file)
@@ -758,7 +758,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' ); ?>><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>
+                       <button id="searchButton" type='submit' name='button' <?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?>><img src="<?php echo $this->skin->getSkinStylePath('images/search-' . ( $this->data['rtl'] ? 'rtl' : 'ltr' ) . '.png'); ?>" 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; ?> />