You are here

function rules_action_breadcrumb_set in Rules 7.2

Action: Set breadcrumb.

Related topics

1 string reference to 'rules_action_breadcrumb_set'
rules_system_action_info in modules/system.rules.inc
Implements hook_rules_action_info() on behalf of the system module.

File

modules/system.eval.inc, line 71
Contains rules integration for the system module needed during evaluation.

Code

function rules_action_breadcrumb_set(array $titles, array $paths) {
  $trail = array(
    l(t('Home'), ''),
  );
  foreach ($titles as $i => $title) {

    // Skip empty titles.
    if ($title = trim($title)) {

      // Output plaintext instead of a link if there is a title without a path.
      $path = trim($paths[$i]);
      if (!empty($paths[$i]) && $paths[$i] != '<none>') {
        $trail[] = l($title, trim($paths[$i]));
      }
      else {
        $trail[] = check_plain($title);
      }
    }
  }
  drupal_set_breadcrumb($trail);
}