You are here

class forum_CrumbsMonoPlugin_forumThread in Crumbs, the Breadcrumbs suite 7

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

Hierarchy

Expanded class hierarchy of forum_CrumbsMonoPlugin_forumThread

File

plugins/crumbs.forum.inc, line 85

View source
class forum_CrumbsMonoPlugin_forumThread implements crumbs_MonoPlugin {
  function describe($api) {
    return t('Let /forum/456 be the parent path of /node/789, if node 789 is a thread in this forum.');
  }

  /**
   * Forum nodes get their forum terms as breadcrumb parents.
   * The method name matches the router path "node/%".
   */
  function findParent__node_x($path, $item) {
    $node = $item['map'][1];

    // Load the node if it hasn't been loaded due to a missing wildcard loader.
    $node = is_numeric($node) ? node_load($node) : $node;
    if (!empty($node->forum_tid) && _forum_node_check_node_type($node)) {
      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/%".