mirror of
https://github.com/moodle/moodle.git
synced 2025-02-15 21:36:58 +01:00
Header is not printed for all actions. Related to MDL-5403 Some redundant code removed First attempt at separating logic and presentation in action continue (continue.html)
63 lines
1.5 KiB
PHP
63 lines
1.5 KiB
PHP
<?PHP // $Id: lesson.php, v 1.0 25 Jan 2004
|
|
|
|
/*************************************************
|
|
ACTIONS handled are:
|
|
|
|
addbranchtable
|
|
addendofbranch
|
|
addcluster
|
|
addendofcluster
|
|
addpage
|
|
confirmdelete
|
|
continue
|
|
delete
|
|
editpage
|
|
insertpage
|
|
move
|
|
moveit
|
|
updatepage
|
|
|
|
************************************************/
|
|
|
|
require("../../config.php");
|
|
require("locallib.php");
|
|
|
|
$id = required_param('id', PARAM_INT); // Course Module ID
|
|
$action = required_param('action', PARAM_ALPHA); // Action
|
|
|
|
list($cm, $course, $lesson) = lesson_get_basics($id);
|
|
|
|
require_login($course->id);
|
|
|
|
/// Set up some general variables
|
|
$usehtmleditor = can_use_html_editor();
|
|
|
|
/// Process the action
|
|
switch ($action) {
|
|
case 'addbranchtable':
|
|
case 'addpage':
|
|
case 'confirmdelete':
|
|
case 'editpage':
|
|
case 'move':
|
|
lesson_print_header($cm, $course, $lesson, '', false);
|
|
case 'addcluster':
|
|
case 'addendofbranch':
|
|
case 'addendofcluster':
|
|
case 'delete':
|
|
case 'insertpage':
|
|
case 'updatepage':
|
|
case 'moveit':
|
|
if (!isteacheredit($course->id)) {
|
|
error('You must be a teacher with editing privileges to access this page.');
|
|
}
|
|
case 'continue':
|
|
include($CFG->dirroot.'/mod/lesson/action/'.$action.'.php');
|
|
break;
|
|
default:
|
|
error("Fatal Error: Unknown action\n");
|
|
}
|
|
|
|
print_footer($course);
|
|
|
|
?>
|