You are here

class _menu_CrumbsPlugin__hierarchy in Crumbs, the Breadcrumbs suite 6

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

Hierarchy

Expanded class hierarchy of _menu_CrumbsPlugin__hierarchy

File

plugins/crumbs.menu.inc, line 16

View source
class _menu_CrumbsPlugin__hierarchy {
  function define($h) {
    $q = db_query($sql = "SELECT menu_name, title FROM {menu_custom}");
    $titles = array();
    while ($row = db_fetch_object($q)) {
      $h
        ->addRule($row->menu_name, $row->title);
    }
  }
  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;
  }

}

Members