You are here

function _menu_CrumbsPlugin__hierarchy::findParent in Crumbs, the Breadcrumbs suite 6

Same name and namespace in other branches
  1. 6.2 plugins/crumbs.menu.inc \_menu_CrumbsPlugin__hierarchy::findParent()

File

plugins/crumbs.menu.inc, line 26

Class

_menu_CrumbsPlugin__hierarchy

Code

function findParent($path, $item) {
  $q = db_query($sql = "\n      SELECT\n        parent.link_path parent_path,\n        parent.menu_name menu_name\n      FROM\n        {menu_links} parent\n        INNER JOIN {menu_links} child ON (parent.mlid = child.plid)\n      WHERE child.link_path = '%s'\n      GROUP BY menu_name\n    ", $path);
  $candidates = array();
  while ($row = db_fetch_object($q)) {
    $candidates[$row->menu_name] = $row->parent_path;
  }
  return $candidates;
}