Permalink
Browse files

Merge branch 'MDL-58702-35' of git://github.com/zig-moodle/moodle int…

…o MOODLE_35_STABLE
  • Loading branch information...
dmonllao committed Jun 19, 2018
2 parents 697a28a + e275b0c commit 4f7fa1820156f4114d4a546ce6795de35f15db95
Showing with 21 additions and 1 deletion.
  1. +20 −1 backup/util/ui/restore_ui_stage.class.php
  2. +1 −0 lang/en/backup.php
@@ -1061,7 +1061,26 @@ public function display(core_backup_renderer $renderer) {
if (!empty($info->role_mappings->mappings)) {
$context = context_course::instance($this->ui->get_controller()->get_courseid());
$assignableroles = get_assignable_roles($context, ROLENAME_ALIAS, false);
$html .= $renderer->role_mappings($info->role_mappings->mappings, $assignableroles);
// Get current role mappings.
$currentroles = role_fix_names(get_all_roles(), $context);
// Get backup role mappings.
$rolemappings = $info->role_mappings->mappings;
array_map(function($rolemapping) use ($currentroles) {
foreach ($currentroles as $role) {
// Find matching archetype to determine the backup's shortname for label display.
if ($rolemapping->archetype == $role->archetype) {
$rolemapping->name = $rolemapping->shortname;
break;
}
}
if ($rolemapping->name == null) {
$rolemapping->name = get_string('undefinedrolemapping', 'backup', $rolemapping->archetype);
}
}, $rolemappings);
$html .= $renderer->role_mappings($rolemappings, $assignableroles);
}
break;
default:
@@ -326,6 +326,7 @@
$string['title'] = 'Title';
$string['totalcategorysearchresults'] = 'Total categories: {$a}';
$string['totalcoursesearchresults'] = 'Total courses: {$a}';
$string['undefinedrolemapping'] = 'Role mapping undefined for: \'{$a}\' archetype';
$string['unnamedsection'] = 'Unnamed section';
$string['userinfo'] = 'Userinfo';
$string['module'] = 'Module';

0 comments on commit 4f7fa18

Please sign in to comment.