http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96817

Revision: 96817
Author:   jeroendedauw
Date:     2011-09-11 22:46:49 +0000 (Sun, 11 Sep 2011)
Log Message:
-----------
added some settings

Modified Paths:
--------------
    trunk/extensions/Survey/Survey.settings.php
    trunk/extensions/Survey/includes/Survey.class.php

Modified: trunk/extensions/Survey/Survey.settings.php
===================================================================
--- trunk/extensions/Survey/Survey.settings.php 2011-09-11 22:40:47 UTC (rev 
96816)
+++ trunk/extensions/Survey/Survey.settings.php 2011-09-11 22:46:49 UTC (rev 
96817)
@@ -20,6 +20,11 @@
 
        protected static function getDefaultSettings() {
                return array(
+                       'defaultEnabled' => false,
+                       'defaultUserType' => Survey::$USER_ALL,
+                       'defaultNamespaces' => array(),
+                       'defaultRatio' => 100,
+                       'defaultExpiry' => 60 * 60 * 24 * 30
                );
        }
 

Modified: trunk/extensions/Survey/includes/Survey.class.php
===================================================================
--- trunk/extensions/Survey/includes/Survey.class.php   2011-09-11 22:40:47 UTC 
(rev 96816)
+++ trunk/extensions/Survey/includes/Survey.class.php   2011-09-11 22:46:49 UTC 
(rev 96817)
@@ -62,14 +62,14 @@
                return array(
                        'name' => '',
                        'title' => '',
-                       'enabled' => '0',
+                       'enabled' => SurveySettings::get( 'defaultEnabled' ) ? 
'1' : '0',
                        'header' => 'Thank you for taking this short survey. 
Please fill out the following questions:',
                        'footer' => '',
                        'thanks' => 'Thank you for your responses.',
-                       'user_type' => self::$USER_ALL,
-                       'namespaces' => array(),
-                       'ratio' => 100,
-                       'expiry' => 60 * 60 * 24 * 30
+                       'user_type' => SurveySettings::get( 'defaultUserType' ),
+                       'namespaces' => SurveySettings::get( 
'defaultNamespaces' ),
+                       'ratio' => SurveySettings::get( 'defaultRatio' ),
+                       'expiry' => SurveySettings::get( 'defaultExpiry' ),
                );
        }
        


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

Reply via email to