]> git.mjollnir.org Git - moodle.git/commitdiff
- Fixed bug when showing "dynaentries" (it showed all concepts no matter the course...
authorwillcast <willcast>
Sat, 18 Oct 2003 20:23:29 +0000 (20:23 +0000)
committerwillcast <willcast>
Sat, 18 Oct 2003 20:23:29 +0000 (20:23 +0000)
mod/glossary/lib.php
mod/glossary/showentry.php

index bbdb96dba07714b65724385eba8b7c7583ac76d9..3bceaabba0af1df2f8ec528f52b95bf0ccddf235 100644 (file)
@@ -844,4 +844,30 @@ function glossary_print_comment($course, $cm, $glossary, $entry, $comment) {
     echo "</td></tr></table>";
 }
 
+    function glossary_print_dynaentry($courseid, $entries) {
+        global $THEME, $USER;
+
+        $colour = $THEME->cellheading2;
+
+        echo "\n<center><table width=95% border=0><tr>";
+        echo "<td width=100%\">";
+        if ( $entries ) {
+            foreach ( $entries as $entry ) {
+
+                if (! $glossary = get_record("glossary", "id", $entry->glossaryid)) {
+                    error("Glossary ID was incorrect or no longer exists");
+                }
+                if (! $course = get_record("course", "id", $glossary->course)) {
+                    error("Glossary is misconfigured - don't know what course it's from");
+                }
+                if (!$cm = get_coursemodule_from_instance("glossary", $entry->glossaryid, $courseid) ) {
+                    error("Glossary is misconfigured - don't know what course module it is ");
+                }
+
+                glossary_print_entry($course, $cm, $glossary, $entry);
+            }
+        }
+        echo "</td>";
+        echo "</tr></table></center>";
+    }
 ?>
index 54ab74820d60546db1256be6b7ed1d9677c73a09..a294c1952e77bf0f630487e141ea1e8b478e1655 100644 (file)
@@ -3,12 +3,12 @@
     require_once("lib.php");
 
     require_variable($courseid);
-    require_variable($concept);  // entry id
+    require_variable($concept);
 
     print_header();
     $entries = get_records_sql("select e.* from {$CFG->prefix}glossary_entries e, {$CFG->prefix}glossary g".
                                   " where e.glossaryid = g.id and".
-                                      " ucase(concept) = 'MOODLE' and".
+                                      " ucase(concept) = '" . strtoupper(trim($concept)). "' and".
                                       " g.course = $courseid and".
                                       " e.usedynalink = 1 and g.usedynalink = 1");