Skip to content

Commit

Permalink
MDL-19943 new debug optiosn for validators link and page info in footer
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jul 27, 2009
1 parent 3c13104 commit 360dde5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions admin/settings/server.php
Expand Up @@ -100,6 +100,8 @@
$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);


Expand Down
4 changes: 4 additions & 0 deletions lang/en_utf8/admin.php
Expand Up @@ -114,7 +114,9 @@
$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.';
Expand Down Expand Up @@ -345,6 +347,8 @@
$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';
Expand Down
6 changes: 4 additions & 2 deletions lib/outputlib.php
Expand Up @@ -1869,14 +1869,16 @@ public function standard_top_of_body_html() {
* @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>
Expand Down
2 changes: 1 addition & 1 deletion lib/setup.php
Expand Up @@ -574,7 +574,7 @@ function stripslashes_deep($value) {
// 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
Expand Down
2 changes: 1 addition & 1 deletion version.php
Expand Up @@ -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

0 comments on commit 360dde5

Please sign in to comment.