You are here

function _webform_defaults_phone in Webform Phone Number 7.2

Same name and namespace in other branches
  1. 7 webform_phone.components.inc \_webform_defaults_phone()

Specify the default properties of a component.

Return value

An array defining the default structure of a component.

File

./webform_phone.components.inc, line 13
Webform Component information for a phone number field type

Code

function _webform_defaults_phone() {
  return array(
    'name' => '',
    'form_key' => NULL,
    'required' => 0,
    'mandatory' => 0,
    'pid' => 0,
    'weight' => 0,
    'value' => '',
    'extra' => array(
      'title_display' => 0,
      'width' => '',
      'disabled' => FALSE,
      'private' => FALSE,
      'attributes' => array(),
      'description' => '',
      'widget_settings' => array(
        //Below are specific to phone field
        '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',
        ),
        'enable_comment' => TRUE,
        'comment_allowed_values_position' => 'before',
        'enable_extension' => FALSE,
        'use_tel_input' => TRUE,
      ),
      'field_settings' => array(
        'number_size' => 15,
        'extension_size' => 6,
        'comment_allowed_values_type' => 'custom',
        'comment_allowed_values' => array(
          'home' => t('Home'),
          'work' => t('Work'),
          'mobile' => t('Mobile'),
          'fax' => t('Fax'),
        ),
        'comment_allowed_values_function' => '',
      ),
      'display_settings' => array(
        'as_tel_link' => FALSE,
        'full_hcard' => FALSE,
        'allow_alpha' => FALSE,
        'components' => array(
          'comment' => 'comment',
          'extension' => 'extension',
        ),
      ),
    ),
  );
}