closed some br tags
[moodle.git] / mod / scorm / index.php
1 <?php // $Id$
3     require_once("../../config.php");
5     require_variable($id);   // course
7     if (! $course = get_record("course", "id", $id)) {
8         error("Course ID is incorrect");
9     }
11     if ($course->category) {
12         require_login($course->id);
13         $navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
14     } else {
15         $navigation = '';
16     }
18     add_to_log($course->id, "scorm", "view all", "index.php?id=$course->id", "");
20     $strscorm = get_string("modulename", "scorm");
21     $strscorms = get_string("modulenameplural", "scorm");
22     $strweek = get_string("week");
23     $strtopic = get_string("topic");
24     $strname = get_string("name");
25     $strsummary = get_string("summary");
26     $strlastmodified = get_string("lastmodified");
28     print_header("$course->shortname: $strscorms", "$course->fullname", "$navigation $strscorms", 
29                  "", "", true, "", navmenu($course));
31     if ($course->format == "weeks" or $course->format == "topics") {
32         $sortorder = "cw.section ASC";
33     } else {
34         $sortorder = "m.timemodified DESC";
35     }
37     if (! $scorms = get_all_instances_in_course("scorm", $course)) {
38         notice("There are no scorms", "../../course/view.php?id=$course->id");
39         exit;
40     }
42     if ($course->format == "weeks") {
43         $table->head  = array ($strweek, $strname, $strsummary);
44         $table->align = array ("CENTER", "LEFT", "LEFT");
45     } else if ($course->format == "topics") {
46         $table->head  = array ($strtopic, $strname, $strsummary);
47         $table->align = array ("CENTER", "LEFT", "LEFT");
48     } else {
49         $table->head  = array ($strlastmodified, $strname, $strsummary);
50         $table->align = array ("LEFT", "LEFT", "LEFT");
51     }
53     foreach ($scorms as $scorm) {
55         $tt = "";
56         if ($course->format == "weeks" or $course->format == "topics") {
57             if ($scorm->section) {
58                 $tt = "$scorm->section";
59             }
60         } else {
61             $tt = "<font size=\"1\">".userdate($scorm->timemodified);
62         }
63         if (!$scorm->visible) {
64            //Show dimmed if the mod is hidden
65            $table->data[] = array ($tt, "<a class=\"dimmed\" href=\"view.php?id=$scorm->coursemodule\">$scorm->name</a>",
66                                    text_to_html($scorm->summary) );
67         } else {
68            //Show normal if the mod is visible
69            $table->data[] = array ($tt, "<a href=\"view.php?id=$scorm->coursemodule\">$scorm->name</a>",
70                                    text_to_html($scorm->summary) );
71         }
72     }
74     echo "<br />";
76     print_table($table);
78     print_footer($course);
80  
81 ?>