You are here

function queue_ui_queues in Queue UI 7.2

Same name and namespace in other branches
  1. 6 queue_ui.module \queue_ui_queues()
  2. 7 queue_ui.module \queue_ui_queues()

Get queues.

Return value

Array of queues indexed by name and containing queue object and number of items.

1 call to queue_ui_queues()
queue_ui_overview_form in ./queue_ui.pages.inc

File

./queue_ui.module, line 178
queue_ui.module

Code

function queue_ui_queues() {
  $queues = array();
  $queue_names = queue_ui_queue_names();
  if (!empty($queue_names)) {

    // Build array of queues indexed by name with number of items.
    foreach ($queue_names as $name) {
      $queue = DrupalQueue::get($name->name);
      $class = get_class($queue);
      $queues[$class][$name->name] = array(
        'queue' => $queue,
        'items' => $queue
          ->numberOfItems(),
      );
    }
  }
  return $queues;
}