Installer can now customize the logo in LocalSettings.php
authorDereckson <dereckson@espace-win.org>
Sun, 30 Sep 2012 08:15:55 +0000 (10:15 +0200)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 1 Apr 2013 14:29:22 +0000 (14:29 +0000)
Bug: 40617
Change-Id: Ia6efdf931b0b6be7556fc16c040aa7493845cdfc

includes/installer/Installer.i18n.php
includes/installer/LocalSettingsGenerator.php
includes/installer/WebInstallerPage.php

index 02f0c47..5e36a60 100644 (file)
@@ -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.
index aa7fc97..cf45dcb 100644 (file)
@@ -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
 
index 305c012..593509e 100644 (file)
@@ -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 {
                        '</div>' .
                        $this->parent->getTextBox( array(
                                'var' => 'wgLogo',
+                               'value' => $logoString,
                                'label' => 'config-logo',
                                'attribs' => array( 'dir' => 'ltr' ),
                                'help' => $this->parent->getHelpBox( 'config-logo-help' )