You are here

function notifications_destination_method_subform in Notifications 6.4

Subform with method and address

1 call to notifications_destination_method_subform()
notifications_destination_edit_form in includes/destination.inc
Edit destination form

File

includes/destination.inc, line 59
Destination management

Code

function notifications_destination_method_subform($account, $send_method = NULL, $destination = NULL) {
  $form['destination_account'] = array(
    '#type' => 'value',
    '#value' => $account,
  );
  $send_methods = notifications_send_methods($account);
  $form['destination_method'] = array(
    '#type' => 'fieldset',
    '#tree' => TRUE,
  );
  $form['destination_method']['method'] = array(
    '#type' => 'select',
    '#title' => t('Send method'),
    '#options' => $send_methods,
    '#default_value' => $send_method ? $send_method : messaging_method_default($account),
    '#disabled' => count($send_methods) < 2,
  );
  $form['destination_method']['address'] = array(
    '#type' => 'textfield',
    '#title' => t('Address'),
    '#size' => 40,
    '#required' => TRUE,
    '#default_value' => $destination ? $destination->address : '',
  );
  return $form;
}