This means that searches can no longer mess up the TeX formatting.
Also, the concept names are now formatted, allowing multilang, TeX etc
echo "\n<tr><td width=100% bgcolor=\"$THEME->cellcontent\">";
if ($entry) {
- echo format_text($entry->definition, $entry->format);
-
+ glossary_print_entry_definition($entry);
glossary_print_entry_icons($course, $cm, $glossary, $entry, $currentview, $cat);
} else {
glossary_print_entry_attachment($entry,"html","right");
echo '<b>' . get_string("question","glossary") . ':</b> ';
- echo glossary_print_entry_concept($entry) . '<br>';
+ glossary_print_entry_concept($entry) . '<br>';
echo ' <font size=1>' . get_string("lastedited").': '.userdate($entry->timemodified) . '</font></tr>';
echo "<tr><td width=100% bgcolor=\"$THEME->cellcontent\">";
echo '<b>' . get_string("answer","glossary") . ':</b> ';
- echo glossary_print_entry_definition($entry);
+ glossary_print_entry_definition($entry);
glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook,$printicons);
return $return;
}
function glossary_print_entry_concept($entry) {
- echo $entry->concept;
+ $text = format_text($entry->concept, $entry->format);
+ if (!empty($entry->highlight)) {
+ $text = highlight($entry->highlight, $text);
+ }
+ echo $text;
}
function glossary_print_entry_definition($entry) {
}
}
*/
- echo format_text($definition, $entry->format);
+
+ $text = format_text($definition, $entry->format);
+ if (!empty($entry->highlight)) {
+ $text = highlight($entry->highlight, $text);
+ }
+ echo $text;
}
function glossary_print_entry_aliases($course, $cm, $glossary, $entry,$mode="",$hook="", $type = 'print') {
$concept = $entry->concept;
$definition = $entry->definition;
- /// highligh the term if necessary
+ /// highlight the term if necessary
if ($mode == 'search') {
- $entry->concept = highlight($hook, $concept);
- $entry->definition = highlight($hook, $definition);
+ $entry->highlight = $hook;
}
/// and finally print the entry.