You are here

function hansel_action_add_link_to_current_page_get_crumbs in Hansel breadcrumbs 8

Same name and namespace in other branches
  1. 7 hansel.actions.inc \hansel_action_add_link_to_current_page_get_crumbs()

Callback for the "add link to current page" breadcrumb action to generate the crumbs.

Parameters

array $arguments:

Return value

array

1 string reference to 'hansel_action_add_link_to_current_page_get_crumbs'
hansel_hansel_action_types in ./hansel.module
Implements hook_hansel_action_types().

File

./hansel.actions.inc, line 176
Hansel breadcrumb actions

Code

function hansel_action_add_link_to_current_page_get_crumbs($arguments) {
  $args = array();
  $i = 0;
  while ($arg = hansel_arg($i++)) {
    $args[] = $arg;
  }
  $title = drupal_get_title();

  // Prevent title from double encoding
  $title = decode_entities($title);
  if (!empty($title)) {
    return array(
      array(
        'title' => $title,
        'href' => implode('/', $args),
      ),
    );
  }
}