mirror of
https://github.com/moodle/moodle.git
synced 2025-06-02 06:05:31 +02:00
fixed coding style to match other modules
This commit is contained in:
parent
d16d35dc80
commit
b3daa92632
@ -27,13 +27,11 @@
|
||||
require_once("../../config.php");
|
||||
require_once($CFG->dirroot.'/mod/lesson/locallib.php');
|
||||
|
||||
try {
|
||||
$cm = get_coursemodule_from_id('lesson', required_param('id', PARAM_INT), 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
} catch (Exception $e) {
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
$id = required_param('id', PARAM_INT);
|
||||
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
|
||||
require_login($course, false, $cm);
|
||||
require_sesskey();
|
||||
|
@ -26,13 +26,12 @@
|
||||
require_once('../../config.php');
|
||||
require_once($CFG->dirroot.'/mod/lesson/locallib.php');
|
||||
|
||||
try {
|
||||
$cm = get_coursemodule_from_id('lesson', required_param('id', PARAM_INT), 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
} catch (Exception $e) {
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
$id = required_param('id', PARAM_INT);
|
||||
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
|
||||
require_login($course, false, $cm);
|
||||
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
|
@ -33,13 +33,10 @@ $id = required_param('id', PARAM_INT); // Course Module ID
|
||||
$qtype = optional_param('qtype', 0, PARAM_INT);
|
||||
$edit = optional_param('edit', false, PARAM_BOOL);
|
||||
|
||||
try {
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
} catch (Exception $e) {
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
|
||||
require_login($course, false, $cm);
|
||||
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
|
@ -30,13 +30,11 @@ require_once($CFG->libdir.'/eventslib.php');
|
||||
|
||||
$id = required_param('id', PARAM_INT); // Course Module ID
|
||||
$mode = optional_param('mode', 'display', PARAM_ALPHA);
|
||||
try {
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
} catch (Exception $e) {
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
|
||||
require_login($course, false, $cm);
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
require_capability('mod/lesson:edit', $context);
|
||||
|
@ -29,13 +29,12 @@
|
||||
require_once("../../config.php");
|
||||
require_once($CFG->dirroot.'/mod/lesson/locallib.php');
|
||||
|
||||
try {
|
||||
$cm = get_coursemodule_from_id('lesson', required_param('id', PARAM_INT), 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
} catch (Exception $e) {
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
$id = required_param('id', PARAM_INT);
|
||||
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
|
||||
require_login($course, false, $cm);
|
||||
|
||||
$PAGE->set_url('/mod/lesson/grade.php', array('id'=>$cm->id));
|
||||
|
@ -31,13 +31,10 @@ $id = required_param('id', PARAM_INT); // Course Module ID
|
||||
$mode = optional_param('mode', '', PARAM_ALPHA);
|
||||
$link = optional_param('link', 0, PARAM_INT);
|
||||
|
||||
try {
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
} catch (Exception $e) {
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
|
||||
require_login($course, false, $cm);
|
||||
|
||||
$url = new moodle_url('/mod/lesson/highscores.php', array('id'=>$id));
|
||||
|
@ -34,13 +34,10 @@ $pageid = optional_param('pageid', '', PARAM_INT); // Page ID
|
||||
|
||||
$PAGE->set_url('/mod/lesson/import.php', array('id'=>$id, 'pageid'=>$pageid));
|
||||
|
||||
try {
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
} catch (Exception $e) {
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
|
||||
require_login($course, false, $cm);
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
require_capability('mod/lesson:edit', $context);
|
||||
|
@ -43,13 +43,10 @@ if ($pageid !== '') {
|
||||
}
|
||||
$PAGE->set_url($url);
|
||||
|
||||
try {
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
} catch (Exception $e) {
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
|
||||
$modname = 'lesson';
|
||||
$mod = $cm;
|
||||
require_login($course, false, $cm);
|
||||
|
@ -35,13 +35,10 @@ $id = required_param('id', PARAM_INT); // Course Module ID
|
||||
$action = required_param('action', PARAM_ALPHA); // Action
|
||||
$pageid = required_param('pageid', PARAM_INT);
|
||||
|
||||
try {
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
} catch (Exception $e) {
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
|
||||
require_login($course, false, $cm);
|
||||
|
||||
$url = new moodle_url('/mod/lesson/lesson.php', array('id'=>$id,'action'=>$action));
|
||||
|
@ -38,13 +38,10 @@ if ($printclose !== '') {
|
||||
}
|
||||
$PAGE->set_url($url);
|
||||
|
||||
try {
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
} catch (Exception $e) {
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
|
||||
require_login($course, false, $cm);
|
||||
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
|
@ -31,13 +31,10 @@ $pageid = optional_param('pageid', NULL, PARAM_INT); // Lesson Page ID
|
||||
$action = optional_param('action', 'reportoverview', PARAM_ALPHA); // action to take
|
||||
$nothingtodisplay = false;
|
||||
|
||||
try {
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
} catch (Exception $e) {
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
|
||||
require_login($course, false, $cm);
|
||||
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
|
@ -33,13 +33,10 @@ $pageid = optional_param('pageid', NULL, PARAM_INT); // Lesson Page ID
|
||||
$edit = optional_param('edit', -1, PARAM_BOOL);
|
||||
$userpassword = optional_param('userpassword','',PARAM_CLEAN);
|
||||
|
||||
try {
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
} catch (Exception $e) {
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
|
||||
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
|
||||
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
|
||||
|
||||
require_login($course, false, $cm);
|
||||
|
||||
$url = new moodle_url('/mod/lesson/view.php', array('id'=>$id));
|
||||
|
Loading…
x
Reference in New Issue
Block a user