Skip to content

Commit

Permalink
MDL-30395 display the folder name if the block/module of a backup fil…
Browse files Browse the repository at this point in the history
…e is not installed in the site
  • Loading branch information
mouneyrac committed Nov 30, 2011
1 parent 263f8b3 commit 17fa731
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions blocks/community/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand All @@ -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 . ")";
}
}

Expand Down

0 comments on commit 17fa731

Please sign in to comment.