From: rkingdon Date: Tue, 17 Feb 2004 00:54:10 +0000 (+0000) Subject: Only teacher's with edit privileges see the edit links; Navigation now X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=667c5e9199bdbcc87395a7699f9c81d0d87bd5b2;p=moodle.git Only teacher's with edit privileges see the edit links; Navigation now uses POSTS rather than GETS. --- diff --git a/mod/lesson/lesson.php b/mod/lesson/lesson.php index 54618e65a7..96ef5a8f27 100644 --- a/mod/lesson/lesson.php +++ b/mod/lesson/lesson.php @@ -217,12 +217,14 @@ echo "
\n"; print_simple_box(format_text($answer->response), 'center'); echo "
\n"; - print_continue("view.php?id=$cm->id&action=navigation&pageid=$newpageid"); - } else { - // there's no response text - just go straight to the next page - redirect("lesson.php?id=$cm->id&action=navigation&pageid=$newpageid", - get_string("continue")); } + echo "
\n"; + echo "id\">\n"; + echo "\n"; + echo "\n"; + echo "

\n"; + echo "
\n"; } } diff --git a/mod/lesson/view.php b/mod/lesson/view.php index 59c90f94b8..964de2c72c 100644 --- a/mod/lesson/view.php +++ b/mod/lesson/view.php @@ -59,7 +59,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($_GET['pageid'])) { + if (empty($_POST['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", @@ -122,7 +122,7 @@ error("Navigation: first page not found"); } } else { - $pageid = $_GET['pageid']; + $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); @@ -155,11 +155,17 @@ echo "\n"; } else { // a page without answers - find the next (logical) page + echo "
\n"; + echo "id\">\n"; + echo "\n"; if (!$newpageid = get_field("lesson_pages", "nextpageid", "id", $pageid)) { // this is the last page - flag end of lesson $newpageid = EOL; } - print_continue("view.php?id=$cm->id&action=navigation&pageid=$newpageid"); + echo "\n"; + echo "

\n"; + echo "
\n"; } echo "\n"; } else { @@ -266,19 +272,24 @@ } else { // print the pages echo "
\n"; - echo "\n"; + } + echo "
id&action=addpage&pageid=0\">". - get_string("addpagehere", "lesson")."
\n"; + if (isteacheredit($course>id)) { + echo "
id&action=addpage&pageid=0\">". + get_string("addpagehere", "lesson")."
\n"; while (true) { echo "\n"; + if (isteacheredit($course->id)) { + if ($npages > 1) { + echo "id&action=move&pageid=$page->id\">\n". + "\n"; + } + echo "id&action=editpage&pageid=$page->id\">\n". + "\n". + "id&action=confirmdelete&pageid=$page->id\">\n". + "\n"; + } + echo "\n"; echo "\n"; @@ -318,8 +329,12 @@ } // print_simple_box_end(); } - echo "
cellheading2\" colspan=\"2\">$page->title  \n"; - if ($npages > 1) { - echo "id&action=move&pageid=$page->id\">\n". - "\n"; - } - echo "id&action=editpage&pageid=$page->id\">\n". - "\n". - "id&action=confirmdelete&pageid=$page->id\">\n". - "". - "
\n"; print_simple_box(format_text($page->contents), "center"); echo "
id&action=addpage&pageid=$page->id\">". - get_string("addpagehere", "lesson")."
\n"; + echo "
\n"; + if (isteacheredit($course->id)) { + echo "id&action=addpage&pageid=$page->id\">". + get_string("addpagehere", "lesson")."\n"; + } + echo "\n"; if ($page->nextpageid) { if (!$page = get_record("lesson_pages", "id", $page->nextpageid)) { error("Teacher view: Next page not found!");