function nodequeue_get_all_qids in Nodequeue 5.2
Same name and namespace in other branches
- 6.2 nodequeue.module \nodequeue_get_all_qids()
- 7.2 nodequeue.module \nodequeue_get_all_qids()
Get an array all 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 0 will be all queues.
$pager_element: In the rare event this should use another pager element, set this..
Return value
$qids An array in the format: @code { array($qid => array('qid' => $qid, 'show_in_tab' ' => true/false, 'show_in_links' => true/false }
11 calls to nodequeue_get_all_qids()
- action_nodequeue_add in ./
nodequeue.actions.inc - Old-style action to add a node to a queue.
- action_nodequeue_remove in ./
nodequeue.actions.inc - Old-style action to remove a node from a queue.
- nodequeue_add_action_form in ./
nodequeue.actions.inc - Configuration form for Add to Node Queues action.
- nodequeue_generate_form in ./
nodequeue_generate.module - nodequeue_generate_rehash in ./
nodequeue_generate.module - Rebuild all smartqueue_taxonomy queues. Useful after a data migration has wiped your terms. When more smartqueue modules arrive, revisit this function.
File
- ./
nodequeue.module, line 1539
Code
function nodequeue_get_all_qids($page_size = 25, $pager_element = 0) {
static $cache = NULL;
if (!isset($cache)) {
$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 = $qids;
}
return $cache;
}