From 79fc796a8e323af3107d3107468e6167b2528ad0 Mon Sep 17 00:00:00 2001 From: Dereckson Date: Sun, 30 Sep 2012 10:15:55 +0200 Subject: [PATCH] Installer can now customize the logo in LocalSettings.php Bug: 40617 Change-Id: Ia6efdf931b0b6be7556fc16c040aa7493845cdfc --- includes/installer/Installer.i18n.php | 2 ++ includes/installer/LocalSettingsGenerator.php | 6 +++--- includes/installer/WebInstallerPage.php | 5 +++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/includes/installer/Installer.i18n.php b/includes/installer/Installer.i18n.php index 02f0c47430..5e36a60a9e 100644 --- a/includes/installer/Installer.i18n.php +++ b/includes/installer/Installer.i18n.php @@ -455,6 +455,8 @@ Ideally, this should not be accessible from the web.', 'config-logo-help' => "MediaWiki's default skin includes space for a 135x160 pixel logo above the sidebar menu. Upload an image of the appropriate size, and enter the URL here. +You can use \$wgStylePath or \$wgScriptPath if your logo is relative to those paths. + If you do not want a logo, leave this box blank.", 'config-instantcommons' => 'Enable Instant Commons', 'config-instantcommons-help' => '[//www.mediawiki.org/wiki/InstantCommons Instant Commons] is a feature that allows wikis to use images, sounds and other media found on the [//commons.wikimedia.org/ Wikimedia Commons] site. diff --git a/includes/installer/LocalSettingsGenerator.php b/includes/installer/LocalSettingsGenerator.php index aa7fc97363..cf45dcbc03 100644 --- a/includes/installer/LocalSettingsGenerator.php +++ b/includes/installer/LocalSettingsGenerator.php @@ -62,12 +62,12 @@ class LocalSettingsGenerator { 'wgRightsText', 'wgMainCacheType', 'wgEnableUploads', 'wgMainCacheType', '_MemCachedServers', 'wgDBserver', 'wgDBuser', 'wgDBpassword', 'wgUseInstantCommons', 'wgUpgradeKey', 'wgDefaultSkin', - 'wgMetaNamespace', 'wgResourceLoaderMaxQueryLength' + 'wgMetaNamespace', 'wgResourceLoaderMaxQueryLength', 'wgLogo', ), $db->getGlobalNames() ); - $unescaped = array( 'wgRightsIcon' ); + $unescaped = array( 'wgRightsIcon', 'wgLogo' ); $boolItems = array( 'wgEnableEmail', 'wgEnableUserEmail', 'wgEnotifUserTalk', 'wgEnotifWatchlist', 'wgEmailAuthentication', 'wgEnableUploads', 'wgUseInstantCommons' @@ -273,7 +273,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { ## The relative URL path to the logo. Make sure you change this from the default, ## or else you'll overwrite your logo when you upgrade! -\$wgLogo = \"\$wgStylePath/common/images/wiki.png\"; +\$wgLogo = \"{$this->values['wgLogo']}\"; ## UPO means: this is also a user preference option diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index 305c012ad7..593509e5fe 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -933,6 +933,10 @@ class WebInstaller_Options extends WebInstallerPage { $this->getVar( 'wgDeletedDirectory' ) ) ); + // If we're using the default, let the user set it relative to $wgScriptPath + $curLogo = $this->getVar( 'wgLogo' ); + $logoString = ( $curLogo == "/wiki/skins/common/images/wiki.png" ) ? + '$wgStylePath/common/images/wiki.png' : $curLogo; $uploadwrapperStyle = $this->getVar( 'wgEnableUploads' ) ? '' : 'display: none'; $this->addHTML( @@ -954,6 +958,7 @@ class WebInstaller_Options extends WebInstallerPage { '' . $this->parent->getTextBox( array( 'var' => 'wgLogo', + 'value' => $logoString, 'label' => 'config-logo', 'attribs' => array( 'dir' => 'ltr' ), 'help' => $this->parent->getHelpBox( 'config-logo-help' ) -- 2.20.1