blocklib: MDL-19010 move the check for whether the right database tables exist to a place where it is better encapsulated.

This commit is contained in:
tjhunt
2009-05-07 02:56:48 +00:00
parent 3aceb097a2
commit d19e819597
2 changed files with 8 additions and 5 deletions
+7 -1
View File
@@ -247,12 +247,18 @@ class block_manager implements ArrayAccess {
* This method actually loads the blocks for our page from the database.
*/
public function load_blocks($includeinvisible = NULL) {
global $DB;
global $DB, $CFG;
if (!is_null($this->birecordsbyregion)) {
// Already done.
return;
}
if ($CFG->version < 2009050619) {
// Upgrade/install not complete. Don't try too show any blocks.
$this->birecordsbyregion = array();
return;
}
if (is_null($includeinvisible)) {
$includeinvisible = $this->page->user_is_editing();
}