$account->name))); // Get the smartqueue_users queues. $queues = smartqueue_users_get_all_queues(); // Get the existing subqueues for each smartqueue_users queue. $subqueues = array(); foreach ($queues as $qid => $queue) { $subqueues[$qid] = nodequeue_load_subqueues_by_reference(smartqueue_users_get_subqueue_references($account, $queue)); // Add the privacy setting for each subqueue. foreach ($subqueues[$qid] as $sqid => $subqueue) { $subqueues[$qid][$sqid]->privacy = smartqueue_users_subqueue_get_privacy($subqueue); } } // Return the themed content. return theme('smartqueue_users_profile_page', $account, $queues, $subqueues); } /** * Display a subqueue. */ function smartqueue_users_subqueue_view($account, $queue, $subqueue) { _smartqueue_users_sanity_check($account, $queue, $subqueue); // Set the page's title to the subqueue's title drupal_set_title($subqueue->title); // Check if views is enabled and a view has been defined for this queue if (module_exists('views') && ($view_id = _smartqueue_users_settings_get('view', $queue->qid)) != -1) { // If it is, load and execute it $view = views_get_view($view_id); $output = $view->execute_display('default', array($subqueue->sqid)); // Set the page's title to the view's title when relevant if ($view->build_info['title']) { drupal_set_title($view->build_info['title']); } } else { // Otherwise print using the default display if ($subqueue->count > 0) { $output = nodequeue_view_nodes($subqueue->sqid); } else { $output = theme('smartqueue_users_subqueue_empty', $subqueue); } } // If the user can manipulate, we print the relevant manipulation method if (smartqueue_users_can_manipulate($account)) { switch ((int)_smartqueue_users_settings_get('manipulation_method', $queue->qid)) { case SMARTQUEUE_USERS_MANIPULATION_UI: $output .= nodequeue_arrange_subqueue($queue, $subqueue); break; case SMARTQUEUE_USERS_MANIPULATION_LINK: $options = array( 'query' => array('destination' => $_GET['q']), 'attributes' => array('class' => 'smartqueue-users-manipulate-link'), ); $output .= l(t('Manipulate this subqueue'), "admin/content/nodequeue/$queue->qid/view/$subqueue->sqid", $options); break; case SMARTQUEUE_USERS_MANIPULATION_HIDDEN: default: break; } } return $output; }