Skip to content

Commit

Permalink
MDL-22783 fixing default roles in ims settings
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jul 25, 2010
1 parent d67fb04 commit 74f64f6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions enrol/imsenterprise/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,12 @@
$settings->add(new admin_setting_heading('enrol_imsenterprise_usersettings_roles', get_string('roles', 'enrol_imsenterprise'), get_string('imsrolesdescription', 'enrol_imsenterprise')));

if (!during_initial_install()) {
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
$assignableroles = get_assignable_roles($sitecontext);
$coursecontext = get_context_instance(CONTEXT_COURSE, SITEID);
$assignableroles = get_assignable_roles($coursecontext);
$assignableroles = array('0' => get_string('ignore', 'enrol_imsenterprise')) + $assignableroles;
$imsroles = new imsenterprise_roles();

foreach ($imsroles->get_imsroles() as $imsrolenum => $imsrolename) {
$settings->add(new admin_setting_configselect('enrol_imsenterprise/imsrolemap'.$imsrolenum, format_string('"'.$imsrolename.'" ('.$imsrolenum.')'), '', $imsroles->determine_default_rolemapping($imsrolenum), $assignableroles));
$settings->add(new admin_setting_configselect('enrol_imsenterprise/imsrolemap'.$imsrolenum, format_string('"'.$imsrolename.'" ('.$imsrolenum.')'), '', (int)$imsroles->determine_default_rolemapping($imsrolenum), $assignableroles));
}
}

Expand Down

0 comments on commit 74f64f6

Please sign in to comment.