You are here

function nodequeue_admin_remove_node in Nodequeue 6.2

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

Page callback to remove a node from a queue.

1 string reference to 'nodequeue_admin_remove_node'
nodequeue_menu in ./nodequeue.module
Implementation of hook_menu

File

includes/nodequeue.admin.inc, line 77
Admin page callbacks for the nodequeue module.

Code

function nodequeue_admin_remove_node($queue, $subqueue, $node) {
  if (!nodequeue_check_token($node->nid)) {
    return drupal_goto();
  }
  $id = nodequeue_get_content_id($queue, $node);
  nodequeue_subqueue_remove_node($subqueue->sqid, $id);

  // Provide a response if this is javascript.
  if (!empty($_POST['js'])) {
    if (isset($_GET['tab'])) {
      nodequeue_js_output(t('Add to queue'), url("admin/content/nodequeue/{$queue->qid}/add/{$subqueue->sqid}/{$node->nid}", array(
        'query' => nodequeue_get_query_string($node->nid, TRUE, array(
          'tab',
        )),
      )), nodequeue_subqueue_size_text($queue->size, $subqueue->count - 1, FALSE), $subqueue->sqid);
    }
    else {
      nodequeue_js_output(nodequeue_title_substitute($queue->link, $queue, $subqueue), url("admin/content/nodequeue/{$queue->qid}/add/{$subqueue->sqid}/{$node->nid}", array(
        'query' => nodequeue_get_query_string($node->nid, TRUE),
      )));
    }
  }

  // There should always be a destination set for this, so just goto wherever.
  drupal_goto();
}