You are here

function context_admin_menu_context_render in Contextual Administration 6

Same name and namespace in other branches
  1. 7 plugins/task_handlers/menu_context.inc \context_admin_menu_context_render()
1 string reference to 'context_admin_menu_context_render'
menu_context.inc in plugins/task_handlers/menu_context.inc

File

plugins/task_handlers/menu_context.inc, line 400

Code

function context_admin_menu_context_render($handler, $base_contexts, $args, $test = TRUE) {

  // Go through arguments and see if they match.
  ctools_include('context');
  ctools_include('context-task-handler');

  // Add my contexts
  $contexts = ctools_context_handler_get_handler_contexts($base_contexts, $handler);

  // Test.
  if ($test && !ctools_context_handler_select($handler, $contexts)) {
    return;
  }
  if (isset($handler->handler)) {
    ctools_context_handler_pre_render($handler, $contexts, $args);
  }
  page_manager_get_current_page(array(
    'name' => $handler->name,
    'task' => $handler->task,
    'subtask' => $handler->subtask,
    'contexts' => $contexts,
    'arguments' => $args,
    'handler' => $handler,
  ));
  $callback = $handler->conf['context_admin_options'];
  if ($callback) {
    $info['content'] = context_admin_plugin_invoke($callback, 'render_page', array(
      &$handler,
      $contexts,
      $args,
      $test,
    ));
  }
  else {
    $info['content'] = t('An error occurred with your context admin handler.  No callback was defined.');
  }
  return $info;
}