You are here

function nodequeue_nodequeue_form_submit in Nodequeue 6.2

Same name and namespace in other branches
  1. 5.2 nodequeue.module \nodequeue_nodequeue_form_submit()
  2. 7.3 nodequeue.module \nodequeue_nodequeue_form_submit()
  3. 7.2 nodequeue.module \nodequeue_nodequeue_form_submit()

Implementation of hook_nodequeue_form_submit()

File

./nodequeue.module, line 1363
Maintains queues of nodes in arbitrary order.

Code

function nodequeue_nodequeue_form_submit(&$queue, $form_state) {

  // This will add a single subqueue to our new queue.
  if (!isset($queue->qid) && !isset($queue->add_subqueue)) {

    // A 0 will set the reference to the sqid of the queue.
    $queue->add_subqueue = array(
      0 => $queue->title,
    );
  }

  //If the qid is set at this point, we're saving an existing queue.
  if (isset($queue->qid)) {

    //We don't check to see if the title has been updated since the $queue object already matches $form_state['values'].
    db_query("UPDATE {nodequeue_subqueue} SET title = '%s' WHERE qid = %d", array(
      $form_state['values']['title'],
      $queue->qid,
    ));
  }
}