You are here

class forum_CrumbsMonoPlugin_forumTermName in Crumbs, the Breadcrumbs suite 7.2

Same name and namespace in other branches
  1. 7 plugins/crumbs.forum.inc \forum_CrumbsMonoPlugin_forumTermName

Hierarchy

Expanded class hierarchy of forum_CrumbsMonoPlugin_forumTermName

File

plugins/crumbs.forum.inc, line 66

View source
class forum_CrumbsMonoPlugin_forumTermName implements crumbs_MonoPlugin {

  /**
   * {@inheritdoc}
   */
  function describe($api) {
    $api
      ->titleWithLabel(t('The forum\'s term name'), t('Title'));
  }

  /**
   * Forums get their parent forums as breadcrumb parent.
   * The method name matches the router path "forum/%".
   * Forums are actually taxonomy terms, just the path is different.
   *
   * @param string $path
   * @param array $item
   *
   * @return string|null
   */
  function findTitle__forum_x($path, $item) {

    // Load the forum term, even if the wildcard loader has been replaced or
    // removed. This will use entity_load() and not forum_forum_load(), because
    // we don't need the forum stuff here.
    $term = crumbs_Util::itemExtractEntity($item, 'taxonomy_term', 1);
    if (FALSE === $term || empty($term->name)) {
      return NULL;
    }
    return $term->name;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
forum_CrumbsMonoPlugin_forumTermName::describe function Overrides crumbs_MonoPlugin::describe
forum_CrumbsMonoPlugin_forumTermName::findTitle__forum_x function Forums get their parent forums as breadcrumb parent. The method name matches the router path "forum/%". Forums are actually taxonomy terms, just the path is different.