Extending workshop class constructor

Every action script in 99% starts with fetching course, course module,
and module instance record. Workshop class will keep the reference to
the course record in courserecord public member variable (do not confuse
with course integer property).
This commit is contained in:
David Mudrak
2010-01-04 17:47:43 +00:00
parent da92436b2d
commit a7c5b9185a
9 changed files with 39 additions and 20 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ $PAGE->set_url('mod/workshop/allocation.php', array('cmid' => $cmid, 'method' =>
$cm = get_coursemodule_from_id('workshop', $cmid, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
$workshop = $DB->get_record('workshop', array('id' => $cm->instance), '*', MUST_EXIST);
$workshop = new workshop_api($workshop, $cm);
$workshop = new workshop_api($workshop, $cm, $course);
require_login($course, false, $cm);
$context = $PAGE->context;