You are here

function rh_node_ctools_render_alter in Rabbit Hole 7.2

Implements hook_ctools_render_alter().

This is done since hook_node_view never gets called if the node is rendered by Ctools.

File

modules/rh_node/rh_node.module, line 114
Main module file for Rabbit Hole nodes module.

Code

function rh_node_ctools_render_alter($info, $page, $context) {
  if ($page) {
    if (isset($context['handler']) && !empty($context['handler']->conf['context']) && $context['handler']->task === 'node_view') {
      $node = $context['contexts'][$context['handler']->conf['context']]->data;
      if (!user_access('bypass rh_node')) {
        rabbit_hole_execute('node', $node);
      }
    }
  }
}