You are here

function multiple_email_edit_form in Multiple E-mail Addresses 6

Same name and namespace in other branches
  1. 7 multiple_email_edit_page.inc \multiple_email_edit_form()
  2. 2.x multiple_email_edit_page.inc \multiple_email_edit_form()

Builds form for editing an e-mail address

Parameters

object $account User object:

1 string reference to 'multiple_email_edit_form'
multiple_email_edit_page in ./multiple_email_edit_page.inc
Renders the page for adding a new e-mail address.

File

./multiple_email_edit_page.inc, line 30
Functions for the page to edit an existing e-mail address in the registry.

Code

function multiple_email_edit_form(&$form_state, $account, $email) {
  $form['email'] = array(
    '#type' => 'textfield',
    '#title' => t('E-mail Address'),
    '#required' => TRUE,
    '#default_value' => $email->email,
  );
  $form['eid'] = array(
    '#type' => 'value',
    '#value' => $email->eid,
  );
  $form['account'] = array(
    '#type' => 'value',
    '#value' => $account,
  );
  if (user_access('administer users')) {
    $form['confirm'] = array(
      '#type' => 'checkbox',
      '#title' => t('Activate this email.'),
      '#default_value' => $email->confirmed,
    );
  }
  else {
    $form['confirm'] = array(
      '#type' => 'value',
      '#value' => $email->confirmed,
    );
  }
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  return $form;
}