You are here

function uc_order_address_book_form in Ubercart 7.3

Same name and namespace in other branches
  1. 5 uc_order/uc_order.module \uc_order_address_book_form()
  2. 6.2 uc_order/uc_order.admin.inc \uc_order_address_book_form()

Presents previously entered addresses as selectable options.

See also

uc_order_address_book()

1 string reference to 'uc_order_address_book_form'
uc_order_address_book in uc_order/uc_order.admin.inc
Displays a form to select a previously entered address.

File

uc_order/uc_order.admin.inc, line 633
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;
}