You are here

function countries_element_info in Countries 7

Same name and namespace in other branches
  1. 8 countries.module \countries_element_info()
  2. 7.2 countries.module \countries_element_info()

Implement hook_element_info().

File

./countries.module, line 128

Code

function countries_element_info() {
  $type['country'] = array(
    '#input' => TRUE,
    '#size' => 0,
    '#multiple' => FALSE,
    '#process' => array(
      'countries_country_expand',
      'form_process_select',
      'ajax_process_form',
    ),
    '#element_validate' => array(
      'countries_country_element_validate',
    ),
    '#theme' => 'select',
    '#theme_wrappers' => array(
      'form_element',
    ),
    // Filter based on enabled flag or continents to filter the options.
    // 'enabled' => COUNTRIES_ENABLED || 'enabled' => COUNTRIES_DISABLED || 'enabled' => COUNTRIES_ALL
    // 'continents' => array() === 'continents' => NULL || 'continents' => array('EU', 'AS')
    // EG: '#filters' => array('enabled' => COUNTRIES_ENABLED, 'continents' => array('EU'))
    '#filters' => array(),
    // If empty, the default list is the system country list, which is the
    // list of all enabled countries, which runs through hook_countries_alter().
    // Otherwise, the module runs it's own country list based on the filters.
    '#options' => array(),
  );
  return $type;
}