user_profile_form($form, &$form_state, $account, $category = 'account')Form builder; edit a user account or one of their profile categories.
@see user_account_form_validate()
@see user_profile_form_submit()
user_cancel_confirm_form_submit()
modules/user/user.pages.inc, line 240
<?php
function user_profile_form($form, &$form_state, $account, $category = 'account') {
global $user;
$form['#user'] = $account;
$form['#user_category'] = $category;
if ($category == 'account') {
user_account_form($form, $form_state);
}
// Attach field widgets.
field_attach_form('user', $account, $form, $form_state);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
'#weight' => 30,
);
if ($category == 'account') {
$form['cancel'] = array(
'#type' => 'submit',
'#value' => t('Cancel account'),
'#weight' => 31,
'#submit' => array('user_edit_cancel_submit'),
'#access' => $account->uid > 1 && (($account->uid == $user->uid && user_access('cancel account')) || user_access('administer users')),
);
}
$form['#validate'][] = 'user_profile_form_validate';
// Add the final user profile form submit handler.
$form['#submit'][] = 'user_profile_form_submit';
return $form;
}
?>