Revision: 45976
Author:   ialex
Date:     2009-01-21 20:57:54 +0000 (Wed, 21 Jan 2009)

Log Message:
-----------
Backport r45967, r45968 and r45975

Modified Paths:
--------------
    branches/REL1_14/extensions/Configure/CHANGELOG
    branches/REL1_14/extensions/Configure/Configure.obj.php
    branches/REL1_14/extensions/Configure/Configure.page.php
    branches/REL1_14/extensions/Configure/Configure.php
    branches/REL1_14/extensions/Configure/Configure.settings.php
    branches/REL1_14/extensions/Configure/SpecialExtensions.php

Modified: branches/REL1_14/extensions/Configure/CHANGELOG
===================================================================
--- branches/REL1_14/extensions/Configure/CHANGELOG     2009-01-21 20:56:08 UTC 
(rev 45975)
+++ branches/REL1_14/extensions/Configure/CHANGELOG     2009-01-21 20:57:54 UTC 
(rev 45976)
@@ -1,6 +1,10 @@
 This file lists changes on this extension.
 Localisation updates are done on betawiki and aren't listed here.
 
+1.14 branch-3 - 21 January 2009
+  Fixed a bug on Special:Extensions, default settings values are now correctly
+  displayed.
+
 1.14 branch-2 - 17 January 2009
   Fixed "You are not allowed to read this setting" error for all settings on
   Special:Extensions when $wgConfigureEditableSettings is an non-empty array.

Modified: branches/REL1_14/extensions/Configure/Configure.obj.php
===================================================================
--- branches/REL1_14/extensions/Configure/Configure.obj.php     2009-01-21 
20:56:08 UTC (rev 45975)
+++ branches/REL1_14/extensions/Configure/Configure.obj.php     2009-01-21 
20:57:54 UTC (rev 45976)
@@ -84,7 +84,7 @@
                        if( !is_array( $this->mDefaults ) ) {
                                $this->mDefaults = array();
                        }
-                       $allSettings = ConfigurationSettings::singleton( 
CONF_SETTINGS_BOTH )->getEditableSettings();
+                       $allSettings = ConfigurationSettings::singleton( 
CONF_SETTINGS_CORE )->getEditableSettings();
                        $allSettings += array_flip( $alwaysSnapshot );
                        foreach( $allSettings as $setting => $type ) {
                                if( array_key_exists( $setting, $GLOBALS ) &&

Modified: branches/REL1_14/extensions/Configure/Configure.page.php
===================================================================
--- branches/REL1_14/extensions/Configure/Configure.page.php    2009-01-21 
20:56:08 UTC (rev 45975)
+++ branches/REL1_14/extensions/Configure/Configure.page.php    2009-01-21 
20:57:54 UTC (rev 45976)
@@ -125,7 +125,7 @@
        protected function getSettingValue( $setting ) {
                static $defaults;
 
-               if (!$defaults) {
+               if ( !$defaults ) {
                        global $wgConf;
                        $defaults = $wgConf->getDefaultsForWiki( $this->mWiki );
                }

Modified: branches/REL1_14/extensions/Configure/Configure.php
===================================================================
--- branches/REL1_14/extensions/Configure/Configure.php 2009-01-21 20:56:08 UTC 
(rev 45975)
+++ branches/REL1_14/extensions/Configure/Configure.php 2009-01-21 20:57:54 UTC 
(rev 45976)
@@ -17,7 +17,7 @@
        'url' => 'http://www.mediawiki.org/wiki/Extension:Configure',
        'description' => 'Allow authorised users to configure the wiki via a 
web-based interface',
        'descriptionmsg' => 'configure-desc',
-       'version' => '0.11.5 (1.14 branch-2)',
+       'version' => '0.11.5 (1.14 branch-3)',
 );
 
 # Configuration part

Modified: branches/REL1_14/extensions/Configure/Configure.settings.php
===================================================================
--- branches/REL1_14/extensions/Configure/Configure.settings.php        
2009-01-21 20:56:08 UTC (rev 45975)
+++ branches/REL1_14/extensions/Configure/Configure.settings.php        
2009-01-21 20:57:54 UTC (rev 45976)
@@ -194,7 +194,8 @@
                global $wgConf, $wgConfigureNotEditableSettings, 
$wgConfigureEditableSettings;
                $notEditable = array_merge( $notEditable, 
$wgConf->getUneditableSettings() );
 
-               if ( !count( $wgConfigureNotEditableSettings ) && count( 
$wgConfigureEditableSettings ) ) {
+               if ( !count( $wgConfigureNotEditableSettings ) && count( 
$wgConfigureEditableSettings ) &&
+                       ( $this->types & CONF_SETTINGS_CORE ) == 
CONF_SETTINGS_CORE ) {
                        // Only disallow core settings, not extensions settings!
                        $coreSettings = array();
                        foreach( $this->settings as $section ) {
@@ -230,6 +231,12 @@
                        foreach( $wgConfigureEditableSettings as $setting ) {
                                $this->cache['editable'][$setting] = 
$this->getSettingType( $setting );
                        }
+                       // We'll need to add extensions settings
+                       if ( ( $this->types & CONF_SETTINGS_EXT ) == 
CONF_SETTINGS_EXT ) {
+                               foreach ( $this->getAllExtensionsObjects() as 
$ext ) {
+                                       $this->cache['editable'] += 
$ext->getSettings();
+                               }
+                       }
                        return $this->cache['editable'];
                }
 

Modified: branches/REL1_14/extensions/Configure/SpecialExtensions.php
===================================================================
--- branches/REL1_14/extensions/Configure/SpecialExtensions.php 2009-01-21 
20:56:08 UTC (rev 45975)
+++ branches/REL1_14/extensions/Configure/SpecialExtensions.php 2009-01-21 
20:57:54 UTC (rev 45976)
@@ -96,7 +96,8 @@
                        if( !$ext->isInstalled() ) continue; // must exist
                        $settings = $ext->getSettings();
                        foreach ( $settings as $setting => $type ) {
-                               if ( !isset( $GLOBALS[$setting] ) && !isset( 
$this->conf[$setting] ) && file_exists( $ext->getFile() ) ) {
+                               if ( !isset( $this->conf[$setting] ) && 
file_exists( $ext->getFile() ) ) {
+                                       //echo "$setting<br/>\n";
                                        if ( !$globalDone ) {
                                                extract( $GLOBALS, EXTR_REFS );
                                                global $wgHooks;
@@ -105,14 +106,14 @@
                                                $globalDone = true;
                                        }
                                        require_once( $ext->getFile() );
-                                       if ( isset( $GLOBALS[$setting] ) )
-                                               $this->conf[$setting] = 
$GLOBALS[$setting];
+                                       if ( isset( $$setting ) )
+                                               $this->conf[$setting] = 
$$setting;
                                }
                        }
                        $ext->setPageObj( $this );
                        $ret .= $ext->getHtml();
                }
-               if ( isset( $oldHooks ) )
+               if ( $globalDone )
                        $GLOBALS['wgHooks'] = $oldHooks;
                return $ret;
        }



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to