mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-19010: In developer debug mode, print information about this page in the footer.
This commit is contained in:
parent
cb4f6179d5
commit
2c0901cb5a
3 changed files with 48 additions and 43 deletions
|
@ -1718,6 +1718,9 @@ class moodle_core_renderer extends moodle_renderer_base {
|
|||
// 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)) {
|
||||
$output .= '<div class="performanceinfo">This page is: ' . $this->page->debug_summary() . '</div>';
|
||||
}
|
||||
if (debugging()) {
|
||||
$output .= '<div class="validators"><ul>
|
||||
<li><a href="http://validator.w3.org/check?verbose=1&ss=1&uri=' . urlencode(qualified_me()) . '">Validate HTML</a></li>
|
||||
|
|
|
@ -482,6 +482,18 @@ class moodle_page {
|
|||
return has_any_capability($this->all_editing_caps(), $this->context);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string a description of this page (context, page-type and sub-page.
|
||||
*/
|
||||
public function debug_summary() {
|
||||
$summary = 'Context ' . print_context_name($this->context) . ' (context id ' . $this->context->id . '). ';
|
||||
$summary .= 'Page type ' . $this->pagetype . '. ';
|
||||
if ($this->subpage) {
|
||||
'Sub-page ' . $this->subpage . '. ';
|
||||
}
|
||||
return $summary;
|
||||
}
|
||||
|
||||
/// Setter methods =============================================================
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue