You are here

function nodequeue_add_action_form in Nodequeue 6.2

Same name and namespace in other branches
  1. 5.2 nodequeue.actions.inc \nodequeue_add_action_form()
  2. 7.3 includes/nodequeue.actions.inc \nodequeue_add_action_form()
  3. 7.2 includes/nodequeue.actions.inc \nodequeue_add_action_form()

Configuration form for Add to Nodequeues action.

File

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

Code

function nodequeue_add_action_form($context) {

  // Default values for form.
  if (!isset($context['qids'])) {
    $context['qids'] = '';
  }
  $queues = nodequeue_load_queues(nodequeue_get_all_qids(0, 0, TRUE), TRUE);
  foreach ($queues as $qid => $queue) {
    $options[$qid] = $queue->title;
  }
  $form = array();
  if (count($options)) {

    // Add form components.
    $form['qids'] = array(
      '#type' => 'select',
      '#title' => t("Queue"),
      '#default_value' => $context['qids'],
      '#multiple' => TRUE,
      '#options' => $options,
      '#required' => TRUE,
      '#description' => t('Specify the queues into which the node should be submitted. If the queue is a smartqueue, the node shall be placed into every subqueue for which it is eligible.'),
    );
  }
  else {
    drupal_set_message(t('Please <a href="@url">create</a> a nodequeue first.', array(
      '@url' => url('admin/content/nodequeue'),
    )));
  }
  return $form;
}