You are here

function getlocations_fields_element_country in Get Locations 7

Same name and namespace in other branches
  1. 7.2 modules/getlocations_fields/getlocations_fields.functions.inc \getlocations_fields_element_country()

Parameters

string $default:

bool $ctools:

Return value

Returns form element

1 call to getlocations_fields_element_country()
getlocations_fields_input_settings_form in modules/getlocations_fields/getlocations_fields.module
input settings form for sharing

File

modules/getlocations_fields/getlocations_fields.functions.inc, line 134
getlocations_fields.functions.inc @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function getlocations_fields_element_country($default, $title = "", $ctools = TRUE) {
  if (empty($title)) {
    $title = t('Country');
  }
  $element = array(
    '#type' => 'select',
    '#title' => $title,
    '#options' => array(
      '' => '',
    ) + getlocations_get_countries_list(),
    '#default_value' => $default,
  );
  if ($ctools) {
    $element['#dependency'] = array(
      'edit-options-origin' => array(
        'postal',
      ),
    );
  }
  return $element;
}