You are here

function nodequeue_view_subqueues in Nodequeue 5.2

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

Display a list of subqueues for a queue and their sizes

1 call to nodequeue_view_subqueues()
nodequeue_admin_view in ./nodequeue.module
Page callback to view a queue.

File

./nodequeue.module, line 511

Code

function nodequeue_view_subqueues($queue) {

  // Fetch all of the subqueues.
  $subqueues = nodequeue_load_subqueues_by_queue($queue->qid);
  $header = array(
    t('Title'),
    t('In queue'),
    t('Operation'),
  );
  $rows = array();
  foreach ($subqueues as $subqueue) {
    if (nodequeue_api_subqueue_access($subqueue, NULL, $queue)) {
      $sub_text = nodequeue_subqueue_size_text($queue->size, $subqueue->count, FALSE);
      $rows[] = array(
        array(
          'class' => 'nodequeue-title',
          'data' => check_plain($subqueue->title),
        ),
        array(
          'class' => 'nodequeue-subqueues',
          'data' => $sub_text,
        ),
        array(
          'class' => 'nodequeue-operation',
          'data' => l(t('View'), "admin/content/nodequeue/{$queue->qid}/view/{$subqueue->sqid}"),
        ),
      );
    }
  }
  $output = '<p>' . t('Max nodes in queue: @size', array(
    '@size' => $queue->size ? $queue->size : t("Infinite"),
  )) . '</p>';
  $output .= theme('table', $header, $rows);
  $output .= theme('pager', NULL, 20);
  return $output;
}