You are here

class og_CrumbsMultiPlugin_groups_overview in Crumbs, the Breadcrumbs suite 7.2

Same name in this branch
  1. 7.2 plugins/crumbs.og.inc \og_CrumbsMultiPlugin_groups_overview
  2. 7.2 plugins/crumbs.og.2.inc \og_CrumbsMultiPlugin_groups_overview
Same name and namespace in other branches
  1. 7 plugins/crumbs.og.inc \og_CrumbsMultiPlugin_groups_overview
  2. 7 plugins/crumbs.og.2.inc \og_CrumbsMultiPlugin_groups_overview

Make $groups_overview_path the parent path for group nodes. The priorities can be configured per group node type.

Hierarchy

Expanded class hierarchy of og_CrumbsMultiPlugin_groups_overview

File

plugins/crumbs.og.inc, line 87

View source
class og_CrumbsMultiPlugin_groups_overview implements crumbs_MultiPlugin {
  protected $groupsOverviewPath;

  /**
   * @param string $groups_overview_path
   *   The path to be used as parent for all group nodes.
   */
  function __construct($groups_overview_path) {
    $this->groupsOverviewPath = $groups_overview_path;
  }

  /**
   * {@inheritdoc}
   */
  function describe($api) {
    $types = node_type_get_types();
    foreach ($types as $type) {
      if (og_is_group_type('node', $type->type)) {
        $api
          ->addRule($type->type);
      }
    }
  }

  /**
   * @param string $path
   * @param array $item
   *
   * @return array|null
   */
  function findParent__node_x($path, $item) {
    if (FALSE === ($node = crumbs_Util::itemExtractEntity($item, 'node', 1))) {
      return NULL;
    }
    $items = field_get_items('node', $node, 'group_group');
    if ($items) {
      return array(
        $node->type => 'group-list',
      );
    }
    return NULL;
  }

}

Members