]> git.mjollnir.org Git - moodle.git/commitdiff
Some fixes to headers
authormoodler <moodler>
Sun, 2 May 2004 02:25:04 +0000 (02:25 +0000)
committermoodler <moodler>
Sun, 2 May 2004 02:25:04 +0000 (02:25 +0000)
mod/glossary/showentry.php

index fc88c68665c802c15d8bd2ff29302d8c89b4dbd7..c3fb6d1ab44d8abba779f2e2158a0b41e2e9dab1 100644 (file)
@@ -8,18 +8,23 @@
     optional_variable($displayformat,-1);
 
     if (!empty($courseid)) {
-        $site = get_site();
-        if ($courseid != $site->id) {
+        $course = get_record("course", "id", $courseid);
+        if ($course->category) {
             require_login($courseid);
         }
-        $course = get_record("course", "id", $courseid);
 
         $strglossaries = get_string("modulenameplural", "glossary");
         $strsearch = get_string("search");
 
         $CFG->framename = "newwindow";
-        print_header(strip_tags("$course->shortname: $glossary->name"), "$course->fullname",
-        "<a target=\"newwindow\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> -> $strglossaries -> $strsearch", "", "", true, "&nbsp;", "&nbsp;");
+        if ($course->category) {
+            print_header(strip_tags("$course->shortname: $glossary->name"), "$course->fullname",
+            "<a target=\"newwindow\" href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> -> $strglossaries -> $strsearch", "", "", true, "&nbsp;", "&nbsp;");
+        } else {
+            print_header(strip_tags("$course->shortname: $glossary->name"), "$course->fullname",
+            "$strglossaries -> $strsearch", "", "", true, "&nbsp;", "&nbsp;");
+        }
+
 
     } else {
         print_header();    // Needs to be something here to allow linking back to the whole glossary