Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

- 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)
  • Loading branch information...
commit 584dcac979acf6cc887846c76ea8c4c6982b31ce 1 parent 9d12152
authored
4  mod/glossary/comments.php
@@ -69,7 +69,7 @@
69 69
     echo "<table class=\"generalbox\" width=\"70%\" align=\"center\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\">";
70 70
 	echo "<tr bgcolor=$THEME->cellheading2><td align=center>";
71 71
 	    echo "<table border=0 width=100%><tr><td width=33%></td><td width=33% align=center>";
72  
-	    echo get_string("commentson","glossary") . " <b>$entry->concept</b></td>";
  72
+	    echo get_string("commentson","glossary") . ' <b>' . glossary_print_entry_concept($entry) . '</b></td>';
73 73
 	    echo "<td width=33% align=right>";	
74 74
         if ( $glossary->allowcomments ) {	
75 75
             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 @@
85 85
           echo "</td></tr></table>";
86 86
     }
87 87
     echo "<b>$entry->concept</b>: ";
88  
-    echo format_text($entry->definition, $entry->format);
  88
+    glossary_print_entry_definition($entry);
89 89
     echo "</td>";
90 90
     echo "</TR></table>";
91 91
 
16  mod/glossary/lib.php
@@ -360,6 +360,15 @@ function  glossary_print_entry_concept($entry) {
360 360
 
361 361
 function glossary_print_entry_definition($entry) {
362 362
     $definition = str_ireplace($entry->concept,"<nolink>$entry->concept</nolink>",$entry->definition);
  363
+/*    if ( $aliases = get_records("glossary_alias","entryid",$entry->id) ) {
  364
+        foreach ($aliases as $alias) {
  365
+        echo "<small><font color=red>$alias->alias: ";
  366
+            $definition = str_ireplace($alias->alias,"<nolink>$alias->alias</nolink>",$definition);
  367
+            echo "<b>" . format_text($definition,2) . "</b>";
  368
+        echo "</font></small><br>";
  369
+        }
  370
+    }
  371
+*/
363 372
     echo format_text($definition, $entry->format);
364 373
 }
365 374
 
@@ -1226,7 +1235,12 @@ function glossary_print_dynaentry($courseid, $entries, $displayformat = -1) {
1226 1235
             if (!$cm = get_coursemodule_from_instance("glossary", $entry->glossaryid, $glossary->course) ) {
1227 1236
                 error("Glossary is misconfigured - don't know what course module it is ");
1228 1237
             }
1229  
-            glossary_print_entry($course, $cm, $glossary, $entry, "","",0,$displayformat);
  1238
+            $dp = $displayformat;
  1239
+            // Hard-coded until the Display formats manager is done.
  1240
+            if ( $dp == -1 and $glossary->displayformat == 6 ) {
  1241
+                $dp = 2;
  1242
+            }
  1243
+            glossary_print_entry($course, $cm, $glossary, $entry, "","",0,$dp);
1230 1244
         }
1231 1245
     }
1232 1246
     echo "</td>";

0 notes on commit 584dcac

Please sign in to comment.
Something went wrong with that request. Please try again.