You are here

class _taxonomy_CrumbsPlugin__term_name in Crumbs, the Breadcrumbs suite 6

Same name and namespace in other branches
  1. 6.2 plugins/crumbs.taxonomy.inc \_taxonomy_CrumbsPlugin__term_name

Hierarchy

Expanded class hierarchy of _taxonomy_CrumbsPlugin__term_name

File

plugins/crumbs.taxonomy.inc, line 75

View source
class _taxonomy_CrumbsPlugin__term_name {
  function findTitle__taxonomy_term__($path, $item) {
    $terms = $item['fragments'][2];
    $terms = taxonomy_terms_parse_string($terms);
    if (!isset($terms['tids']) || !count($terms['tids'])) {
      return;
    }
    return $this
      ->_buildTermsTitle($terms['tids']);
  }

  /**
   * Terms get their parent terms as breadcrumb parent.
   * The method name matches the router path "taxonomy/term/%".
   */
  protected function _buildTermsTitle($tids) {
    $db_placeholders = db_placeholders($tids);
    $q = db_query($sql_r = db_rewrite_sql($sql = "\n      SELECT t.tid, t.name\n      FROM {term_data} t\n      WHERE t.tid IN ({$db_placeholders})\n    ", 't', 'tid'), $tids);

    // we rebuild the $names-array so it only contains terms the user has access to.
    $names = array();
    while ($term = db_fetch_object($q)) {
      $names[$term->tid] = $term->name;
    }
    return implode(', ', $names);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
_taxonomy_CrumbsPlugin__term_name::findTitle__taxonomy_term__ function
_taxonomy_CrumbsPlugin__term_name::_buildTermsTitle protected function Terms get their parent terms as breadcrumb parent. The method name matches the router path "taxonomy/term/%".