From 4a5e1f9d4bd79175cea7cf056c7db44609f763bf Mon Sep 17 00:00:00 2001 From: David Monllao Date: Thu, 19 Jul 2012 09:24:10 +0800 Subject: [PATCH] MDL-25983 enrol_imsenterprise Importing the course summary when adding new courses --- enrol/imsenterprise/lib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/enrol/imsenterprise/lib.php b/enrol/imsenterprise/lib.php index 284608a7267..073e76a8499 100644 --- a/enrol/imsenterprise/lib.php +++ b/enrol/imsenterprise/lib.php @@ -321,6 +321,9 @@ function process_group_tag($tagcontents) { if (preg_match('{.*?(.*?).*?}is', $tagcontents, $matches)) { $group->shortName = trim($matches[1]); } + if (preg_match('{.*?(.*?).*?}is', $tagcontents, $matches)) { + $group->fulldescription = trim($matches[1]); + } if (preg_match('{.*?(.*?).*?}is', $tagcontents, $matches)) { $group->category = trim($matches[1]); } @@ -376,7 +379,10 @@ function process_group_tag($tagcontents) { $courseconfig = get_config('moodlecourse'); // Load Moodle Course shell defaults $course = new stdClass(); $course->fullname = $group->description; - $course->shortname = $group->shortName;; + $course->shortname = $group->shortName; + if (!empty($group->fulldescription)) { + $course->summary = format_text($group->fulldescription, FORMAT_HTML); + } $course->idnumber = $coursecode; $course->format = $courseconfig->format; $course->visible = $courseconfig->visible;