You are here

class forum_CrumbsMonoPlugin_forumThread in Crumbs, the Breadcrumbs suite 7.2

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

Hierarchy

Expanded class hierarchy of forum_CrumbsMonoPlugin_forumThread

File

plugins/crumbs.forum.inc, line 101

View source
class forum_CrumbsMonoPlugin_forumThread implements crumbs_MonoPlugin {

  /**
   * {@inheritdoc}
   */
  function describe($api) {
    $api
      ->titleWithLabel(t('The forum the node belongs to'), t('Parent'));
  }

  /**
   * Forum nodes get their forum terms as breadcrumb parents.
   * The method name matches the router path "node/%".
   *
   * @param string $path
   * @param array $item
   *
   * @return string|null
   */
  function findParent__node_x($path, $item) {
    $node = crumbs_Util::itemExtractEntity($item, 'node', 1);
    if (FALSE === $node || empty($node->forum_tid) || !_forum_node_check_node_type($node)) {
      return NULL;
    }
    return 'forum/' . $node->forum_tid;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
forum_CrumbsMonoPlugin_forumThread::describe function Overrides crumbs_MonoPlugin::describe
forum_CrumbsMonoPlugin_forumThread::findParent__node_x function Forum nodes get their forum terms as breadcrumb parents. The method name matches the router path "node/%".