function multiple_email_manage in Multiple E-mail Addresses 6
Same name and namespace in other branches
- 7 multiple_email_manage.inc \multiple_email_manage()
- 2.x multiple_email_manage.inc \multiple_email_manage()
FormAPI callback for managing an accounts e-mail addresses.
Parameters
unknown_type $form_state:
unknown_type $account:
2 string references to 'multiple_email_manage'
- multiple_email_menu in ./
multiple_email.module - Implementation of hook_menu().
- multiple_email_menu_alter in ./
multiple_email.module - Implementation of hook_menu_alter().
File
- ./
multiple_email_manage.inc, line 14 - Callbacks for user management of users e-mail addresses.
Code
function multiple_email_manage(&$form_state, $account) {
$form = array();
$addresses = multiple_email_load_addresses($account->uid);
unset($addresses[0]);
$form['#account'] = $account;
$form['addresses']['#tree'] = TRUE;
foreach ($addresses as $email) {
$form['addresses'][$email->eid] = array(
'#email' => $email,
'email' => array(
'#value' => $email->email,
),
);
if (user_access('administer users')) {
$form['addresses'][$email->eid]['confirm'] = array(
'#type' => 'checkbox',
'#title' => t('Confirm this e-mail (<a href="!resend">resend</a>)', array(
'!resend' => url('user/' . $account->uid . '/edit/email-addresses/confirm/' . $email->eid . '/resend'),
)),
'#default_value' => $email->confirmed,
);
}
}
$form['new'] = array(
'email' => array(
'#prefix' => '<div class="add-new-placeholder">' . t('Add new e-mail') . '</div>',
'#type' => 'textfield',
'#size' => 30,
),
'confirm' => array(
'#prefix' => '<div class="add-new-placeholder"></div>',
'#type' => 'checkbox',
'#title' => t('Confirm this e-mail'),
'#access' => user_access('administer users'),
),
);
$form['save'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
return $form;
}