Permalink
Browse files

MDL-29924 Glossary: Entry attachments displayed in Moodle dialogue

  • Loading branch information...
1 parent 7d3704f commit 3dc794a8f54dda8c2bdd04bb30ad7a1dc7142073 @FMCorz FMCorz committed May 17, 2012
Showing with 8 additions and 1 deletion.
  1. +2 −1 filter/glossary/yui/autolinker/autolinker.js
  2. +6 −0 mod/glossary/showentry_ajax.php
@@ -70,7 +70,8 @@ YUI.add('moodle-filter_glossary-autolinker', function(Y) {
this.overlay.hide(); //hide progress indicator
for (key in data.entries) {
- new M.core.alert({title:data.entries[key].concept, message:data.entries[key].definition, lightbox:false});
+ definition = data.entries[key].definition + data.entries[key].attachments
+ new M.core.alert({title:data.entries[key].concept, message:definition, lightbox:false});
}
return true;
@@ -70,6 +70,12 @@
$options->context = $context;
$entries[$key]->definition = format_text($definition, $entry->definitionformat, $options);
+ $entries[$key]->attachments = '';
+ if (!empty($entries[$key]->attachment)) {
+ $attachments = glossary_print_attachments($entry, $cm, 'html');
+ $entries[$key]->attachments = html_writer::tag('p', $attachments);
+ }
+
$entries[$key]->footer = "<p style=\"text-align:right\">&raquo;&nbsp;<a href=\"$CFG->wwwroot/mod/glossary/view.php?g=$entry->glossaryid\">".format_string($entry->glossaryname,true)."</a></p>";
add_to_log($entry->courseid, 'glossary', 'view entry', "showentry.php?eid=$entry->id", $entry->id, $entry->cmid);
}

0 comments on commit 3dc794a

Please sign in to comment.