+// If we have custom fields - add controls for them.
+if ($custom_fields && $custom_fields->userFields) {
+ foreach ($custom_fields->userFields as $userField) {
+ $field_name = 'user_field_'.$userField['id'];
+ if ($userField['type'] == CustomFields::TYPE_TEXT) {
+ $form->addInput(array('type'=>'text','name'=>$field_name,'value'=>$userCustomFields[$userField['id']]['value']));
+ } elseif ($userField['type'] == CustomFields::TYPE_DROPDOWN) {
+ $form->addInput(array('type'=>'combobox','name'=>$field_name,
+ 'style'=>'width: 250px;',
+ 'data'=>CustomFields::getOptions($userField['id']),
+ 'value'=>$userCustomFields[$userField['id']]['value'],
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
+ }
+ }
+}
+