]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14679 finished pagelib conversion
authorskodak <skodak>
Fri, 30 May 2008 20:02:55 +0000 (20:02 +0000)
committerskodak <skodak>
Fri, 30 May 2008 20:02:55 +0000 (20:02 +0000)
lib/pagelib.php

index 7477f58655327dbd9e681267def09b4edfc268ac..089cd7d03530d77aeab0c8fd44e6cb178d606f12 100644 (file)
@@ -324,7 +324,8 @@ class page_course extends page_base {
     // 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;
         }
@@ -334,7 +335,7 @@ class page_course extends page_base {
         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')) {
@@ -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;
         }
@@ -593,11 +596,11 @@ class page_generic_activity extends page_base {
         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));
         }