Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / mod / label / view.php
blob20575ece2b8d534921bdcca6d37c4a2401abf0d5
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");