]> git.mjollnir.org Git - moodle.git/commitdiff
The debug variable is now much more flexible
authormoodler <moodler>
Wed, 13 Sep 2006 09:22:16 +0000 (09:22 +0000)
committermoodler <moodler>
Wed, 13 Sep 2006 09:22:16 +0000 (09:22 +0000)
lang/en_utf8/admin.php
lib/adminlib.php

index d71a6289d7b8048f179a2cff4da49e6460fcc2c9..26cd82c358ec532573cc01f483054313b82bd961 100644 (file)
@@ -196,6 +196,13 @@ $string['dbmigratewarning2'] = '<b>Warning: You are about to start the database
 $string['dbmigrateconnecerror'] = 'Could not connect to the database specified.';
 $string['dbmigrateencodingerror'] = 'The database specified has encoding $a rather than required UNICODE/UTF8.<br />Please specify another.';
 $string['dbmigratepostgres'] = 'It seems that you are using PostgreSQL as the database server. To continue the migration process you need to manually create a new database with encoding \"UNICODE\"(PostgreSQL 7) or \"UTF8\" (PostgreSQL 8) to store the migrated data. Please enter your new database connection settings below to continue:';
+$string['debugnone'] = 'Do not show any debugging notices';
+$string['debugerror'] = 'E_ERROR: Show only fatal errors';
+$string['debugwarning'] = 'E_WARNING: show only serious warnings';
+$string['debugparse'] = 'E_PARSE: show parsing errors';
+$string['debugnotice'] = 'E_NOTICE: show informational notices';
+$string['debugall'] = 'E_ALL: show all reasonable feedback';
+$string['debugstrict'] = 'E_STRICT: show absolutely everything, even very minor errors';
 $string['density'] = 'Density';
 $string['download'] = 'Download';
 $string['edithelpdocs'] = 'Edit help documents';
@@ -318,4 +325,4 @@ $string['updateaccounts']  = 'Update existing accounts';
 $string['updatetimezones'] = 'Update timezones';
 $string['upwards']  = 'upwards';
 
-?>
\ No newline at end of file
+?>
index a05d730f3656a853b344715037fb98360b5b1fd9..a7fd535073cddb5ea909eafd2a6c5c259f1b3c8b 100644 (file)
@@ -2077,27 +2077,36 @@ class admin_setting_special_backupdays extends admin_setting {
     }
 }
 
-class admin_setting_special_debug extends admin_setting_configcheckbox {
+class admin_setting_special_debug extends admin_setting_configselect {
 
     function admin_setting_special_debug() {
         $name = 'debug';
         $visiblename = get_string('debug', 'admin');
         $description = get_string('configdebug', 'admin');
-        parent::admin_setting_configcheckbox($name, $visiblename, $description, '');
+        $choices = array( 0         => get_string('debugnone', 'admin'),
+                          E_ERROR   => get_string('debugerror', 'admin'),
+                          E_WARNING => get_string('debugwarning', 'admin'),
+                          E_PARSE   => get_string('debugparse', 'admin'),
+                          E_NOTICE  => get_string('debugnotice', 'admin'),
+                          E_ALL     => get_string('debugall', 'admin'),
+                          E_STRICT  => get_string('debugstrict', 'admin')
+                        );
+        parent::admin_setting_configselect($name, $visiblename, $description, '', $choices);
     }
 
-    function write_setting($data) {
-        if ($data == '1') {
-            return (set_config($this->name,15) ? '' : get_string('errorsetting', 'admin') . $this->visiblename . '<br />');
-        } else {
-            return (set_config($this->name,7) ? '' : get_string('errorsetting', 'admin') . $this->visiblename . '<br />');
+    function get_setting() {
+        global $CFG;
+        if ($CFG->debug == 7) {   // Old values
+            return 1;
+        }
+        if ($CFG->debug == 15) {  // Old values
+            return 16;
         }
+        return $CFG->debug;
     }
 
-    function output_html() {
-        return '<tr><td width="100" align="right" valign="top">' . $this->visiblename . '</td>' .
-            '<td align="left"><input type="checkbox" size="50" name="s_'. $this->name .'" value="1" ' . ($this->get_setting() == 15 ? 'checked="checked"' : '') . ' /></td></tr>' .
-            '<tr><td>&nbsp;</td><td align="left">' . $this->description . '</td></tr>';
+    function write_setting($data) {
+        return (set_config($this->name,$data) ? '' : get_string('errorsetting', 'admin') . $this->visiblename . '<br />');
     }
 
 }