You are here

function tzfield_autocomplete in Time Zone Field 7

Same name and namespace in other branches
  1. 6 tzfield.module \tzfield_autocomplete()

Retrieve an array of autocomplete suggestions.

1 string reference to 'tzfield_autocomplete'
tzfield_menu in ./tzfield.module
Implements hook_menu().

File

./tzfield.module, line 166
Defines a time zone field type.

Code

function tzfield_autocomplete($field_name, $string = '', $arg4 = '', $arg5 = '') {
  if ($arg4) {
    $string .= '/' . $arg4;
  }
  if ($arg5) {
    $string .= '/' . $arg5;
  }
  $string = preg_replace(';[^a-z0-9/_-];i', '', str_replace(' ', '_', trim($string)));
  drupal_json_output($string ? preg_grep(';' . $string . ';i', tzfield_options_list(field_info_field($field_name))) : array());
}