From: moodler Date: Wed, 13 Sep 2006 09:22:16 +0000 (+0000) Subject: The debug variable is now much more flexible X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ee437bbc2a52137e2754f5f349df34f2aadc9165;p=moodle.git The debug variable is now much more flexible --- diff --git a/lang/en_utf8/admin.php b/lang/en_utf8/admin.php index d71a6289d7..26cd82c358 100644 --- a/lang/en_utf8/admin.php +++ b/lang/en_utf8/admin.php @@ -196,6 +196,13 @@ $string['dbmigratewarning2'] = '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.
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 +?> diff --git a/lib/adminlib.php b/lib/adminlib.php index a05d730f36..a7fd535073 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -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 . '
'); - } else { - return (set_config($this->name,7) ? '' : get_string('errorsetting', 'admin') . $this->visiblename . '
'); + 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 '' . $this->visiblename . '' . - 'get_setting() == 15 ? 'checked="checked"' : '') . ' />' . - ' ' . $this->description . ''; + function write_setting($data) { + return (set_config($this->name,$data) ? '' : get_string('errorsetting', 'admin') . $this->visiblename . '
'); } }