You are here

class forum_CrumbsMonoPlugin_forumTermName in Crumbs, the Breadcrumbs suite 7

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

Hierarchy

Expanded class hierarchy of forum_CrumbsMonoPlugin_forumTermName

File

plugins/crumbs.forum.inc, line 56

View source
class forum_CrumbsMonoPlugin_forumTermName implements crumbs_MonoPlugin {
  function describe($api) {
    return t('Let /forum/123 be the parent path of /forum/456, if 123 is the parent of 456.');
  }

  /**
   * 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.
   */
  function findTitle__forum_x($path, $item) {
    $term = $item['map'][1];

    // Load the forum term,
    // if it hasn't been loaded due to a missing wildcard loader.
    // We could use forum_forum_load() instead, but this looks too scary
    // performance-wise, and we don't actually need it.
    // So we just use taxonomy_term_load() instead.
    $term = is_numeric($term) ? taxonomy_term_load($term) : $term;
    if (!empty($term) && !empty($term->name)) {
      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.