uc_order_address_book_form

  1. drupal
    1. 6 uc_order.admin.inc function
    2. 7 uc_order.admin.inc function
Drupal 7 uc_order_address_book_form($form, &$form_state, $uid = 0, $type = 'billing', $func = '')

Presents previously entered addresses as selectable options.

See also

uc_order_address_book()

Related topics

1 string reference to 'uc_order_address_book_form'

File

sites/all/modules/ubercart/uc_order/uc_order.admin.inc, line 686
Order administration menu items.

Code

function uc_order_address_book_form($form, &$form_state, $uid = 0, $type = 'billing', $func = '') {
  $select = uc_select_address($uid, $type, $func);

  if ($uid == 0) {
    $form['desc'] = array('#markup' => '<br />' . t('You must select a customer before address<br />information is available.<br />') . '<br />');
  }
  elseif (is_null($select)) {
    $form['desc'] = array('#markup' => '<br />' . t('No addresses found for customer.') . '<br />');
  }
  else {
    $form['addresses'] = uc_select_address($uid, $type, $func, t('Select an address'));
    $form['addresses']['#prefix'] = '<div style="float: left; margin-right: 1em;">';
    $form['addresses']['#suffix'] = '</div>';
  }

  $form['close'] = array(
    '#type' => 'button', 
    '#value' => t('Close'), 
    '#attributes' => array('onclick' => "return close_address_select('#" . $type . "_address_select');"),
  );

  return $form;
}