From 06b53930ab89f8f8cdc19c7e503ac5350f766968 Mon Sep 17 00:00:00 2001 From: Jason Fowler Date: Thu, 5 Jul 2012 13:43:33 +0800 Subject: [PATCH 1/2] MDL-33829 - Glossary - Adding Rich Portfolio Export support --- mod/glossary/locallib.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mod/glossary/locallib.php b/mod/glossary/locallib.php index b82a9001b04..f9374b735af 100644 --- a/mod/glossary/locallib.php +++ b/mod/glossary/locallib.php @@ -266,6 +266,12 @@ class glossary_entry_portfolio_caller extends portfolio_module_caller_base { $fs->get_area_files($context->id, 'mod_glossary', 'attachment', $this->entry->id, "timemodified", false), $fs->get_area_files($context->id, 'mod_glossary', 'entry', $this->entry->id, "timemodified", false) ); + + if (!empty($this->multifiles)) { + $this->add_format(PORTFOLIO_FORMAT_RICHHTML); + } else { + $this->add_format(PORTFOLIO_FORMAT_PLAINHTML); + } } /** From 2403ea411c9f39efb72241393a1608162e92e5a2 Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Mon, 24 Sep 2012 17:52:52 +0800 Subject: [PATCH 2/2] MDL-33829 mod_glossary: added some smarts so glossary entries with an image in their description are classed as richhtml instead of plainhtml --- mod/glossary/lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index ab8657a8eef..49f4c3fc169 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -1282,7 +1282,9 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode='',$h } } $fs = get_file_storage(); - if ($files = $fs->get_area_files($filecontext->id, 'mod_glossary', 'attachment', $entry->id, "timemodified", false)) { + if ($files = $fs->get_area_files($filecontext->id, 'mod_glossary', 'attachment', $entry->id, "timemodified", false) + || $files = $fs->get_area_files($filecontext->id, 'mod_glossary', 'entry', $entry->id, "timemodified", false)) { + $button->set_formats(PORTFOLIO_FORMAT_RICHHTML); } else { $button->set_formats(PORTFOLIO_FORMAT_PLAINHTML);