diff --git a/lang/en/debug.php b/lang/en/debug.php index 86d813cfa45..b03181e5df1 100644 --- a/lang/en/debug.php +++ b/lang/en/debug.php @@ -31,11 +31,13 @@ $string['cannotinitpage'] = 'Cannot fully initialize page: invalid {$a->name} id $string['cannotsetuptable'] = '{$a} tables could NOT be set up successfully!'; $string['codingerror'] = 'Coding error detected, it must be fixed by a programmer: {$a}'; $string['configmoodle'] = 'Moodle has not been configured yet. You need to edit config.php first.'; +$string['debuginfo'] = 'Debug info'; $string['erroroccur'] = 'An error has occurred during this process'; $string['invalidarraysize'] = 'Incorrect size of arrays in params of {$a}'; $string['invalideventdata'] = 'Incorrect event data submitted: {$a}'; $string['invalidparameter'] = 'Invalid parameter value detected'; $string['invalidresponse'] = 'Invalid response value detected'; +$string['line'] = 'Line'; $string['missingconfigversion'] = 'Config table does not contain version, can not continue, sorry.'; $string['modulenotexist'] = '{$a} module doesn\'t exist'; $string['morethanonerecordinfetch'] = 'Found more than one record in fetch() !'; @@ -47,9 +49,11 @@ $string['nomodules'] = 'No modules found!!'; $string['nopageclass'] = 'Imported {$a} but found no page classes'; $string['noreports'] = 'No reports accessible'; $string['notables'] = 'No tables!'; +$string['outputbuffer'] = 'Output buffer'; $string['phpvaroff'] = 'The PHP server variable \'{$a->name}\' should be Off - {$a->link}'; $string['phpvaron'] = 'The PHP server variable \'{$a->name}\' is not turned On - {$a->link}'; $string['sessionmissing'] = '{$a} object missing from session'; $string['sqlrelyonobsoletetable'] = 'This SQL relies on obsolete table(s): {$a}! Your code must be fixed by a developer.'; +$string['stacktrace'] = 'Stack trace'; $string['withoutversion'] = 'Main version.php file is missing, not readable or broken.'; $string['xmlizeunavailable'] = 'xmlize functions are not available'; diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 3901907b466..0f309bf6408 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -2809,16 +2809,20 @@ EOD; $output .= $this->box($message, 'errorbox alert alert-danger', null, array('data-rel' => 'fatalerror')); if ($CFG->debugdeveloper) { + $labelsep = get_string('labelsep', 'langconfig'); if (!empty($debuginfo)) { $debuginfo = s($debuginfo); // removes all nasty JS $debuginfo = str_replace("\n", '
', $debuginfo); // keep newlines - $output .= $this->notification('Debug info: '.$debuginfo, 'notifytiny'); + $label = get_string('debuginfo', 'debug') . $labelsep; + $output .= $this->notification("$label " . $debuginfo, 'notifytiny'); } if (!empty($backtrace)) { - $output .= $this->notification('Stack trace: '.format_backtrace($backtrace), 'notifytiny'); + $label = get_string('stacktrace', 'debug') . $labelsep; + $output .= $this->notification("$label " . format_backtrace($backtrace), 'notifytiny'); } if ($obbuffer !== '' ) { - $output .= $this->notification('Output buffer: '.s($obbuffer), 'notifytiny'); + $label = get_string('outputbuffer', 'debug') . $labelsep; + $output .= $this->notification("$label " . s($obbuffer), 'notifytiny'); } } diff --git a/lib/outputrequirementslib.php b/lib/outputrequirementslib.php index f29905037e6..2ab030b786e 100644 --- a/lib/outputrequirementslib.php +++ b/lib/outputrequirementslib.php @@ -1639,7 +1639,16 @@ class page_requirements_manager { 'areyousure', 'closebuttontitle', 'unknownerror', + 'error', + 'file', + 'url', ), 'moodle'); + $this->strings_for_js(array( + 'debuginfo', + 'line', + 'stacktrace', + ), 'debug'); + $this->string_for_js('labelsep', 'langconfig'); if (!empty($this->stringsforjs)) { $strings = array(); foreach ($this->stringsforjs as $component=>$v) { diff --git a/lib/yui/build/moodle-core-notification-ajaxexception/moodle-core-notification-ajaxexception-debug.js b/lib/yui/build/moodle-core-notification-ajaxexception/moodle-core-notification-ajaxexception-debug.js index be34b855669..3c96571bf87 100644 --- a/lib/yui/build/moodle-core-notification-ajaxexception/moodle-core-notification-ajaxexception-debug.js +++ b/lib/yui/build/moodle-core-notification-ajaxexception/moodle-core-notification-ajaxexception-debug.js @@ -50,7 +50,7 @@ var AJAXEXCEPTION_NAME = 'Moodle AJAX exception', * @extends M.core.dialogue */ AJAXEXCEPTION = function(config) { - config.name = config.name || 'Error'; + config.name = config.name || M.util.get_string('error', 'moodle'); config.closeButton = true; AJAXEXCEPTION.superclass.constructor.apply(this, [config]); }; @@ -59,19 +59,22 @@ Y.extend(AJAXEXCEPTION, M.core.notification.info, { initializer: function(config) { var content, self = this, - delay = this.get('hideTimeoutDelay'); + delay = this.get('hideTimeoutDelay'), + labelsep = M.util.get_string('labelsep', 'langconfig'); this.get(BASE).addClass('moodle-dialogue-exception'); this.setStdModContent(Y.WidgetStdMod.HEADER, '

' + Y.Escape.html(config.name) + '

', Y.WidgetStdMod.REPLACE); content = Y.Node.create('
') .append(Y.Node.create('
' + Y.Escape.html(this.get('error')) + '
')) - .append(Y.Node.create('