Skip to content

Commit

Permalink
MDL-14679 finished pagelib conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed May 30, 2008
1 parent ae040d4 commit 4a991ae
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/pagelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ function init_quick($data) {
// in init_quick() and instead deferred here. Of course this function had better recognize
// $this->full_init_done to prevent wasteful multiple-time data retrieval.
function init_full() {
global $COURSE;
global $COURSE, $DB;

if($this->full_init_done) {
return;
}
Expand All @@ -334,7 +335,7 @@ function init_full() {
if ($this->id == $COURSE->id) {
$this->courserecord = $COURSE;
} else {
$this->courserecord = get_record('course', 'id', $this->id);
$this->courserecord = $DB->get_record('course', 'id', $this->id);
}

if(empty($this->courserecord) && !defined('ADMIN_STICKYBLOCKS')) {
Expand Down Expand Up @@ -584,6 +585,8 @@ class page_generic_activity extends page_base {
var $activityrecord = NULL;

function init_full() {
global $DB;

if($this->full_init_done) {
return;
}
Expand All @@ -593,11 +596,11 @@ function init_full() {
if (!$this->modulerecord = get_coursemodule_from_instance($this->activityname, $this->id)) {
print_error('cannotinitpager', 'debug', '', array($this->activityname, $this->id));
}
$this->courserecord = get_record('course', 'id', $this->modulerecord->course);
$this->courserecord = $DB->get_record('course', array('id'=>$this->modulerecord->course));
if(empty($this->courserecord)) {
print_error('invalidcourseid');
}
$this->activityrecord = get_record($this->activityname, 'id', $this->id);
$this->activityrecord = $DB->get_record($this->activityname, array('id'=>$this->id));
if(empty($this->activityrecord)) {
print_error('cannotinitpager', 'debug', '', array($this->activityname, $this->id));
}
Expand Down

0 comments on commit 4a991ae

Please sign in to comment.