MDL-11082 Improved groups upgrade performance 1.8x -> 1.9; thanks Eloy for telling...
[moodle-pu.git] / mod / lesson / lesson.php
blob902bae5b2096da6da63b16212483bed9df31eda0
1 <?php // $Id: lesson.php, v 1.0 25 Jan 2004
2 /**
3 * Handles lesson actions
4 *
5 * ACTIONS handled are:
6 * addbranchtable
7 * addendofbranch
8 * addcluster
9 * addendofcluster
10 * addpage
11 * confirmdelete
12 * continue
13 * delete
14 * editpage
15 * insertpage
16 * move
17 * moveit
18 * updatepage
19 * @version $Id$
20 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
21 * @package lesson
22 **/
24 require("../../config.php");
25 require("locallib.php");
27 $id = required_param('id', PARAM_INT); // Course Module ID
28 $action = required_param('action', PARAM_ALPHA); // Action
30 list($cm, $course, $lesson) = lesson_get_basics($id);
32 require_login($course->id);
33 $context = get_context_instance(CONTEXT_MODULE, $cm->id);
35 /// Set up some general variables
36 $usehtmleditor = can_use_html_editor();
38 /// Process the action
39 switch ($action) {
40 case 'addbranchtable':
41 case 'addpage':
42 case 'confirmdelete':
43 case 'editpage':
44 case 'move':
45 lesson_print_header($cm, $course, $lesson);
46 case 'addcluster':
47 case 'addendofbranch':
48 case 'addendofcluster':
49 case 'delete':
50 case 'insertpage':
51 case 'updatepage':
52 case 'moveit':
53 require_capability('mod/lesson:edit', $context);
54 case 'continue':
55 include($CFG->dirroot.'/mod/lesson/action/'.$action.'.php');
56 break;
57 default:
58 error("Fatal Error: Unknown action\n");
61 print_footer($course);