MDL-29924 Glossary: Entry attachments displayed in Moodle dialogue

This commit is contained in:
Frederic Massart 2012-05-17 15:02:48 +08:00
parent 71d7bc34a8
commit 096d4d8767
2 changed files with 8 additions and 1 deletions

View File

@ -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;

View File

@ -70,6 +70,12 @@ if ($entries) {
$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);
}