From 3983f2dcefd078ddc53d4ca2d3e3af8163489141 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sat, 18 Sep 2010 13:04:10 +0000 Subject: [PATCH] added missing globals, strange this seemed to work.... --- mod/lesson/locallib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index dd5b1b90ed6..24556317c17 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -70,7 +70,7 @@ define("LESSON_MAX_EVENT_LENGTH", "432000"); * This function is only executed when a teacher is * checking the navigation for a lesson. * - * @param int $lesson Id of the lesson that is to be checked. + * @param stdClass $lesson Id of the lesson that is to be checked. * @return boolean True or false. **/ function lesson_display_teacher_warning($lesson) { @@ -941,6 +941,8 @@ class lesson extends lesson_base { * @return lesson */ public static function load($lessonid) { + global $DB; + if (!$lesson = $DB->get_record('lesson', array('id' => $lessonid))) { print_error('invalidcoursemodule'); } @@ -1114,7 +1116,7 @@ class lesson extends lesson_base { * @return bool */ public function get_next_page($nextpageid) { - global $USER; + global $USER, $DB; $allpages = $this->load_all_pages(); if ($this->properties->nextpagedefault) { // in Flash Card mode...first get number of retakes