You are here

function autocomplete_deluxe_allowed_terms in Autocomplete Deluxe 7

Same name and namespace in other branches
  1. 7.2 autocomplete_deluxe.module \autocomplete_deluxe_allowed_terms()

Returns all allowed terms for a field without any prefix.

1 call to autocomplete_deluxe_allowed_terms()
autocomplete_deluxe_field_widget_form in ./autocomplete_deluxe.module
Implements hook_field_widget_form().

File

./autocomplete_deluxe.module, line 103
Define enhanced autocomplete wdiget.

Code

function autocomplete_deluxe_allowed_terms($field) {
  $options = array();
  foreach ($field['settings']['allowed_values'] as $tree) {
    if ($vocabulary = taxonomy_vocabulary_machine_name_load($tree['vocabulary'])) {
      if ($terms = taxonomy_get_tree($vocabulary->vid, $tree['parent'])) {
        foreach ($terms as $term) {
          $options[$term->name] = $term->name;
        }
      }
    }
  }
  return $options;
}