Updated the 19 build version to 20101023
[moodle.git] / mod / label / view.php
blob74a8b3011261d67b093b7001303f388705519124
1 <?php // $Id$
3 require_once("../../config.php");
5 $id = optional_param('id',0,PARAM_INT); // Course Module ID, or
6 $l = optional_param('l',0,PARAM_INT); // Label ID
8 if ($id) {
9 if (! $cm = get_coursemodule_from_id('label', $id)) {
10 error("Course Module ID was incorrect");
13 if (! $course = get_record("course", "id", $cm->course)) {
14 error("Course is misconfigured");
17 if (! $label = get_record("label", "id", $cm->instance)) {
18 error("Course module is incorrect");
21 } else {
22 if (! $label = get_record("label", "id", $l)) {
23 error("Course module is incorrect");
25 if (! $course = get_record("course", "id", $label->course)) {
26 error("Course is misconfigured");
28 if (! $cm = get_coursemodule_from_instance("label", $label->id, $course->id)) {
29 error("Course Module ID was incorrect");
33 require_login($course->id);
35 redirect("$CFG->wwwroot/course/view.php?id=$course->id");