You are here

function context_ctools_render_alter in Context 6.2

Same name and namespace in other branches
  1. 6.3 context.core.inc \context_ctools_render_alter()
  2. 7.3 context.core.inc \context_ctools_render_alter()

Implementation of hook_ctools_render_alter().

Used to detect the presence of a page manager node view or node form.

File

./context.core.inc, line 323

Code

function context_ctools_render_alter($info, $page, $args, $contexts, $task, $subtask) {
  if ($page && in_array($task['name'], array(
    'node_view',
    'node_edit',
  ), TRUE)) {
    foreach ($contexts as $ctools_context) {
      if ($ctools_context->type === 'node' && !empty($ctools_context->data)) {
        context_node_condition($ctools_context->data, $task['name'] === 'node_view' ? 'view' : 'form');
        break;
      }
    }
  }
}