You are here

function page_manager_node_edit in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 page_manager/plugins/tasks/node_edit.inc \page_manager_node_edit()

Entry point for our overridden node edit.

This function asks its assigned handlers who, if anyone, would like to run with it. If no one does, it passes through to Drupal core's node edit, which is node_page_edit().

1 call to page_manager_node_edit()
page_manager_node_add in page_manager/plugins/tasks/node_edit.inc
Callback to handle the process of adding a node.
1 string reference to 'page_manager_node_edit'
page_manager_node_edit_menu_alter in page_manager/plugins/tasks/node_edit.inc
Callback defined by page_manager_node_edit_page_manager_tasks().

File

page_manager/plugins/tasks/node_edit.inc, line 84

Code

function page_manager_node_edit($node) {

  // Load my task plugin
  $task = page_manager_get_task('node_edit');

  // Load the node into a context.
  ctools_include('context');
  ctools_include('context-task-handler');
  $contexts = ctools_context_handler_get_task_contexts($task, '', array(
    $node,
  ));
  $arg = array(
    isset($node->nid) ? $node->nid : $node->type,
  );
  $output = ctools_context_handler_render($task, '', $contexts, $arg);
  if ($output === FALSE) {

    // Fall back!
    // We've already built the form with the context, so we can't build it again, or
    // form_clean_id will mess up our ids. But we don't really need to, either:
    $context = current($contexts);
    $output = drupal_render_form($context->form_id, $context->form);
  }
  return $output;
}