]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19943 new debug optiosn for validators link and page info in footer
authorskodak <skodak>
Mon, 27 Jul 2009 20:36:28 +0000 (20:36 +0000)
committerskodak <skodak>
Mon, 27 Jul 2009 20:36:28 +0000 (20:36 +0000)
admin/settings/server.php
lang/en_utf8/admin.php
lib/outputlib.php
lib/setup.php
version.php

index 74f77d93fd07ee2f6236db02d8bd1c5ca502db44..29e20dde42820e42d11d8cab790997c1b423dd37 100644 (file)
@@ -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);
 
 
index c403e9fd9d3063748f304b234b0ea592cdac65ad..1f2674773279a32a91c11a2b73cb2c6628ffc7ee 100644 (file)
@@ -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 <em>w3cvalidator</em>, 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 <b>when the course is created</b>?';
 $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';
index 0dc8a6504c979fe1d56cfc4f49344fbbcf55498b..abdefd86d0169b49ffdcbee0c8db899216927587 100644 (file)
@@ -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 .= '<div class="performanceinfo">This page is: ' . $this->page->debug_summary() . '</div>';
         }
-        if (debugging()) {
+        if (!empty($CFG->debugvalidators)) {
             $output .= '<div class="validators"><ul>
               <li><a href="http://validator.w3.org/check?verbose=1&amp;ss=1&amp;uri=' . urlencode(qualified_me()) . '">Validate HTML</a></li>
               <li><a href="http://www.contentquality.com/mynewtester/cynthia.exe?rptmode=-1&amp;url1=' . urlencode(qualified_me()) . '">Section 508 Check</a></li>
index bedd57cf7d6c7accbd63de28c26de097bbc6beb4..e1a289292d5e9ace052318e07830dd801213d551 100644 (file)
@@ -574,7 +574,7 @@ global $SCRIPT;
     // fix a few bugs where scripts do not initialise thigns properly, wihtout causing
     // too much grief.
 
-    if (!empty($CFG->guestloginbutton)) {
+    if (!empty($CFG->debugvalidators) and !empty($CFG->guestloginbutton)) {
         if ($CFG->theme == 'standard' or $CFG->theme == 'standardwhite') {    // Temporary measure to help with XHTML validation
             if (isset($_SERVER['HTTP_USER_AGENT']) and empty($USER->id)) {      // Allow W3CValidator in as user called w3cvalidator (or guest)
                 if ((strpos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') !== false) or
index 1180966b9c20ec695611f477d1f131b66e451f1b..8c5a661e8c02c2fafe367af476f0981bbd981556 100644 (file)
@@ -6,7 +6,7 @@
 // This is compared against the values stored in the database to determine
 // whether upgrades should be performed (see lib/db/*.php)
 
-    $version = 2009072400;  // YYYYMMDD   = date of the last version bump
+    $version = 2009072700;  // YYYYMMDD   = date of the last version bump
                             //         XX = daily increments
 
     $release = '2.0 dev (Build: 20090727)';  // Human-friendly version name