BugFix for MDL-6730: now blank lessons redirect to edit.php where the user is prompted by a menu of options.

This commit is contained in:
mark-nielsen 2006-09-30 19:00:07 +00:00
parent 6c89dc5514
commit b3b4bc44ce

View File

@ -179,7 +179,7 @@
lesson_set_message(get_string('lessonnotready', 'lesson', $course->teacher)); // a nice message to the student
} else {
if (!count_records('lesson_pages', 'lessonid', $lesson->id)) {
redirect("$CFG->wwwroot/mod/lesson/lesson.php?id=$cm->id&action=addpage&pageid=0"); // no pages - redirect to add pages
redirect("$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id"); // no pages - redirect to add pages
} else {
lesson_set_message(get_string('lessonpagelinkingbroken', 'lesson')); // ok, bad mojo
}
@ -413,8 +413,6 @@
}
}
// check to see if the user can see the left menu
if (!has_capability('mod/lesson:manage', $context)) {
$lesson->displayleft = lesson_displayleftif($lesson);