Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- 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
willcast authored
Showing with 17 additions and 3 deletions.
  1. +2 −2 mod/glossary/comments.php
  2. +15 −1 mod/glossary/lib.php
View
4 mod/glossary/comments.php
@@ -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>";
View
16 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,"<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>";
Please sign in to comment.
Something went wrong with that request. Please try again.