You are here

function uc_store_element_info in Ubercart 7.3

Implements hook_element_info().

File

uc_store/uc_store.module, line 298
Contains global Ubercart functions and store administration functionality.

Code

function uc_store_element_info() {
  $types = array();
  $types['tapir_table'] = array(
    '#columns' => array(),
    '#rows' => array(),
    '#tree' => TRUE,
    '#value' => NULL,
    '#pre_render' => array(
      'tapir_gather_rows',
    ),
    '#theme' => 'tapir_table',
    '#process' => array(
      'ajax_process_form',
    ),
  );
  $types['uc_address'] = array(
    '#input' => TRUE,
    '#required' => TRUE,
    '#process' => array(
      'uc_store_process_address_field',
    ),
    '#attributes' => array(
      'class' => array(
        'uc-store-address-field',
      ),
    ),
    '#theme_wrappers' => array(
      'container',
    ),
    '#key_prefix' => '',
    '#hidden' => FALSE,
  );
  $sign_flag = variable_get('uc_sign_after_amount', FALSE);
  $currency_sign = variable_get('uc_currency_sign', '$');
  $types['uc_price'] = array(
    '#input' => TRUE,
    '#size' => 15,
    '#maxlength' => 15,
    '#autocomplete_path' => FALSE,
    '#process' => array(
      'ajax_process_form',
    ),
    '#element_validate' => array(
      'uc_store_validate_number',
    ),
    '#theme' => 'textfield',
    '#theme_wrappers' => array(
      'form_element',
    ),
    '#field_prefix' => $sign_flag ? '' : $currency_sign,
    '#field_suffix' => $sign_flag ? $currency_sign : '',
    '#allow_negative' => FALSE,
    '#empty_zero' => TRUE,
  );
  $types['uc_quantity'] = array(
    '#input' => TRUE,
    '#size' => 5,
    '#maxlength' => 6,
    '#required' => TRUE,
    '#autocomplete_path' => FALSE,
    '#process' => array(
      'ajax_process_form',
    ),
    '#element_validate' => array(
      'uc_store_validate_uc_quantity',
    ),
    '#theme' => 'textfield',
    '#theme_wrappers' => array(
      'form_element',
    ),
    '#allow_zero' => FALSE,
  );
  return $types;
}