safe fallback to the "old" ones (stored in admin.php)
Merged from MOODLE_19_STABLE
if ($dirlist = get_directory_list($CFG->dirroot.'/user/profile/field', '', false, true, false)) {
foreach ($dirlist as $type) {
- $datatypes[$type] = get_string('profilefieldtype'.$type, 'admin');
+ $datatypes[$type] = get_string('profilefieldtype'.$type, 'profilefield_'.$type);
+ if (strpos($datatypes[$type], '[[') !== false) {
+ $datatypes[$type] = get_string('profilefieldtype'.$type, 'admin');
+ }
}
}
+ asort($datatypes);
+
return $datatypes;
}