public function actionLoadQueueNav($id)
{
if (!($queue = models\Queue::model()->findByPk((int) $id))) {
throw new \CHttpException(404, "Queue not found with id {$id}");
}
$root = $queue->getRootQueue();
if (is_array($root)) {
throw new \CHttpException(501, "Don't currently support queues with multiple roots");
}
$queueset = models\QueueSet::model()->findByAttributes(array('initial_queue_id' => $root->id));
$resp = array('rootid' => $root->id, 'queuesetid' => $queueset->id, 'nav' => $this->renderPartial('queue_nav_item', array('queueset' => $queueset, 'queue' => $root), true));
echo \CJSON::encode($resp);
}