mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-57791 analytics: Replace settings by get_archetype_roles
This commit is contained in:
parent
f39cebbb3c
commit
3a217fc394
8 changed files with 19 additions and 59 deletions
|
@ -78,29 +78,5 @@ if ($hassiteconfig) {
|
|||
$defaultmodeloutputdir = rtrim($CFG->dataroot, '/') . DIRECTORY_SEPARATOR . 'models';
|
||||
$settings->add(new admin_setting_configdirectory('analytics/modeloutputdir', new lang_string('modeloutputdir', 'analytics'),
|
||||
new lang_string('modeloutputdirinfo', 'analytics'), $defaultmodeloutputdir));
|
||||
$studentdefaultroles = [];
|
||||
$teacherdefaultroles = [];
|
||||
|
||||
// Student and teacher roles.
|
||||
$allroles = role_fix_names(get_all_roles());
|
||||
$rolechoices = [];
|
||||
foreach ($allroles as $role) {
|
||||
$rolechoices[$role->id] = $role->localname;
|
||||
|
||||
if ($role->shortname == 'student') {
|
||||
$studentdefaultroles[] = $role->id;
|
||||
} else if ($role->shortname == 'teacher') {
|
||||
$teacherdefaultroles[] = $role->id;
|
||||
} else if ($role->shortname == 'editingteacher') {
|
||||
$teacherdefaultroles[] = $role->id;
|
||||
}
|
||||
}
|
||||
|
||||
$settings->add(new admin_setting_configmultiselect('analytics/teacherroles', new lang_string('teacherroles', 'analytics'),
|
||||
'', $teacherdefaultroles, $rolechoices));
|
||||
|
||||
$settings->add(new admin_setting_configmultiselect('analytics/studentroles', new lang_string('studentroles', 'analytics'),
|
||||
'', $studentdefaultroles, $rolechoices));
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue