*/
$wgDebugLogGroups = array();
+/**
+ * Display debug data at the bottom of the main content area.
+ *
+ * Useful for developers and technical users trying to working on a closed wiki.
+ */
+$wgShowDebug = false;
+
/**
* Show the contents of $wgHooks in Special:Version
*/
return $data;
}
+ /**
+ * Generate debug data HTML for displaying at the bottom of the main content
+ * area.
+ * @return String HTML containing debug data, if enabled (otherwise empty).
+ */
+ protected function generateDebugHTML() {
+ global $wgShowDebug, $wgOut;
+ if ( $wgShowDebug ) {
+ $listInternals = str_replace( "\n", "</li>\n<li>", htmlspecialchars( $wgOut->mDebugtext ) );
+ return "\n<hr>\n<strong>Debug data:</strong><ul style=\"font-family:monospace;\"><li>" .
+ $listInternals . "</li></ul>\n";
+ }
+ return '';
+ }
+
/**
* This gets called shortly before the </body> tag.
* @return String HTML to be put before </body>
*/
function afterContent() {
$printfooter = "<div class=\"printfooter\">\n" . $this->printFooter() . "</div>\n";
- return $printfooter . $this->doAfterContent();
+ return $this->generateDebugHTML() . $printfooter . $this->doAfterContent();
}
/**
$tpl->set( 'bottomscripts', $this->bottomScripts() );
$printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n";
- $out->mBodytext .= $printfooter ;
+ $out->mBodytext .= $printfooter . $this->generateDebugHTML();
$tpl->setRef( 'bodytext', $out->mBodytext );
# Language links