You are here

function finder::element_parents in Finder 7.2

Get an array of the element's ancestors (parent will be the first item).

1 call to finder::element_parents()
finder::element_depth in includes/finder.inc
Get the element's depth.

File

includes/finder.inc, line 226
finder.inc

Class

finder
An object to contain all of the data to generate a finder, plus the member functions to build the finder, and render the output.

Code

function element_parents($element) {
  $parents = array();
  $parent = isset($element->parent) ? $element->parent : NULL;
  while (!empty($parent)) {
    $parents[] = $parent;
    $parent_element =& $this->elements[$parent];
    $parent = $parent_element->parent;
  }
  return $parents;
}