Browse files

MDL-30395 display the folder name if the block/module of a backup fil…

…e is not installed in the site
  • Loading branch information...
1 parent 263f8b3 commit 17fa731ae67b951c6e0b884b65b7a043e740114e @mouneyrac mouneyrac committed Nov 30, 2011
Showing with 14 additions and 4 deletions.
  1. +14 −4 blocks/community/renderer.php
View
18 blocks/community/renderer.php
@@ -193,6 +193,8 @@ public function course_list($courses, $huburl, $contextcourseid) {
//Create course content html
+ $blocks = get_plugin_list('block');
+ $activities = get_plugin_list('mod');
if (!empty($course->contents)) {
$activitieshtml = '';
$blockhtml = '';
@@ -202,14 +204,22 @@ public function course_list($courses, $huburl, $contextcourseid) {
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 . ")";
}
}

0 comments on commit 17fa731

Please sign in to comment.