t("Node edit form"), 'description' => t('A node edit form.'), 'context' => 'panels_context_create_node_edit_form', 'settings form' => 'panels_context_node_edit_form_settings_form', 'settings form validate' => 'panels_context_node_edit_form_settings_form_validate', 'keyword' => 'node_edit', 'context name' => 'node_edit_form', ); return $args; } /** * It's important to remember that $conf is optional here, because contexts * are not always created from the UI. */ function panels_context_create_node_edit_form($empty, $node = NULL, $conf = FALSE) { $context = new panels_context(array('form', 'node_edit', 'node_form', 'node')); $context->plugin = 'node_edit_form'; if ($empty) { return $context; } if ($conf) { // In this case, $node is actually our $conf array. $node = node_load($node['nid']); } if (!empty($node) && node_access('update', $node)) { // This is from node_edit_page cause Drupal still doesn't use fapi right. if ($_POST['op'] == t('Delete')) { // Note: we redirect from node/nid/edit to node/nid/delete to make the tabs disappear. if ($_REQUEST['destination']) { $destination = drupal_get_destination(); unset($_REQUEST['destination']); } drupal_goto('node/'. $node->nid .'/delete', $destination); } $form = drupal_retrieve_form($node->type . '_node_form', $node); drupal_process_form($node->type . '_node_form', $form); // Fill in the 'node' portion of the context $context->data = $node; $context->title = $node->title; $context->argument = $node->nid; $context->form = $form; $context->form_id = $node->type . '_node_form'; $context->form_title = $node->title; $context->node_type = $node->type; return $context; } } function panels_context_node_edit_form_settings_form($conf, $external = FALSE) { if ($external) { $form['external'] = array( '#type' => 'checkbox', '#default_value' => $conf['external'], '#title' => t('Require this context from an external source (such as a containing panel page).'), '#description' => t('If selected, node selection (below) will be ignored.'), ); } $form['node'] = array( '#prefix' => '