]> git.mjollnir.org Git - moodle.git/commitdiff
- Using user-defined functions to display comments properly.
authorwillcast <willcast>
Tue, 18 Nov 2003 02:28:18 +0000 (02:28 +0000)
committerwillcast <willcast>
Tue, 18 Nov 2003 02:28:18 +0000 (02:28 +0000)
- Adding a default view to auto-linked entries when the new display format is used (temporarly until the display format manager is done)

mod/glossary/comments.php
mod/glossary/lib.php

index 1d3da9c3b9946f823676ffeb57ae4b04498f664d..bbbf442304c92559e01ef108760ac85e20b23fa2 100644 (file)
@@ -69,7 +69,7 @@
     echo "<table class=\"generalbox\" width=\"70%\" align=\"center\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\">";
        echo "<tr bgcolor=$THEME->cellheading2><td align=center>";
            echo "<table border=0 width=100%><tr><td width=33%></td><td width=33% align=center>";
-           echo get_string("commentson","glossary") . " <b>$entry->concept</b></td>";
+           echo get_string("commentson","glossary") . ' <b>' . glossary_print_entry_concept($entry) . '</b></td>';
            echo "<td width=33% align=right>";  
         if ( $glossary->allowcomments ) {      
             echo "<a href=\"comment.php?id=$cm->id&eid=$entry->id\"><img  alt=\"" . get_string("addcomment","glossary") . "\" src=\"comment.gif\" height=16 width=16 border=0></a> ";
@@ -85,7 +85,7 @@
           echo "</td></tr></table>";
     }
     echo "<b>$entry->concept</b>: ";
-    echo format_text($entry->definition, $entry->format);
+    glossary_print_entry_definition($entry);
     echo "</td>";
     echo "</TR></table>";
 
index 9c31a2b77223d5cc89bbe01c78917f389bd3de0d..e5ac29b965077a57b7f3d034de5ac741d86fc449 100644 (file)
@@ -360,6 +360,15 @@ function  glossary_print_entry_concept($entry) {
 
 function glossary_print_entry_definition($entry) {
     $definition = str_ireplace($entry->concept,"<nolink>$entry->concept</nolink>",$entry->definition);
+/*    if ( $aliases = get_records("glossary_alias","entryid",$entry->id) ) {
+        foreach ($aliases as $alias) {
+        echo "<small><font color=red>$alias->alias: ";
+            $definition = str_ireplace($alias->alias,"<nolink>$alias->alias</nolink>",$definition);
+            echo "<b>" . format_text($definition,2) . "</b>";
+        echo "</font></small><br>";
+        }
+    }
+*/
     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 "</td>";