You are here

class _taxonomy_CrumbsPlugin__hierarchy in Crumbs, the Breadcrumbs suite 6.2

Same name and namespace in other branches
  1. 6 plugins/crumbs.taxonomy.inc \_taxonomy_CrumbsPlugin__hierarchy

Hierarchy

Expanded class hierarchy of _taxonomy_CrumbsPlugin__hierarchy

File

plugins/crumbs.taxonomy.inc, line 24

View source
class _taxonomy_CrumbsPlugin__hierarchy extends _taxonomy_CrumbsPlugin {
  function disabledByDefault() {
    return array(
      '*',
    );
  }

  /**
   * Terms get their parent terms as breadcrumb parent.
   * The method name matches the router path "taxonomy/term/%".
   */
  function findParent__taxonomy_term_x($path, $item) {
    $terms = $item['fragments'][2];
    $terms = taxonomy_terms_parse_string($terms);
    if (isset($terms['tids']) && count($terms['tids']) === 1) {
      $tid = $terms['tids'][0];
      $q = db_query($sql = "\n        SELECT h.parent, d.vid\n        FROM {term_hierarchy} h\n        LEFT JOIN {term_data} d ON (h.tid = d.tid)\n        WHERE d.tid = %d\n        GROUP BY d.vid\n      ", $tid);
      $result = array();
      while ($row = db_fetch_object($q)) {
        if ($row->parent) {
          $result['voc_' . $row->vid] = 'taxonomy/term/' . $row->parent;
        }
      }
      return $result;
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
_taxonomy_CrumbsPlugin::define function
_taxonomy_CrumbsPlugin__hierarchy::disabledByDefault function
_taxonomy_CrumbsPlugin__hierarchy::findParent__taxonomy_term_x function Terms get their parent terms as breadcrumb parent. The method name matches the router path "taxonomy/term/%".