You are here

function uc_addresses_element_info in Ubercart Addresses 7

Implements hook_element_info().

Registers address field type, just as in Ubercart 7.x-3.x.

Return value

array A list of input elements that can be used in forms.

See also

uc_addresses_process_address_field()

uc_addresses_validate_address_field()

File

./uc_addresses.module, line 370
Adds user profile address support to Ubercart.

Code

function uc_addresses_element_info() {
  $types = array();
  $types['uc_addresses_address'] = array(
    '#input' => TRUE,
    '#tree' => TRUE,
    '#process' => array(
      'uc_addresses_process_address_field',
    ),
    '#element_validate' => array(
      'uc_addresses_validate_address_field',
    ),
    '#theme' => 'uc_addresses_form',
    '#uc_addresses_address' => NULL,
    '#uc_addresses_context' => 'default',
    '#uc_addresses_required' => TRUE,
    '#key_prefix' => '',
    '#hidden' => FALSE,
  );
  $types['uc_addresses_address_select'] = array(
    '#input' => TRUE,
    '#multiple' => FALSE,
    '#process' => array(
      'uc_addresses_form_process_select_address',
      'form_process_select',
      'ajax_process_form',
    ),
    '#uc_addresses_select_addresses' => array(),
    '#uc_addresses_address_element' => array(),
    '#uc_addresses_address_input' => array(),
    '#theme' => 'select',
    '#theme_wrappers' => array(
      'form_element',
    ),
    '#default_value' => NULL,
  );
  return $types;
}