From: willcast Date: Tue, 18 Nov 2003 02:28:18 +0000 (+0000) Subject: - Using user-defined functions to display comments properly. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=584dcac979acf6cc887846c76ea8c4c6982b31ce;p=moodle.git - Using user-defined functions to display comments properly. - Adding a default view to auto-linked entries when the new display format is used (temporarly until the display format manager is done) --- diff --git a/mod/glossary/comments.php b/mod/glossary/comments.php index 1d3da9c3b9..bbbf442304 100644 --- a/mod/glossary/comments.php +++ b/mod/glossary/comments.php @@ -69,7 +69,7 @@ echo ""; echo "cellheading2>"; echo "
"; echo ""; + echo get_string("commentson","glossary") . ' ' . glossary_print_entry_concept($entry) . ''; echo "
"; - echo get_string("commentson","glossary") . " $entry->concept"; if ( $glossary->allowcomments ) { echo "id&eid=$entry->id\">\"" "; @@ -85,7 +85,7 @@ echo "
"; } echo "$entry->concept: "; - echo format_text($entry->definition, $entry->format); + glossary_print_entry_definition($entry); echo "
"; diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index 9c31a2b772..e5ac29b965 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -360,6 +360,15 @@ function glossary_print_entry_concept($entry) { function glossary_print_entry_definition($entry) { $definition = str_ireplace($entry->concept,"$entry->concept",$entry->definition); +/* if ( $aliases = get_records("glossary_alias","entryid",$entry->id) ) { + foreach ($aliases as $alias) { + echo "$alias->alias: "; + $definition = str_ireplace($alias->alias,"$alias->alias",$definition); + echo "" . format_text($definition,2) . ""; + echo "
"; + } + } +*/ echo format_text($definition, $entry->format); } @@ -1226,7 +1235,12 @@ function glossary_print_dynaentry($courseid, $entries, $displayformat = -1) { if (!$cm = get_coursemodule_from_instance("glossary", $entry->glossaryid, $glossary->course) ) { error("Glossary is misconfigured - don't know what course module it is "); } - glossary_print_entry($course, $cm, $glossary, $entry, "","",0,$displayformat); + $dp = $displayformat; + // Hard-coded until the Display formats manager is done. + if ( $dp == -1 and $glossary->displayformat == 6 ) { + $dp = 2; + } + glossary_print_entry($course, $cm, $glossary, $entry, "","",0,$dp); } } echo "";