]> git.mjollnir.org Git - moodle.git/commitdiff
- Two little mods in the category linking issue:
authorwillcast <willcast>
Fri, 17 Oct 2003 15:35:18 +0000 (15:35 +0000)
committerwillcast <willcast>
Fri, 17 Oct 2003 15:35:18 +0000 (15:35 +0000)
    The concepts could be in more than one glossary so...
    I put it inside the "if concept is category" conditional... I little more efficient.

mod/glossary/dynalink.php

index d1c0472ef9d3ae3147d1cdd7fe6955054bf939fe..3b39bf3aaff8ca7678c6f56bc1a7849f40949ff0 100644 (file)
@@ -32,8 +32,7 @@
 
             if ( $concepts ) {
                 $lastglossary = 0;
-                $lastcategory = 0;
-                $cm = get_coursemodule_from_instance("glossary", $glossary->id, $courseid);
+                $lastcategory = 0;                
                 foreach ( $concepts as $concept ) {
                     if ( $lastglossary != $concept->glossaryid ) {
                         $glossary = get_record("glossary","id",$concept->glossaryid);
@@ -45,7 +44,7 @@
                             $category = get_record("glossary_categories","id",$concept->id);
                             $lastcategory = $concept->id;
                         }
-
+                        $cm = get_coursemodule_from_instance("glossary", $glossary->id, $courseid);                                            
                         $title = strip_tags("$glossary->name: " . get_string("category","glossary"). " $category->name");
                         $href_tag_begin = "<a class=\"autolink\" title=\"$title\" href=\"$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&currentview=categories&cat=$concept->id\">";
                     } else {