function action_nodequeue_add

cis7 action_nodequeue_add($op, $edit = array(), $node)

Old-style action to add a node to a queue.


sites/all/modules/local_contrib/nodequeue/includes/, line 105 Provides actions integration for nodequeues.


function action_nodequeue_add($op, $edit = array(), $node) {
  switch ($op) {
    case 'metadata':
      return array(
        'description' => t('Add to Nodequeues'),
        'type' => t('node'),
        'batchable' => TRUE,
        'configurable' => TRUE,

    case 'do':
      $queues = nodequeue_load_queues($edit['qids'], TRUE);
      // Filter out queues by node type. We choose not to use nodequeue_get_qids() because it checks for access control which only matters if we administering a queue.
      $eligible_queues = array();
      foreach ($queues as $queue) {
        if (in_array($node->type, $queue->types)) {
          $eligible_queues[$queue->qid] = $queue;

      if (!empty($eligible_queues)) {
        // Remove the node from the eligible queues (if needed).
        action_nodequeue_remove('do', array('qids' => array_keys($eligible_queues)), $node);

        // Use API to get the eligible subqueues
        $eligible_subqueues = nodequeue_get_subqueues_by_node($eligible_queues, $node);

        // Add node to each subqueue.
        foreach ($eligible_subqueues as $subqueue) {
          nodequeue_subqueue_add($queues[$subqueue->qid], $subqueue, $node->nid);

      // return an HTML config form for the action
    case 'form':
      // default values for form
      if (!isset($edit['qids'])) {
        $edit['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' => $edit['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/structure/nodequeue'))));
      return $form;

      // validate the HTML form

      // process the HTML form to store configuration
    case 'submit':
      $params = array(
        'qids' => $edit['qids'],
      return $params;



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.