moodle/mod/lesson/lesson.php

70 lines
2.0 KiB
PHP
Raw Normal View History

<?PHP // $Id: lesson.php, v 1.0 25 Jan 2004
/*************************************************
2005-03-05 00:09:39 +00:00
ACTIONS handled are:
2005-03-05 00:09:39 +00:00
addbranchtable
2004-03-27 04:15:29 +00:00
addendofbranch
2005-03-05 00:09:39 +00:00
addcluster /// CDC-FLAG /// added two new items
addendofcluster
2004-03-27 04:15:29 +00:00
addpage
confirmdelete
continue
2005-03-05 00:09:39 +00:00
delete
editpage
insertpage
move
2005-03-05 00:09:39 +00:00
moveit
updatepage
************************************************/
require("../../config.php");
2005-03-05 00:09:39 +00:00
require("locallib.php");
$id = required_param('id', PARAM_INT); // Course Module ID
$action = required_param('action', PARAM_ALPHA); // Action
2005-02-23 00:52:29 +00:00
// get some esential stuff...
2005-03-05 00:09:39 +00:00
if (! $cm = get_record("course_modules", "id", $id)) {
error("Course Module ID was incorrect");
}
2005-03-05 00:09:39 +00:00
if (! $course = get_record("course", "id", $cm->course)) {
error("Course is misconfigured");
}
2005-03-05 00:09:39 +00:00
if (! $lesson = get_record("lesson", "id", $cm->instance)) {
error("Course module is incorrect");
}
2005-02-23 00:52:29 +00:00
require_login($course->id);
2005-03-05 00:09:39 +00:00
// set up some general variables
$usehtmleditor = can_use_html_editor();
2005-02-23 00:52:29 +00:00
$navigation = "";
if ($course->category) {
$navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
}
$strlessons = get_string("modulenameplural", "lesson");
$strlesson = get_string("modulename", "lesson");
$strlessonname = $lesson->name;
2005-03-05 00:09:39 +00:00
// ... print the header and...
print_header("$course->shortname: $lesson->name", "$course->fullname",
"$navigation <a href=index.php?id=$course->id>$strlessons</a> ->
<a href=\"view.php?id=$cm->id\">$lesson->name</a>", "", "", true);
// 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");
}
2005-03-05 00:09:39 +00:00
print_footer($course);
2005-02-23 00:52:29 +00:00
?>