function action_nodequeue_remove

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

Old-style action to remove a node from a queue.

1 call to action_nodequeue_remove()
action_nodequeue_add in sites/all/modules/local_contrib/nodequeue/includes/
Old-style action to add a node to a queue.


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


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

    case 'do':
      $qids = $edit['qids'];
      // If a node is being deleted, ensure it's also removed from any queues.
      $args = $qids;
      $result = db_select('nodequeue_nodes', 'n')->fields('n')->condition('nid', $node->nid)->condition('qid', $args)->execute()->fetchAll();

      foreach ($result as $obj) {
        // This removes by nid, not position, because if we happen to have a
        // node in a queue twice, the 2nd position would be wrong.
        nodequeue_subqueue_remove_node($obj->sqid, $node->nid);

      // return an HTML config form for the action
    case 'form':
      // default values for form
      if (!isset($edit['qids'])) {
        $edit['qids'] = array();

      $queues = nodequeue_load_queues(nodequeue_get_all_qids(0, 0, TRUE), TRUE);
      foreach ($queues as $qid => $queue) {
        $options[$qid] = $queue->title;

      // add form components
      $form['qids'] = array(
        '#type' => 'select',
        '#title' => t("Queues"),
        '#default_value' => $edit['qids'],
        '#multiple' => TRUE,
        '#decription' => t('Specify the queues from which the node should be removed. If the queue is a smartqueue, the node shall be removed from all subqueues.'),
        '#required' => TRUE,
        '#options' => $options,
      return $form;

      // validate the HTML form

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