You are here

function hansel_og_action_add_og_path_get_crumbs in Hansel breadcrumbs 7

Same name and namespace in other branches
  1. 8 og/hansel_og.module \hansel_og_action_add_og_path_get_crumbs()

Callback for "add og path" breadcrumb action

Parameters

array $arguments Values from the configuration form.:

Return value

array

1 string reference to 'hansel_og_action_add_og_path_get_crumbs'
hansel_og_hansel_action_types in og/hansel_og.module
Implements hook_hansel_action_types().

File

og/hansel_og.module, line 28
Hansel organic groups integration

Code

function hansel_og_action_add_og_path_get_crumbs($arguments) {
  $links = array();
  if (hansel_arg(0) == 'node' && is_numeric(hansel_arg(1))) {
    if ($node = og_get_group_context()) {
      if (in_array($node->type, $arguments['group'])) {
        if ($arguments['type']) {

          // Add the type of group in the breadcrumb
          $links[] = array(
            'title' => drupal_ucfirst($node->type),
            'href' => $arguments['path_' . $node->type],
          );
        }

        // Add group name to breadcrumb
        $links[] = array(
          'title' => $node->title,
          'href' => $node->path,
        );
      }
    }
  }
  return $links;
}