From: stronk7 <stronk7>
Date: Sun, 22 Feb 2004 19:10:23 +0000 (+0000)
Subject: Some minor changes because the:
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e8ba6e60280f8e92bc219d57c6adaf18488909bc;p=moodle.git

Some minor changes because the:
/mod/lesson/view.php?id=XXX&action=navigation&pageid=ZZZZZ
was not working fine.
I'm not really sure if the modifications I've done (basically removing
POST['pageid'] use has other implications.
So, Ray, if you can check it....
Ciao :-)
---

diff --git a/mod/lesson/view.php b/mod/lesson/view.php
index c9484b785e..7120d32d4d 100644
--- a/mod/lesson/view.php
+++ b/mod/lesson/view.php
@@ -7,6 +7,7 @@
     require_once("lib.php");
 
     require_variable($id);    // Course Module ID
+    optional_variable($pageid);    // Lesson Page ID
 
     if (! $cm = get_record("course_modules", "id", $id)) {
         error("Course Module ID was incorrect");
@@ -59,7 +60,7 @@
         // display individual pages and their sets of answers
         // if pageid is EOL then the end of the lesson has been reached
         print_heading($lesson->name);
-		if (empty($_POST['pageid'])) {
+	if (empty($pageid)) {
             add_to_log($course->id, "lesson", "start", "view.php?id=$cm->id", "$lesson->id", $cm->id);
             // if no pageid given see if the lesson has been started
             if ($grades = get_records_select("lesson_grades", "lessonid = $lesson->id AND userid = $USER->id",
@@ -125,11 +126,9 @@
                 }
             }
             // start at the first page
-			if (!$pageid = get_field("lesson_pages", "id", "lessonid", $lesson->id, "prevpageid", 0)) {
+            if (!$pageid = get_field("lesson_pages", "id", "lessonid", $lesson->id, "prevpageid", 0)) {
                 error("Navigation: first page not found");
             }
-		} else {
-            $pageid = $_POST['pageid'];
         }
         if ($pageid != EOL) {
             add_to_log($course->id, "lesson", "view", "view.php?id=$cm->id&action=navigation&pageid=$pageid", "$pageid", $cm->id);