You are here

function custom_breadcrumbs_nodeapi in Custom Breadcrumbs 6.2

Same name and namespace in other branches
  1. 5 custom_breadcrumbs.module \custom_breadcrumbs_nodeapi()
  2. 6 custom_breadcrumbs.module \custom_breadcrumbs_nodeapi()

Implements hook_nodeapi().

1 call to custom_breadcrumbs_nodeapi()
custom_breadcrumbs_form_alter in ./custom_breadcrumbs.module
Implements hook_form_alter().

File

./custom_breadcrumbs.module, line 186
Provide custom breadcrumbs for node-type pages and base functionality for submodules to add custom breadcrumbs for other types of pages.

Code

function custom_breadcrumbs_nodeapi($node, $op, $teaser, $page) {
  if ($op == 'alter' && empty($teaser) && !empty($page)) {

    // Check for breadcrumb for this node type.
    global $language;
    $languages = array(
      'language' => $language->language,
      'all' => '',
    );
    $breadcrumbs = custom_breadcrumbs_load_breadcrumbs('custom_breadcrumbs', NULL, array(
      'node_type' => $node->type,
    ), $languages);
    if (!empty($breadcrumbs)) {
      $objs = array(
        'node' => $node,
      );
      if ($breadcrumb = custom_breadcrumbs_select_breadcrumb($breadcrumbs, $objs)) {
        custom_breadcrumbs_set_breadcrumb($breadcrumb, $objs);
      }
    }
  }
}