You are here

function nodequeue_get_all_qids in Nodequeue 6.2

Same name and namespace in other branches
  1. 5.2 nodequeue.module \nodequeue_get_all_qids()
  2. 7.2 nodequeue.module \nodequeue_get_all_qids()

Get an array of qids using the pager query. This administrative list does no permission checking, so should only be available to users who have passed the 'administer queues' check.

Parameters

$page_size: The page size to use. If this is 0 or NULL, all queues will be returned. Defaults to 0.

$pager_element: In the rare event this should use another pager element, set this..

$bypass_cache: Boolean value indicating whether to bypass the cache or not.

Return value

$qids An array in the format: @code { array($qid => $qid) }

13 calls to nodequeue_get_all_qids()
nodequeue_add_action_form in ./nodequeue.module
Configuration form for Add to Nodequeues action.
nodequeue_apachesolr_modify_query in ./nodequeue.module
Implementation of hook_apachesolr_modify_query().
nodequeue_apachesolr_update_index in ./nodequeue.module
Implementation of hook_apachesolr_update_index().
nodequeue_form_apachesolr_search_bias_form_alter in ./nodequeue.module
Implementation of hook_form_FORM_ID_alter().
nodequeue_generate_form in ./nodequeue_generate.module

... See full list

File

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

Code

function nodequeue_get_all_qids($page_size = 0, $pager_element = 0, $bypass_cache = FALSE) {
  static $cache = array();
  if ($bypass_cache || empty($cache[$page_size])) {
    $sql = 'SELECT nq.qid ' . 'FROM {nodequeue_queue} nq ' . 'WHERE nq.show_in_ui = 1 ';
    $count_sql = 'SELECT COUNT(q.qid) FROM {nodequeue_queue} q WHERE q.show_in_ui = 1 ';
    if ($page_size) {
      $result = pager_query($sql, $page_size, $pager_element, $count_sql);
    }
    else {
      $result = db_query($sql, $count_sql);
    }
    $qids = array();
    while ($qid = db_fetch_object($result)) {
      $qids[$qid->qid] = $qid->qid;
    }
    $cache[$page_size] = $qids;
  }
  return $cache[$page_size];
}