You are here

function custom_breadcrumbs_panels_nodeapi in Custom Breadcrumbs 6.2

Implements hook_nodeapi().

File

custom_breadcrumbs_panels/custom_breadcrumbs_panels.module, line 75

Code

function custom_breadcrumbs_panels_nodeapi($node, $op, $teaser, $page) {
  static $module_weights = array();
  if ($op == 'alter' && empty($teaser) && !empty($page) && $node->type == 'panel') {

    // Loop through content objects and call hook_nodeapi for custom_breadcrumbs
    // and its submodules for each node object.
    $display = panels_load_display($node->panels_node['did']);
    $contents = $display->content;
    foreach ((array) $contents as $content) {
      if (isset($content->configuration['nid'])) {
        $node_context = node_load($content->configuration['nid']);
        if (empty($module_weights)) {
          $modules = module_implements('cb_breadcrumb_info');
          $module_weights = _custom_breadcrumbs_get_module_weight($modules);
          unset($module_weights['custom_breadcrumbs_panels']);
        }
        foreach ($module_weights as $module_name => $weight) {
          $func = $module_name . '_nodeapi';
          if (function_exists($func)) {
            $func($node_context, 'alter', array(), array(
              1,
            ));
          }
        }
      }
    }
  }
}