From 360dde50ba68d5708232e467f1364c6c4d167315 Mon Sep 17 00:00:00 2001 From: skodak Date: Mon, 27 Jul 2009 20:36:28 +0000 Subject: [PATCH] MDL-19943 new debug optiosn for validators link and page info in footer --- admin/settings/server.php | 2 ++ lang/en_utf8/admin.php | 4 ++++ lib/outputlib.php | 6 ++++-- lib/setup.php | 2 +- version.php | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/admin/settings/server.php b/admin/settings/server.php index 74f77d93fd..29e20dde42 100644 --- a/admin/settings/server.php +++ b/admin/settings/server.php @@ -100,6 +100,8 @@ $temp->add(new admin_setting_configcheckbox('xmlstrictheaders', get_string('xmls $temp->add(new admin_setting_configcheckbox('debugsmtp', get_string('debugsmtp', 'admin'), get_string('configdebugsmtp', 'admin'), 0)); $temp->add(new admin_setting_configcheckbox('perfdebug', get_string('perfdebug', 'admin'), get_string('configperfdebug', 'admin'), '7', '15', '7')); $temp->add(new admin_setting_configcheckbox('debugstringids', get_string('debugstringids', 'admin'), get_string('configdebugstringids', 'admin'), 0)); +$temp->add(new admin_setting_configcheckbox('debugvalidators', get_string('debugvalidators', 'admin'), get_string('configdebugvalidators', 'admin'), 0)); +$temp->add(new admin_setting_configcheckbox('debugpageinfo', get_string('debugpageinfo', 'admin'), get_string('configdebugpageinfo', 'admin'), 0)); $ADMIN->add('server', $temp); diff --git a/lang/en_utf8/admin.php b/lang/en_utf8/admin.php index c403e9fd9d..1f26747732 100644 --- a/lang/en_utf8/admin.php +++ b/lang/en_utf8/admin.php @@ -114,7 +114,9 @@ $string['configcurlcache'] = 'Time-to-live for cURL cache, in seconds.'; $string['configdbsessions'] = 'If enabled, this setting will use the database to store information about current sessions. This is especially useful for large/busy sites or sites built on cluster of servers. For most sites this should probably be left disabled so that the server disk is used instead. Note that changing this setting now will log out all current users (including you). If you are using MySQL please make sure that \'max_allowed_packet\' in my.cnf (or my.ini) is at least 4M.'; $string['configdebug'] = 'If you turn this on, then PHP\'s error_reporting will be increased so that more warnings are printed. This is only useful for developers.'; $string['configdebugdisplay'] = 'Set to on, the error reporting will go to the HTML page. This is practical, but breaks XHTML, JS, cookies and HTTP headers in general. Set to off, it will send the output to your server logs, allowing better debugging. The PHP setting error_log controls which log this goes to.'; +$string['configdebugpageinfo'] = 'Enable if you want page information printed in page footer.'; $string['configdebugsmtp'] = 'Enable verbose debug information during sending of email messages to SMTP server.'; +$string['configdebugvalidators'] = 'Enable if you want to have links to external validator servers in page footer. You may need to create new user with username w3cvalidator, enable guest access and enable guest access. These changes may allow unauthorized access to server, do not enable on production sites!'; $string['configdefaultallowedmodules'] = 'For the courses which fall into the above category, which modules do you want to allow by default when the course is created?'; $string['configdefaultcourseroleid'] = 'Users who enrol in a course will be automatically assigned this role.'; $string['configdefaultrequestcategory'] = 'Courses requested by users will be automatically placed in this category.'; @@ -345,6 +347,8 @@ $string['debugging'] = 'Debugging'; $string['debugminimal'] = 'MINIMAL: Show only fatal errors'; $string['debugnone'] = 'NONE: Do not show any errors or warnings'; $string['debugnormal'] = 'NORMAL: Show errors, warnings and notices'; +$string['debugpageinfo'] = 'Show page information'; +$string['debugvalidators'] = 'Show validator links'; $string['defaultallowedmodules'] = 'Default allowed modules'; $string['defaultcourseroleid'] = 'Default role for users in a course'; $string['defaulthtmleditor'] = 'Default HTML editor'; diff --git a/lib/outputlib.php b/lib/outputlib.php index 0dc8a6504c..abdefd86d0 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -1869,14 +1869,16 @@ class moodle_core_renderer extends moodle_renderer_base { * @return string HTML fragment. */ public function standard_footer_html() { + global $CFG; + // This function is normally called from a layout.php file in {@link header()} // but some of the content won't be known until later, so we return a placeholder // for now. This will be replaced with the real content in {@link footer()}. $output = self::PERFORMANCE_INFO_TOKEN; - if (debugging('', DEBUG_DEVELOPER)) { + if (!empty($CFG->debugpageinfo)) { $output .= '
This page is: ' . $this->page->debug_summary() . '
'; } - if (debugging()) { + if (!empty($CFG->debugvalidators)) { $output .= '