user_edit_form

Definition

user_edit_form($uid, $edit)
modules/user.module, line 1057

Code

<?php
function user_edit_form($uid, $edit) {
  // Account information:
  $group  = form_textfield(t('Username'), 'name', $edit['name'], 30, 55, t('Your full name or your preferred username: only letters, numbers and spaces are allowed.'), NULL, TRUE);
  $group .= form_textfield(t('E-mail address'), 'mail', $edit['mail'], 30, 55, t('Insert a valid e-mail address.  All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.'), NULL, TRUE);
  $group .= form_item(t('Password'), '<input type="password" class="form-password" name="edit[pass1]" size="12" maxlength="24" /> <input type="password" class="form-password" name="edit[pass2]" size="12" maxlength="24" />', t('Enter your new password twice if you want to change your current password, or leave it blank if you are happy with your current password.'), NULL, TRUE);

  if (user_access('administer users')) {
    $group .= form_radios(t('Status'), 'status', $edit['status'], array(t('Blocked'), t('Active')));
    $group .= form_checkboxes(t('Roles'), 'roles', array_keys($edit['roles']), user_roles(1), t('Select at least one role.  The user receives the combined permissions of all of the selected roles.'), NULL, TRUE);
  }

  $data[] = array('title' => t('Account information'), 'data' => $group, 'weight' => 0);

  // Picture/avatar:
  if (variable_get('user_pictures', 0)) {
    $group = '';
    if ($edit['picture'] && ($picture = theme('user_picture', array2object($edit)))) {
      $group .= $picture;
      $group .= form_checkbox(t('Delete picture'), 'picture_delete', 1, 0, t('Check this box to delete your current picture.'));
    }
    $group .= form_file(t('Upload picture'), 'picture', 48, t('Your virtual face or picture.  Maximum dimensions are %dimensions and the maximum size is %size kB.', array('%dimensions' => variable_get('user_picture_dimensions', '85x85'), '%size' => variable_get('user_picture_file_size', '30'))) .' '. variable_get('user_picture_guidelines', ''));
    $data[] = array('title' => t('Picture'), 'data' => $group, 'weight' => 1);
  }

  return $data;
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.