Skip to content

Commit

Permalink
Using new function to print out custom categories and fields. This sh…
Browse files Browse the repository at this point in the history
…ouldn't

interfere with skodaks work on splitting the user edit form.
  • Loading branch information
ikawhero committed Jan 25, 2007
1 parent 7240a6e commit 88dda74
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions user/edit_form.php
Expand Up @@ -318,26 +318,10 @@ function definition () {
}
$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
Expand Down

0 comments on commit 88dda74

Please sign in to comment.