You are here

function nodequeue_reference_nodequeue_edit_submit in Nodequeue reference 7

Submit callback for closing the dialog tab. If creating a new Nodequeue, we will be directed to the callback for modifing the nodequeue nodes. The menu callback will output javascript that will close the dialog, and pass paramenters to the main window. Note that the field value will be overriden in the end.

1 string reference to 'nodequeue_reference_nodequeue_edit_submit'
nodequeue_reference_form_nodequeue_edit_queue_form_alter in ./nodequeue_reference.module
Implements hook_form_FORM_ID_alter().

File

./nodequeue_reference.module, line 47
Form field type for node queues.

Code

function nodequeue_reference_nodequeue_edit_submit($form, &$form_state) {
  $qid = $form_state['values']['qid'];
  $is_new = !empty($_GET['nodequeue-new-dialog']);
  if ($is_new) {

    // If creating a new nodequeue, go to the nodequeue view for adding nodes.
    $subqueues = nodequeue_load_subqueues_by_queue($qid);
    $keys = array_keys($subqueues);
    $sqid = reset($keys);
    $_GET['destination'] = "admin/structure/nodequeue/{$qid}/view/{$sqid}" . '?render=references-dialog';
  }
  else {
    $_GET['destination'] = "nodequeue-reference/dialog/redirect/{$qid}" . '?render=references-dialog&references-dialog-close=1';
  }
}