From 263f8b3188aee5fbc210ede2d1993e8b38aae175 Mon Sep 17 00:00:00 2001 From: Jerome Mouneyrac Date: Tue, 29 Nov 2011 16:22:39 +0800 Subject: [PATCH 1/2] Merge branches 'MOODLE_21_STABLE' and 'MOODLE_21_STABLE' of git://git.moodle.org/moodle into MOODLE_21_STABLE From 17fa731ae67b951c6e0b884b65b7a043e740114e Mon Sep 17 00:00:00 2001 From: Jerome Mouneyrac Date: Wed, 30 Nov 2011 10:33:21 +0800 Subject: [PATCH 2/2] MDL-30395 display the folder name if the block/module of a backup file is not installed in the site --- blocks/community/renderer.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/blocks/community/renderer.php b/blocks/community/renderer.php index 5eb9d85f851..1df8f82cb47 100644 --- a/blocks/community/renderer.php +++ b/blocks/community/renderer.php @@ -193,6 +193,8 @@ class block_community_renderer extends plugin_renderer_base { //Create course content html + $blocks = get_plugin_list('block'); + $activities = get_plugin_list('mod'); if (!empty($course->contents)) { $activitieshtml = ''; $blockhtml = ''; @@ -202,14 +204,22 @@ class block_community_renderer extends plugin_renderer_base { if (!empty($blockhtml)) { $blockhtml .= ' - '; } - $blockhtml .= get_string('pluginname', 'block_' . $content->modulename) - . " (" . $content->contentcount . ")"; + if (array_key_exists($content->modulename, $blocks)) { + $blockname = get_string('pluginname', 'block_' . $content->modulename); + } else { + $blockname = $content->modulename; + } + $blockhtml .= $blockname . " (" . $content->contentcount . ")"; } else { if (!empty($activitieshtml)) { $activitieshtml .= ' - '; } - $activitieshtml .= get_string('modulename', $content->modulename) - . " (" . $content->contentcount . ")"; + if (array_key_exists($content->modulename, $activities)) { + $activityname = get_string('modulename', $content->modulename); + } else { + $activityname = $content->modulename; + } + $activitieshtml .= $activityname . " (" . $content->contentcount . ")"; } }