You are here

function nodequeue_admin_view in Nodequeue 5.2

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

Page callback to view a queue.

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

File

./nodequeue.module, line 769

Code

function nodequeue_admin_view($queue, $sqid = NULL) {
  $qid = $queue->qid;

  // If the queue has just one subqueue, it gets special treatment.
  if (!$sqid) {
    if ($queue->subqueues == 1) {
      $subqueues = nodequeue_load_subqueues_by_queue($queue->qid);
      $subqueue = array_shift($subqueues);
    }
    else {

      // display subqueue list page.
      return nodequeue_view_subqueues($queue);
    }
    $sqid = $queue->current;
  }
  else {
    if ($sqid) {

      // Adjust properties of the page so our subqueue is in the right
      // visual place.
      $subqueue = nodequeue_load_subqueue($sqid);
      if (!nodequeue_api_subqueue_access($subqueue, NULL, $queue)) {
        return drupal_not_found();
      }
      drupal_set_title(t("Subqueue '@title'", array(
        '@title' => nodequeue_title_substitute($queue->subqueue_title, $queue, $subqueue),
      )));
      $breadcrumb = drupal_get_breadcrumb();
      $breadcrumb[] = l($queue->title, "admin/content/nodequeue/{$queue->qid}");
      drupal_set_breadcrumb($breadcrumb);
    }
  }
  return nodequeue_arrange_subqueue($queue, $subqueue);
}