mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-58428 renderer: Move renderer override from maintenance
This commit is contained in:
parent
1c78866f44
commit
0976e4cf5e
@ -4840,6 +4840,7 @@ class core_renderer_maintenance extends core_renderer {
|
||||
|
||||
/**
|
||||
* Initialises the renderer instance.
|
||||
*
|
||||
* @param moodle_page $page
|
||||
* @param string $target
|
||||
* @throws coding_exception
|
||||
@ -4859,8 +4860,6 @@ class core_renderer_maintenance extends core_renderer {
|
||||
* @return string
|
||||
*/
|
||||
public function block(block_contents $bc, $region) {
|
||||
// Computer says no blocks.
|
||||
// debugging('Please do not use $OUTPUT->'.__FUNCTION__.'() when performing maintenance tasks.', DEBUG_DEVELOPER);
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -4873,8 +4872,6 @@ class core_renderer_maintenance extends core_renderer {
|
||||
* @return string
|
||||
*/
|
||||
public function blocks($region, $classes = array(), $tag = 'aside') {
|
||||
// Computer says no blocks.
|
||||
// debugging('Please do not use $OUTPUT->'.__FUNCTION__.'() when performing maintenance tasks.', DEBUG_DEVELOPER);
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -4885,8 +4882,6 @@ class core_renderer_maintenance extends core_renderer {
|
||||
* @return string
|
||||
*/
|
||||
public function blocks_for_region($region) {
|
||||
// Computer says no blocks for region.
|
||||
// debugging('Please do not use $OUTPUT->'.__FUNCTION__.'() when performing maintenance tasks.', DEBUG_DEVELOPER);
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -4897,8 +4892,6 @@ class core_renderer_maintenance extends core_renderer {
|
||||
* @return string
|
||||
*/
|
||||
public function course_content_header($onlyifnotcalledbefore = false) {
|
||||
// Computer says no course content header.
|
||||
// debugging('Please do not use $OUTPUT->'.__FUNCTION__.'() when performing maintenance tasks.', DEBUG_DEVELOPER);
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -4909,8 +4902,6 @@ class core_renderer_maintenance extends core_renderer {
|
||||
* @return string
|
||||
*/
|
||||
public function course_content_footer($onlyifnotcalledbefore = false) {
|
||||
// Computer says no course content footer.
|
||||
// debugging('Please do not use $OUTPUT->'.__FUNCTION__.'() when performing maintenance tasks.', DEBUG_DEVELOPER);
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -4920,8 +4911,6 @@ class core_renderer_maintenance extends core_renderer {
|
||||
* @return string
|
||||
*/
|
||||
public function course_header() {
|
||||
// Computer says no course header.
|
||||
// debugging('Please do not use $OUTPUT->'.__FUNCTION__.'() when performing maintenance tasks.', DEBUG_DEVELOPER);
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -4931,8 +4920,6 @@ class core_renderer_maintenance extends core_renderer {
|
||||
* @return string
|
||||
*/
|
||||
public function course_footer() {
|
||||
// Computer says no course footer.
|
||||
// debugging('Please do not use $OUTPUT->'.__FUNCTION__.'() when performing maintenance tasks.', DEBUG_DEVELOPER);
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -4943,8 +4930,6 @@ class core_renderer_maintenance extends core_renderer {
|
||||
* @return string
|
||||
*/
|
||||
public function custom_menu($custommenuitems = '') {
|
||||
// Computer says no custom menu.
|
||||
// debugging('Please do not use $OUTPUT->'.__FUNCTION__.'() when performing maintenance tasks.', DEBUG_DEVELOPER);
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -4955,8 +4940,6 @@ class core_renderer_maintenance extends core_renderer {
|
||||
* @return string
|
||||
*/
|
||||
public function file_picker($options) {
|
||||
// Computer says no file picker.
|
||||
// debugging('Please do not use $OUTPUT->'.__FUNCTION__.'() when performing maintenance tasks.', DEBUG_DEVELOPER);
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -4967,9 +4950,6 @@ class core_renderer_maintenance extends core_renderer {
|
||||
* @return string
|
||||
*/
|
||||
public function htmllize_file_tree($dir) {
|
||||
// Hell no we don't want no htmllized file tree.
|
||||
// Also why on earth is this function on the core renderer???
|
||||
// debugging('Please do not use $OUTPUT->'.__FUNCTION__.'() when performing maintenance tasks.', DEBUG_DEVELOPER);
|
||||
return '';
|
||||
|
||||
}
|
||||
@ -5021,8 +5001,7 @@ class core_renderer_maintenance extends core_renderer {
|
||||
* @param block_contents $bc
|
||||
*/
|
||||
public function init_block_hider_js(block_contents $bc) {
|
||||
// Computer says no JavaScript.
|
||||
// Do nothing, ridiculous method.
|
||||
// Does nothing.
|
||||
}
|
||||
|
||||
/**
|
||||
@ -5031,8 +5010,6 @@ class core_renderer_maintenance extends core_renderer {
|
||||
* @return string
|
||||
*/
|
||||
public function lang_menu() {
|
||||
// Computer says no lang menu.
|
||||
// debugging('Please do not use $OUTPUT->'.__FUNCTION__.'() when performing maintenance tasks.', DEBUG_DEVELOPER);
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -5043,8 +5020,6 @@ class core_renderer_maintenance extends core_renderer {
|
||||
* @return string
|
||||
*/
|
||||
public function login_info($withlinks = null) {
|
||||
// Computer says no login info.
|
||||
// debugging('Please do not use $OUTPUT->'.__FUNCTION__.'() when performing maintenance tasks.', DEBUG_DEVELOPER);
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -5056,8 +5031,6 @@ class core_renderer_maintenance extends core_renderer {
|
||||
* @return string
|
||||
*/
|
||||
public function user_picture(stdClass $user, array $options = null) {
|
||||
// Computer says no user pictures.
|
||||
// debugging('Please do not use $OUTPUT->'.__FUNCTION__.'() when performing maintenance tasks.', DEBUG_DEVELOPER);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
@ -1,197 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
/**
|
||||
* Overriden core maintenance renderer.
|
||||
*
|
||||
* @package theme_boost
|
||||
* @copyright 2016 Frédéric Massart - FMCorz.net
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace theme_boost\output;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use coding_exception;
|
||||
use moodle_page;
|
||||
use block_contents;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* The maintenance renderer.
|
||||
*
|
||||
* @package theme_boost
|
||||
* @copyright 2016 Frédéric Massart - FMCorz.net
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class core_renderer_maintenance extends core_renderer {
|
||||
|
||||
/**
|
||||
* Initialises the renderer instance.
|
||||
*
|
||||
* @param moodle_page $page
|
||||
* @param string $target
|
||||
* @throws coding_exception
|
||||
*/
|
||||
public function __construct(moodle_page $page, $target) {
|
||||
if ($target !== RENDERER_TARGET_MAINTENANCE || $page->pagelayout !== 'maintenance') {
|
||||
throw new coding_exception('Invalid request for the maintenance renderer.');
|
||||
}
|
||||
parent::__construct($page, $target);
|
||||
}
|
||||
|
||||
/**
|
||||
* Does nothing. The maintenance renderer cannot produce blocks.
|
||||
*
|
||||
* @param block_contents $bc
|
||||
* @param string $region
|
||||
* @return string
|
||||
*/
|
||||
public function block(block_contents $bc, $region) {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Does nothing. The maintenance renderer cannot produce blocks.
|
||||
*
|
||||
* @param string $region
|
||||
* @param array $classes
|
||||
* @param string $tag
|
||||
* @return string
|
||||
*/
|
||||
public function blocks($region, $classes = array(), $tag = 'aside') {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Does nothing. The maintenance renderer cannot produce blocks.
|
||||
*
|
||||
* @param string $region
|
||||
* @return string
|
||||
*/
|
||||
public function blocks_for_region($region) {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Does nothing. The maintenance renderer cannot produce a course content header.
|
||||
*
|
||||
* @param bool $onlyifnotcalledbefore
|
||||
* @return string
|
||||
*/
|
||||
public function course_content_header($onlyifnotcalledbefore = false) {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Does nothing. The maintenance renderer cannot produce a course content footer.
|
||||
*
|
||||
* @param bool $onlyifnotcalledbefore
|
||||
* @return string
|
||||
*/
|
||||
public function course_content_footer($onlyifnotcalledbefore = false) {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Does nothing. The maintenance renderer cannot produce a course header.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function course_header() {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Does nothing. The maintenance renderer cannot produce a course footer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function course_footer() {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Does nothing. The maintenance renderer cannot produce a custom menu.
|
||||
*
|
||||
* @param string $custommenuitems
|
||||
* @return string
|
||||
*/
|
||||
public function custom_menu($custommenuitems = '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Does nothing. The maintenance renderer cannot produce a file picker.
|
||||
*
|
||||
* @param array $options
|
||||
* @return string
|
||||
*/
|
||||
public function file_picker($options) {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Does nothing. The maintenance renderer cannot produce and HTML file tree.
|
||||
*
|
||||
* @param array $dir
|
||||
* @return string
|
||||
*/
|
||||
public function htmllize_file_tree($dir) {
|
||||
return '';
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Does nothing. The maintenance renderer does not support JS.
|
||||
*
|
||||
* @param block_contents $bc
|
||||
*/
|
||||
public function init_block_hider_js(block_contents $bc) {
|
||||
// Does nothing.
|
||||
}
|
||||
|
||||
/**
|
||||
* Does nothing. The maintenance renderer cannot produce language menus.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function lang_menu() {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Does nothing. The maintenance renderer has no need for login information.
|
||||
*
|
||||
* @param null $withlinks
|
||||
* @return string
|
||||
*/
|
||||
public function login_info($withlinks = null) {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Does nothing. The maintenance renderer cannot produce user pictures.
|
||||
*
|
||||
* @param stdClass $user
|
||||
* @param array $options
|
||||
* @return string
|
||||
*/
|
||||
public function user_picture(stdClass $user, array $options = null) {
|
||||
return '';
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user