From cca6f7f1bb1b68c64d6663c55529b386ae8d707e Mon Sep 17 00:00:00 2001 From: willcast Date: Sat, 18 Oct 2003 20:23:29 +0000 Subject: [PATCH] - Fixed bug when showing "dynaentries" (it showed all concepts no matter the course nor its dynasetting) --- mod/glossary/lib.php | 26 ++++++++++++++++++++++++++ mod/glossary/showentry.php | 4 ++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index bbdb96dba0..3bceaabba0 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -844,4 +844,30 @@ function glossary_print_comment($course, $cm, $glossary, $entry, $comment) { echo ""; } + function glossary_print_dynaentry($courseid, $entries) { + global $THEME, $USER; + + $colour = $THEME->cellheading2; + + echo "\n
"; + echo ""; + echo "
"; + 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 "
"; + } ?> diff --git a/mod/glossary/showentry.php b/mod/glossary/showentry.php index 54ab74820d..a294c1952e 100644 --- a/mod/glossary/showentry.php +++ b/mod/glossary/showentry.php @@ -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"); -- 2.39.5