You are here

function _cshs_get_parents in Client-side Hierarchical Select 7

Helper to return an array of (localized) parents of a given term.

1 call to _cshs_get_parents()
cshs_field_formatter_view in ./cshs.formatter.inc
Implements hook_field_formatter_view().

File

./cshs.formatter.inc, line 193
All implementations of field formatters.

Code

function _cshs_get_parents($term) {
  $parents = array();

  // Get all parents.
  $parents = taxonomy_get_parents_all($term->tid);

  // Flip the order.
  $parents = array_reverse($parents);
  if (module_exists('i18n_taxonomy')) {

    // Localize terms.
    $parents = i18n_taxonomy_localize_terms($parents);
  }
  return $parents;
}