]> git.mjollnir.org Git - moodle.git/commitdiff
Using new function to print out custom categories and fields. This shouldn't
authorikawhero <ikawhero>
Thu, 25 Jan 2007 05:23:56 +0000 (05:23 +0000)
committerikawhero <ikawhero>
Thu, 25 Jan 2007 05:23:56 +0000 (05:23 +0000)
interfere with skodaks work on splitting the user edit form.

user/edit_form.php

index 4c4591ab4887a574397bb1d1198d0ab7d2eb27b7..5e27db44b919f0c7af15f8f6c1acbd306a33f84a 100644 (file)
@@ -318,26 +318,10 @@ class user_edit_form extends moodleform {
         }
         $mform->hardFreeze($freezefields);
 
-        /// Next the customisable categories
-        if ($categories = get_records_select('user_info_category', '', 'sortorder ASC')) {
-            foreach ($categories as $category) {
-                if ($fields = get_records_select('user_info_field', "categoryid=$category->id", 'sortorder ASC')) {
-
-                    $mform->addElement('header', 'category_'.$category->id, $category->name);
-
-                    foreach ($fields as $field) {
-
-                        require_once($CFG->dirroot.'/user/profile/field/'.$field->datatype.'/field.class.php');
-                        $newfield = 'profile_field_'.$field->datatype;
-                        $formfield = new $newfield($field->id,$user->id);
-                        $formfield->display_field($mform);
-                        unset($formfield);
-
-                    }
-                } /// End of $fields if
-            } /// End of $categories foreach
-        } /// End of $categories if
+        /// Next the customisable profile fields
+        profile_print_custom_fields($mform, $user->id);
 
+        
         $this->add_action_buttons(false, get_string('updatemyprofile'));
 
     } /// End of function