]> git.mjollnir.org Git - moodle.git/commitdiff
Some fixes to highlighting ... it is now performed AFTER the format_text.
authormoodler <moodler>
Wed, 31 Mar 2004 08:34:41 +0000 (08:34 +0000)
committermoodler <moodler>
Wed, 31 Mar 2004 08:34:41 +0000 (08:34 +0000)
This means that searches can no longer mess up the TeX formatting.

Also, the concept names are now formatted, allowing multilang, TeX etc

mod/glossary/formats/1.php
mod/glossary/formats/4.php
mod/glossary/lib.php
mod/glossary/view.php

index 2a87b3852d578c0bf8b15b3627e190b9a62dfc65..ad47fcd665890004b0fa936429fdfae27767eddb 100644 (file)
@@ -23,8 +23,7 @@ function glossary_print_entry_by_format($course, $cm, $glossary, $entry,$current
 
     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 {
index 4898b2b7fca7814d26b23ce439ccb560e462cb04..0b00e13d0bd2dbdf4d8460670c31ebf26beb7b72 100644 (file)
@@ -15,11 +15,11 @@ function glossary_print_entry_by_format($course, $cm, $glossary, $entry, $mode="
         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 '&nbsp;&nbsp;<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);
index 520f865cb5fafbb046b701dacae8bccc6828f39d..c181042a4193a86dd31acc5ff76013bc7e044d79 100644 (file)
@@ -459,7 +459,11 @@ function glossary_print_entry($course, $cm, $glossary, $entry, $mode="",$hook=""
         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) {
@@ -508,7 +512,12 @@ 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') {
index 8a8baff77e4b9aa205259397acc4042166b6429e..acca53421099a33648871a9c4a561efeb24e6650 100644 (file)
                 $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.