Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

- Duplicated entries are now shown together when a dynamic link is cl…

…icked on.
  • Loading branch information...
commit de53b9ac252715dfdf25865022d660b559dc82bd 1 parent d8cb66a
willcast authored
4 mod/glossary/dynalink.php
@@ -15,8 +15,8 @@ function glossary_dynamic_link($courseid, $text,$glossaryid = NULL) {
4 mod/glossary/lib.php
@@ -466,7 +466,7 @@ function glossary_add_attachment($entry, $newfile) {
466 466 return $newfile_name;
467 467 }
468 468
469   -function glossary_print_attachments($entry, $return=NULL) {
  469 +function glossary_print_attachments($entry, $return=NULL, $align="left") {
470 470 // if return=html, then return a html string.
471 471 // if return=text, then return a text-only string.
472 472 // otherwise, print HTML for non-images, and return image HTML
@@ -499,7 +499,7 @@ function glossary_print_attachments($entry, $return=NULL) {
499 499
500 500 } else {
501 501 if ($icon == "image.gif") { // Image attachments don't get printed as links
502   - $imagereturn .= "<br /><img src=\"$CFG->wwwroot/$ffurl\">";
  502 + $imagereturn .= "<br /><img src=\"$CFG->wwwroot/$ffurl\" align=$align>";
503 503 } else {
504 504 link_to_popup_window("/$ffurl", "attachment", $image, 500, 500, $strattachment);
505 505 echo "<a target=_image href=\"$CFG->wwwroot/$ffurl\">$file</a>";
33 mod/glossary/showentry.php
@@ -3,31 +3,42 @@
3 3 require_once("lib.php");
4 4
5 5 require_variable($courseid);
6   - require_variable($eid); // entry id
  6 + require_variable($concept); // entry id
7 7
8   - $entry = get_record("glossary_entries","id",$eid);
  8 + $entries = get_records("glossary_entries","ucase(concept)",strtoupper(trim($concept)));
9 9
10 10 print_header();
11 11
12   - glossary_show_entry($courseid, $entry);
  12 + glossary_show_entry($courseid, $entries);
13 13
14 14 close_window_button();
15 15
16   - function glossary_show_entry($courseid, $entry) {
  16 + function glossary_show_entry($courseid, $entries) {
17 17 global $THEME, $USER;
18 18
19 19 $colour = $THEME->cellheading2;
20 20
21 21 echo "\n<center><table width=95% border=0><TR>";
22 22 echo "<TD WIDTH=100% BGCOLOR=\"#FFFFFF\">";
23   - if ($entry->attachment) {
24   - $entry->course = $courseid;
25   - echo "<table border=0 align=right><tr><td>";
26   - echo glossary_print_attachments($entry,"html");
27   - echo "</td></tr></table>";
  23 + if ( $entries ) {
  24 + foreach ( $entries as $entry ) {
  25 + if( $ConceptIsPrinted ) {
  26 + echo "<hr>";
  27 + }
  28 + if ( !$ConceptIsPrinted ) {
  29 + echo "<b>" . $entry->concept . "</b>:<br>";
  30 + $ConceptIsPrinted = 1;
  31 + }
  32 +
  33 + if ($entry->attachment) {
  34 + $entry->course = $courseid;
  35 + echo "<table border=0 align=right><tr><td>";
  36 + echo glossary_print_attachments($entry,"html");
  37 + echo "</td></tr></table>";
  38 + }
  39 + echo format_text($entry->definition, $entry->format);
  40 + }
28 41 }
29   - echo "<b>$entry->concept</b>: ";
30   - echo format_text($entry->definition, $entry->format);
31 42 echo "</td>";
32 43 echo "</TR></table></center>";
33 44 }

0 comments on commit de53b9a

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