You are here

function nodequeue_edit_queue_form_submit in Nodequeue 5.2

Same name and namespace in other branches
  1. 6.2 includes/nodequeue.admin.inc \nodequeue_edit_queue_form_submit()
  2. 7.3 includes/nodequeue.admin.inc \nodequeue_edit_queue_form_submit()
  3. 7.2 includes/nodequeue.admin.inc \nodequeue_edit_queue_form_submit()

Submit function for the nodequeue_queue form.

File

./nodequeue.module, line 708

Code

function nodequeue_edit_queue_form_submit($formid, $form) {
  if ($form['op'] == t('Delete')) {
    return "admin/content/nodequeue/{$form['qid']}/delete";
  }
  $queue = (object) $form;

  // fix checkboxes
  $queue->roles = array_keys(array_filter($queue->roles));
  $queue->types = array_keys(array_filter($queue->types));
  if (!isset($queue->qid)) {
    $queue->new = TRUE;
  }

  // Modify show_in_links based on whether or not links are available.
  $queue->show_in_links = !empty($queue->link) && !empty($queue->link_remove);
  nodequeue_api_queue_form_submit($queue, $form);
  $qid = nodequeue_save($queue);
  nodequeue_api_queue_form_submit_finish($queue, $form);
  nodequeue_check_subqueue_sizes($queue);
  if ($queue->new) {
    drupal_set_message(t('The queue has been created.'));
  }
  else {
    drupal_set_message(t('The queue has been updated.'));
  }
  return 'admin/content/nodequeue';
}