Commit d268f5ea authored by Francois Gannaz's avatar Francois Gannaz
Browse files

view: working but empty

parent 2dd35665
......@@ -34,9 +34,9 @@ $l = optional_param('l', 0, PARAM_INT);
if ($id) {
$cm = get_coursemodule_from_id('labnbook', $id, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
$moduleinstance = $DB->get_record('mod_labnbook', array('id' => $cm->instance), '*', MUST_EXIST);
$moduleinstance = $DB->get_record(LABNBOOK_TABLE, array('id' => $cm->instance), '*', MUST_EXIST);
} else if ($l) {
$moduleinstance = $DB->get_record('mod_labnbook', array('id' => $n), '*', MUST_EXIST);
$moduleinstance = $DB->get_record(LABNBOOK_TABLE, array('id' => $n), '*', MUST_EXIST);
$course = $DB->get_record('course', array('id' => $moduleinstance->course), '*', MUST_EXIST);
$cm = get_coursemodule_from_instance('labnbook', $moduleinstance->id, $course->id, false, MUST_EXIST);
} else {
......@@ -47,13 +47,15 @@ require_login($course, true, $cm);
$modulecontext = context_module::instance($cm->id);
/*
$event = \mod_labnbook\event\course_module_viewed::create(array(
'objectid' => $moduleinstance->id,
'context' => $modulecontext
));
$event->add_record_snapshot('course', $course);
$event->add_record_snapshot('mod_labnbook', $moduleinstance);
$event->add_record_snapshot(LABNBOOK_TABLE, $moduleinstance);
$event->trigger();
*/
$PAGE->set_url('/mod/labnbook/view.php', array('id' => $cm->id));
$PAGE->set_title(format_string($moduleinstance->name));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment