You are here

function multiple_email_primary_form in Multiple E-mail Addresses 5

Same name and namespace in other branches
  1. 6 multiple_email_primary_page.inc \multiple_email_primary_form()
  2. 7 multiple_email_primary_page.inc \multiple_email_primary_form()
  3. 2.x multiple_email_primary_page.inc \multiple_email_primary_form()

Builds form for confirming moving an email to primary status

Parameters

object $email: And email object from the database

Return value

array

See also

multiple_email_primary_form_validate()

multiple_email_primary_form_submit()

1 string reference to 'multiple_email_primary_form'
multiple_email_primary_page in ./multiple_email_primary_page.inc
Renders page to confirm making an address primary

File

./multiple_email_primary_page.inc, line 45
Functions for making an email address the primary address for a user

Code

function multiple_email_primary_form($email) {
  $form['eid'] = array(
    '#type' => 'hidden',
    '#value' => $email->eid,
  );
  $form[] = array(
    '#prefix' => '<p>',
    '#value' => "Are you sure you wish to make the address '{$email->email}' your primary email address?",
    '#suffix' => '</p>',
  );
  $form['confirm'] = array(
    '#type' => 'submit',
    '#value' => 'Make Primary',
  );
  $url = base_path() . 'my-email-addresses';
  $form['cancel'] = array(
    '#type' => 'button',
    '#value' => 'Cancel',
    '#attributes' => array(
      'onclick' => "window.location='{$url}';return false;",
    ),
  );
  return $form;
}