Merge branch 'MDL-29924-master' of git://github.com/FMCorz/moodle
authorDan Poltawski <dan@moodle.com>
Fri, 25 May 2012 03:14:22 +0000 (11:14 +0800)
committerDan Poltawski <dan@moodle.com>
Fri, 25 May 2012 03:14:22 +0000 (11:14 +0800)
filter/glossary/yui/autolinker/autolinker.js
mod/glossary/showentry_ajax.php

index 46d04bc..e9af017 100644 (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;
index 9703a06..5df4c0f 100644 (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);
     }