r77718 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77717‎ | r77718 | r77719 >
Date:14:45, 4 December 2010
Author:dantman
Status:ok
Tags:
Comment:
Implement getSkinStylePath and getCommonStylePath for image paths used directly in a skin, use it for vector's search icon.
Modified paths:
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/skins/Vector.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/Vector.php
@@ -758,7 +758,7 @@
759759 <?php if ( $wgVectorUseSimpleSearch && $wgUser->getOption( 'vector-simplesearch' ) ): ?>
760760 <div id="simpleSearch">
761761 <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; ?> />
762 - <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>
 762+ <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>
763763 </div>
764764 <?php else: ?>
765765 <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; ?> />
Index: trunk/phase3/includes/Skin.php
@@ -2036,6 +2036,16 @@
20372037 }
20382038 }
20392039
 2040+ function getCommonStylePath( $fname ) {
 2041+ global $wgStylePath, $wgStyleVersion;
 2042+ return "{$wgStylePath}/common/$name?$wgStyleVersion";
 2043+ }
 2044+
 2045+ function getSkinStylePath( $fname ) {
 2046+ global $wgStylePath, $wgStyleVersion;
 2047+ return "{$wgStylePath}/{$this->stylename}/$fname?$wgStyleVersion";
 2048+ }
 2049+
20402050 /* these are used extensively in SkinTemplate, but also some other places */
20412051 static function makeMainPageUrl( $urlaction = '' ) {
20422052 $title = Title::newMainPage();

Follow-up revisions

RevisionCommit summaryAuthorDate
r77726Follow up r77718, fix broken inconsistent use of $fname/$name in getCommonSty...dantman17:00, 4 December 2010

Status & tagging log