Commit 3edc37cb authored by Petr Škoda's avatar Petr Škoda
Browse files

MDL-34740 add class file option to $CFG->moodlepageclass and $CFG->blockmanagerclass

parent c92d6f41
......@@ -211,10 +211,12 @@ $CFG->admin = 'admin';
// You can specify a different class to be created for the $PAGE global, and to
// compute which blocks appear on each page. However, I cannot think of any good
// reason why you would need to change that. It just felt wrong to hard-code the
// the class name. You are stronly advised not to use these to settings unless
// the class name. You are strongly advised not to use these to settings unless
// you are absolutely sure you know what you are doing.
// $CFG->moodlepageclass = 'moodle_page';
// $CFG->moodlepageclassfile = "$CFG->dirroot/local/myplugin/mypageclass.php";
// $CFG->blockmanagerclass = 'block_manager';
// $CFG->blockmanagerclassfile = "$CFG->dirroot/local/myplugin/myblockamanagerclass.php";
//
// Seconds for files to remain in caches. Decrease this if you are worried
// about students being served outdated versions of uploaded files.
......
......@@ -578,6 +578,9 @@ class moodle_page {
global $CFG;
if (is_null($this->_blocks)) {
if (!empty($CFG->blockmanagerclass)) {
if (!empty($CFG->blockmanagerclassfile)) {
require_once($CFG->blockmanagerclassfile);
}
$classname = $CFG->blockmanagerclass;
} else {
$classname = 'block_manager';
......
......@@ -791,6 +791,9 @@ moodle_setlocale();
// Create the $PAGE global - this marks the PAGE and OUTPUT fully initialised, this MUST be done at the end of setup!
if (!empty($CFG->moodlepageclass)) {
if (!empty($CFG->moodlepageclassfile)) {
require_once($CFG->moodlepageclassfile);
}
$classname = $CFG->moodlepageclass;
} else {
$classname = 'moodle_page';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment