From 679bc3040c4290f13cf884c5bee7d9509694999a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Tue, 9 Sep 2014 14:29:57 +0200 Subject: [PATCH] Move footer icons to assets/ directory poweredby_mediawiki_88x31.png is straightforward, just need to update some paths. The six license icons are more problematic, as the paths to them are saved in users' LocalSettings. We're remapping them in Setup.php. Bug: 69277 Change-Id: Ic7c32e56043cfbf94ef2271de4ff41ef18fbeee7 --- {skins/common/images => assets/licenses}/cc-0.png | Bin .../images => assets/licenses}/cc-by-nc-sa.png | Bin .../common/images => assets/licenses}/cc-by-sa.png | Bin {skins/common/images => assets/licenses}/cc-by.png | Bin .../common/images => assets/licenses}/gnu-fdl.png | Bin .../images => assets/licenses}/public-domain.png | Bin .../images => assets}/poweredby_mediawiki_88x31.png | Bin includes/DefaultSettings.php | 2 +- includes/Setup.php | 11 ++++++++++- includes/installer/Installer.php | 12 ++++++------ includes/skins/Skin.php | 4 ++-- 11 files changed, 19 insertions(+), 10 deletions(-) rename {skins/common/images => assets/licenses}/cc-0.png (100%) rename {skins/common/images => assets/licenses}/cc-by-nc-sa.png (100%) rename {skins/common/images => assets/licenses}/cc-by-sa.png (100%) rename {skins/common/images => assets/licenses}/cc-by.png (100%) rename {skins/common/images => assets/licenses}/gnu-fdl.png (100%) rename {skins/common/images => assets/licenses}/public-domain.png (100%) rename {skins/common/images => assets}/poweredby_mediawiki_88x31.png (100%) diff --git a/skins/common/images/cc-0.png b/assets/licenses/cc-0.png similarity index 100% rename from skins/common/images/cc-0.png rename to assets/licenses/cc-0.png diff --git a/skins/common/images/cc-by-nc-sa.png b/assets/licenses/cc-by-nc-sa.png similarity index 100% rename from skins/common/images/cc-by-nc-sa.png rename to assets/licenses/cc-by-nc-sa.png diff --git a/skins/common/images/cc-by-sa.png b/assets/licenses/cc-by-sa.png similarity index 100% rename from skins/common/images/cc-by-sa.png rename to assets/licenses/cc-by-sa.png diff --git a/skins/common/images/cc-by.png b/assets/licenses/cc-by.png similarity index 100% rename from skins/common/images/cc-by.png rename to assets/licenses/cc-by.png diff --git a/skins/common/images/gnu-fdl.png b/assets/licenses/gnu-fdl.png similarity index 100% rename from skins/common/images/gnu-fdl.png rename to assets/licenses/gnu-fdl.png diff --git a/skins/common/images/public-domain.png b/assets/licenses/public-domain.png similarity index 100% rename from skins/common/images/public-domain.png rename to assets/licenses/public-domain.png diff --git a/skins/common/images/poweredby_mediawiki_88x31.png b/assets/poweredby_mediawiki_88x31.png similarity index 100% rename from skins/common/images/poweredby_mediawiki_88x31.png rename to assets/poweredby_mediawiki_88x31.png diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 6626ab6160..73179cf1a1 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3102,7 +3102,7 @@ $wgFooterIcons = array( ), "poweredby" => array( "mediawiki" => array( - "src" => null, // Defaults to "$wgStylePath/common/images/poweredby_mediawiki_88x31.png" + "src" => null, // Defaults to "$wgScriptPath/assets/poweredby_mediawiki_88x31.png" "url" => "//www.mediawiki.org/", "alt" => "Powered by MediaWiki", ) diff --git a/includes/Setup.php b/includes/Setup.php index cddb30bd4d..0ccbaed0b5 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -102,6 +102,15 @@ if ( $wgGitInfoCacheDirectory === false && $wgCacheDirectory !== false ) { $wgGitInfoCacheDirectory = "{$wgCacheDirectory}/gitinfo"; } +// Fix path to icon images after they were moved in 1.24 +if ( $wgRightsIcon ) { + $wgRightsIcon = str_replace( + "{$wgStylePath}/common/images/", + "{$wgScriptPath}/assets/licenses/", + $wgRightsIcon + ); +} + if ( isset( $wgFooterIcons['copyright'] ) && isset( $wgFooterIcons['copyright']['copyright'] ) && $wgFooterIcons['copyright']['copyright'] === array() @@ -124,7 +133,7 @@ if ( isset( $wgFooterIcons['poweredby'] ) && $wgFooterIcons['poweredby']['mediawiki']['src'] === null ) { $wgFooterIcons['poweredby']['mediawiki']['src'] = - "$wgStylePath/common/images/poweredby_mediawiki_88x31.png"; + "$wgScriptPath/assets/poweredby_mediawiki_88x31.png"; } /** diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 987925c747..544efb6243 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -286,27 +286,27 @@ abstract class Installer { public $licenses = array( 'cc-by' => array( 'url' => 'http://creativecommons.org/licenses/by/3.0/', - 'icon' => '{$wgStylePath}/common/images/cc-by.png', + 'icon' => '{$wgScriptPath}/assets/licenses/cc-by.png', ), 'cc-by-sa' => array( 'url' => 'http://creativecommons.org/licenses/by-sa/3.0/', - 'icon' => '{$wgStylePath}/common/images/cc-by-sa.png', + 'icon' => '{$wgScriptPath}/assets/licenses/cc-by-sa.png', ), 'cc-by-nc-sa' => array( 'url' => 'http://creativecommons.org/licenses/by-nc-sa/3.0/', - 'icon' => '{$wgStylePath}/common/images/cc-by-nc-sa.png', + 'icon' => '{$wgScriptPath}/assets/licenses/cc-by-nc-sa.png', ), 'cc-0' => array( 'url' => 'https://creativecommons.org/publicdomain/zero/1.0/', - 'icon' => '{$wgStylePath}/common/images/cc-0.png', + 'icon' => '{$wgScriptPath}/assets/licenses/cc-0.png', ), 'pd' => array( 'url' => '', - 'icon' => '{$wgStylePath}/common/images/public-domain.png', + 'icon' => '{$wgScriptPath}/assets/licenses/public-domain.png', ), 'gfdl' => array( 'url' => 'http://www.gnu.org/copyleft/fdl.html', - 'icon' => '{$wgStylePath}/common/images/gnu-fdl.png', + 'icon' => '{$wgScriptPath}/assets/licenses/gnu-fdl.png', ), 'none' => array( 'url' => '', diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 7d04b9551f..b4f35839b4 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -827,9 +827,9 @@ abstract class Skin extends ContextSource { * @return string */ function getPoweredBy() { - global $wgStylePath; + global $wgScriptPath; - $url = htmlspecialchars( "$wgStylePath/common/images/poweredby_mediawiki_88x31.png" ); + $url = htmlspecialchars( "$wgScriptPath/assets/poweredby_mediawiki_88x31.png" ); $text = 'Powered by MediaWiki'; wfRunHooks( 'SkinGetPoweredBy', array( &$text, $this ) ); -- 2.20.1