Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…icked on.
  • Loading branch information...
commit de53b9ac252715dfdf25865022d660b559dc82bd 1 parent d8cb66a
willcast authored
View
4 mod/glossary/dynalink.php
@@ -15,8 +15,8 @@ function glossary_dynamic_link($courseid, $text,$glossaryid = NULL) {
if ( $entries ) {
foreach ( $entries as $entry ) {
- $href_tag_begin = "<a target=\"entry\" title=\"" . strip_tags("$glossary->name: $entry->concept") ."\" href=\"$CFG->wwwroot/mod/glossary/showentry.php?courseid=$courseid&eid=$entry->id\" ".
- "onClick=\"return openpopup('/mod/glossary/showentry.php?courseid=$courseid&eid=$entry->id', 'entry', 'menubar=0,location=0,scrollbars,resizable,width=600,height=450', 0);\">";
+ $href_tag_begin = "<a target=\"entry\" title=\"" . strip_tags("$glossary->name: $entry->concept") ."\" href=\"$CFG->wwwroot/mod/glossary/showentry.php?courseid=$courseid&concept=$entry->concept\" ".
+ "onClick=\"return openpopup('/mod/glossary/showentry.php?courseid=$courseid&concept=$entry->concept', 'entry', 'menubar=0,location=0,scrollbars,resizable,width=600,height=450', 0);\">";
$concept = trim(strip_tags($entry->concept));
View
4 mod/glossary/lib.php
@@ -466,7 +466,7 @@ function glossary_add_attachment($entry, $newfile) {
return $newfile_name;
}
-function glossary_print_attachments($entry, $return=NULL) {
+function glossary_print_attachments($entry, $return=NULL, $align="left") {
// if return=html, then return a html string.
// if return=text, then return a text-only string.
// otherwise, print HTML for non-images, and return image HTML
@@ -499,7 +499,7 @@ function glossary_print_attachments($entry, $return=NULL) {
} else {
if ($icon == "image.gif") { // Image attachments don't get printed as links
- $imagereturn .= "<br /><img src=\"$CFG->wwwroot/$ffurl\">";
+ $imagereturn .= "<br /><img src=\"$CFG->wwwroot/$ffurl\" align=$align>";
} else {
link_to_popup_window("/$ffurl", "attachment", $image, 500, 500, $strattachment);
echo "<a target=_image href=\"$CFG->wwwroot/$ffurl\">$file</a>";
View
33 mod/glossary/showentry.php
@@ -3,31 +3,42 @@
require_once("lib.php");
require_variable($courseid);
- require_variable($eid); // entry id
+ require_variable($concept); // entry id
- $entry = get_record("glossary_entries","id",$eid);
+ $entries = get_records("glossary_entries","ucase(concept)",strtoupper(trim($concept)));
print_header();
- glossary_show_entry($courseid, $entry);
+ glossary_show_entry($courseid, $entries);
close_window_button();
- function glossary_show_entry($courseid, $entry) {
+ function glossary_show_entry($courseid, $entries) {
global $THEME, $USER;
$colour = $THEME->cellheading2;
echo "\n<center><table width=95% border=0><TR>";
echo "<TD WIDTH=100% BGCOLOR=\"#FFFFFF\">";
- if ($entry->attachment) {
- $entry->course = $courseid;
- echo "<table border=0 align=right><tr><td>";
- echo glossary_print_attachments($entry,"html");
- echo "</td></tr></table>";
+ if ( $entries ) {
+ foreach ( $entries as $entry ) {
+ if( $ConceptIsPrinted ) {
+ echo "<hr>";
+ }
+ if ( !$ConceptIsPrinted ) {
+ echo "<b>" . $entry->concept . "</b>:<br>";
+ $ConceptIsPrinted = 1;
+ }
+
+ if ($entry->attachment) {
+ $entry->course = $courseid;
+ echo "<table border=0 align=right><tr><td>";
+ echo glossary_print_attachments($entry,"html");
+ echo "</td></tr></table>";
+ }
+ echo format_text($entry->definition, $entry->format);
+ }
}
- echo "<b>$entry->concept</b>: ";
- echo format_text($entry->definition, $entry->format);
echo "</td>";
echo "</TR></table></center>";
}
Please sign in to comment.
Something went wrong with that request. Please try again.