New profilefield_ lang files are now supported with
authorstronk7 <stronk7>
Fri, 9 Nov 2007 20:11:43 +0000 (20:11 +0000)
committerstronk7 <stronk7>
Fri, 9 Nov 2007 20:11:43 +0000 (20:11 +0000)
safe fallback to the "old" ones (stored in admin.php)

Merged from MOODLE_19_STABLE

user/profile/definelib.php

index 543da4937d57947421343869dd87ccab0db3526d..68e65304491974e6ad7163dde74dab4c192a621f 100644 (file)
@@ -372,9 +372,14 @@ function profile_list_datatypes() {
 
     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;
 }