You are here

function smartqueue_term_tab_access in Nodequeue 7.2

Access callback for smartqueue_term_tab().

Parameters

$term: The fully loaded taxonomy term that will be loaded by the hook_menu.

Return value

boolean

1 string reference to 'smartqueue_term_tab_access'
smartqueue_menu in modules/smartqueue/smartqueue.module
Implements hook_menu().

File

modules/smartqueue/smartqueue.module, line 51

Code

function smartqueue_term_tab_access($term) {
  if (!variable_get('smartqueue_use_tab', TRUE) || !user_access('manipulate queues')) {

    // For performance reasons: If the menu tab is disabled or the user can't
    // manipulate queues, there is no reason to run the rest of these queries.
    return FALSE;
  }

  // Check that user has access.
  if (_nodequeue_access_admin_or_manipulate()) {

    // Check that there are queues.
    $subqueues = smartqueue_get_subqueues_by_term($term);
    if (empty($subqueues)) {
      return FALSE;
    }
    return TRUE;
  }
  return FALSE;
}