Permalink
Browse files

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

…ockmanagerclass
  • Loading branch information...
1 parent c92d6f4 commit 3edc37cb137470569ad5b748f71a7e1d6c03df73 @skodak skodak committed Aug 15, 2012
Showing with 9 additions and 1 deletion.
  1. +3 −1 config-dist.php
  2. +3 −0 lib/pagelib.php
  3. +3 −0 lib/setup.php
View
@@ -211,10 +211,12 @@
// 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.
View
@@ -578,6 +578,9 @@ protected function magic_get_blocks() {
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';
View
@@ -791,6 +791,9 @@ function stripslashes_deep($value) {
// 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';

0 comments on commit 3edc37c

Please sign in to comment.