You are here

function _phone_element_info in Phone 7.2

Implements hook_element_info().

1 call to _phone_element_info()
phone_element_info in ./phone.module
Implements hook_element_info().

File

includes/phone.element.inc, line 11
Provides FAPI implementation for a phone element.

Code

function _phone_element_info() {
  $path = drupal_get_path('module', 'phone');
  $types['phone'] = array(
    '#input' => TRUE,
    '#process' => array(
      'ajax_process_form',
      'phone_element_process',
    ),
    '#element_validate' => array(
      'phone_element_validate',
    ),
    '#theme_wrappers' => array(
      'phone',
    ),
    '#attached' => array(
      'css' => array(
        $path . '/theme/phone.css',
      ),
    ),
    '#phone_settings' => array(
      'label_position' => 'none',
      'use_tel_input' => TRUE,
      'number_size' => 30,
      'numbertype_allowed_values' => array(
        'home' => t('Home'),
        'work' => t('Work'),
        'mobile' => t('Mobile'),
        'fax' => t('Fax'),
      ),
      'bubble_errors' => FALSE,
      'enable_numbertype' => TRUE,
      'numbertype_allowed_values_position' => 'before',
      'enable_extension' => FALSE,
      'extension_size' => 7,
      'country_options' => array(
        'enable_default_country' => TRUE,
        'default_country' => NULL,
        'all_country_codes' => TRUE,
        'country_codes' => array(
          'hide_single_cc' => FALSE,
          'country_selection' => array(),
        ),
        'country_code_position' => 'after',
      ),
    ),
  );
  $types['phone_tel'] = array(
    '#input' => TRUE,
    '#size' => 30,
    '#maxlength' => 128,
    '#autocomplete_path' => FALSE,
    '#process' => array(
      'ajax_process_form',
    ),
    '#theme' => 'phone_tel',
    '#theme_wrappers' => array(
      'form_element',
    ),
  );
  return $types;
}