course)) {
error("Course is misconfigured");
}
if (! $lesson = get_record("lesson", "id", $cm->instance)) {
error("Course module is incorrect");
}
require_login($course->id);
if ($action != 'continue') {
// All pages except for continue.php require teacher editing privs
if (!isteacheredit($lesson->course)) {
error('You must be a teacher with editing privileges to access this page.');
}
}
// set up some general variables
$usehtmleditor = can_use_html_editor();
$navigation = "";
if ($course->category) {
$navigation = "id\">$course->shortname ->";
}
$strlessons = get_string("modulenameplural", "lesson");
$strlesson = get_string("modulename", "lesson");
$strlessonname = $lesson->name;
// ... print the header and...
print_header("$course->shortname: ".format_string($lesson->name), "$course->fullname",
"$navigation id>$strlessons ->
id\">".format_string($lesson->name,true)."", "", "", true);
if ($action == 'continue' and isteacher($course->id)) {
$currenttab = 'navigation';
include('tabs.php');
}
// include the appropriate action (check to make sure the file is there first)
if (file_exists($CFG->dirroot.'/mod/lesson/action/'.$action.'.php')) {
include($CFG->dirroot.'/mod/lesson/action/'.$action.'.php');
} else {
error("Fatal Error: Unknown action\n");
}
print_footer($course);
?>