Merge branch 'master' of dev.sourcefabric.org:campcaster

This commit is contained in:
naomiaro 2011-02-09 22:37:26 -05:00
commit d5efcac452
56 changed files with 1166 additions and 510 deletions

View file

@ -85,6 +85,9 @@ class LibraryController extends Zend_Controller_Action
'title' => 'Close');
}
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Playlist/metadata/format/json/id/#id#', 'callback' => 'window["createPlaylistMetaForm"]'),
'title' => 'Edit Metadata');
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Playlist/delete'.$params, 'callback' => 'window["deletePlaylist"]'),
'title' => 'Delete');

View file

@ -6,27 +6,38 @@ class NowplayingController extends Zend_Controller_Action
public function init()
{
$ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('get-data-grid-data', 'json')
->initContext();
$ajaxContext->addActionContext('get-data-grid-data', 'json')
->initContext();
}
public function indexAction()
{
$this->view->headScript()->appendFile('/js/datatables/js/jquery.dataTables.min.js','text/javascript');
$this->view->headScript()->appendFile('/js/playlist/nowplayingdatagrid.js','text/javascript');
$this->view->headScript()->appendFile('/js/playlist/nowview.js','text/javascript');
}
public function getDataGridDataAction()
{
$viewType = $this->_request->getParam('view');
$this->view->entries = Application_Model_Nowplaying::GetDataGridData($viewType);
$dateString = $this->_request->getParam('date');
$this->view->entries = Application_Model_Nowplaying::GetDataGridData($viewType, $dateString);
}
public function livestreamAction()
{
//use bare bones layout (no header bar or menu)
$this->_helper->layout->setLayout('bare');
$this->_helper->layout->setLayout('bare');
}
public function dayViewAction()
{
$this->view->headScript()->appendFile('/js/datatables/js/jquery.dataTables.min.js','text/javascript');
$this->view->headScript()->appendFile('/js/playlist/nowplayingdatagrid.js','text/javascript');
$this->view->headScript()->appendFile('/js/playlist/dayview.js','text/javascript');
}
}
@ -35,3 +46,5 @@ class NowplayingController extends Zend_Controller_Action

View file

@ -88,7 +88,7 @@ class PlaylistController extends Zend_Controller_Action
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$pl = new Playlist();
$pl_id = $pl->create("Test Zend Auth");
$pl_id = $pl->create("Untitled Playlist");
$pl->setPLMetaData('dc:creator', $userInfo->login);
$this->changePlaylist($pl_id);

View file

@ -2,16 +2,12 @@
class ScheduleController extends Zend_Controller_Action
{
protected $sched_sess = null;
public function init()
{
if(!Zend_Auth::getInstance()->hasIdentity())
{
$this->_redirect('login/index');
}
$ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('event-feed', 'json')
->addActionContext('make-context-menu', 'json')
->addActionContext('add-show-dialog', 'json')
@ -26,6 +22,7 @@ class ScheduleController extends Zend_Controller_Action
->addActionContext('get-current-playlist', 'json')
->addActionContext('find-playlists', 'json')
->addActionContext('remove-group', 'json')
->addActionContext('edit-show', 'json')
->initContext();
$this->sched_sess = new Zend_Session_Namespace("schedule");
@ -50,7 +47,7 @@ class ScheduleController extends Zend_Controller_Action
$end = $this->_getParam('end', null);
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id, $userInfo->type);
$user = new User($userInfo->id);
if($user->isAdmin())
$editable = true;
else
@ -112,14 +109,8 @@ class ScheduleController extends Zend_Controller_Action
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$show = new Show(new User($userInfo->id, $userInfo->type));
$overlap = $show->addShow($data);
if(isset($overlap)) {
$this->view->overlap = $overlap;
}
else {
$this->_redirect('Schedule');
}
$show->addShow($data);
$this->_redirect('Schedule');
}
}
@ -137,7 +128,7 @@ class ScheduleController extends Zend_Controller_Action
$showInstanceId = $this->_getParam('showInstanceId');
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id, $userInfo->type);
$user = new User($userInfo->id);
if($user->isAdmin()) {
$show = new ShowInstance($showInstanceId);
@ -155,7 +146,7 @@ class ScheduleController extends Zend_Controller_Action
$showInstanceId = $this->_getParam('showInstanceId');
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id, $userInfo->type);
$user = new User($userInfo->id);
if($user->isAdmin()) {
$show = new ShowInstance($showInstanceId);
@ -169,9 +160,9 @@ class ScheduleController extends Zend_Controller_Action
public function deleteShowAction()
{
$showInstanceId = $this->_getParam('id');
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id, $userInfo->type);
$user = new User($userInfo->id);
if($user->isAdmin()) {
$show = new ShowInstance($showInstanceId);
@ -185,7 +176,7 @@ class ScheduleController extends Zend_Controller_Action
$today_timestamp = date("Y-m-d H:i:s");
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id, $userInfo->type);
$user = new User($userInfo->id);
$show = new ShowInstance($id);
@ -214,7 +205,7 @@ class ScheduleController extends Zend_Controller_Action
public function scheduleShowAction()
{
$showInstanceId = $this->sched_sess->showInstanceId;
$showInstanceId = $this->sched_sess->showInstanceId;
$search = $this->_getParam('search', null);
$plId = $this->_getParam('plId');
@ -223,7 +214,7 @@ class ScheduleController extends Zend_Controller_Action
}
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id, $userInfo->type);
$user = new User($userInfo->id);
$show = new ShowInstance($showInstanceId);
if($user->isHost($show->getShowId())) {
@ -242,12 +233,11 @@ class ScheduleController extends Zend_Controller_Action
{
$showInstanceId = $this->_getParam('id');
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id, $userInfo->type);
$user = new User($userInfo->id);
$show = new ShowInstance($showInstanceId);
if($user->isHost($show->getShowId())) {
if($user->isHost($show->getShowId()))
$show->clearShow();
}
}
public function getCurrentPlaylistAction()
@ -257,8 +247,8 @@ class ScheduleController extends Zend_Controller_Action
public function findPlaylistsAction()
{
$post = $this->getRequest()->getPost();
$post = $this->getRequest()->getPost();
$show = new ShowInstance($this->sched_sess->showInstanceId);
$playlists = $show->searchPlaylistsForShow($post);
@ -273,7 +263,7 @@ class ScheduleController extends Zend_Controller_Action
$search = $this->_getParam('search', null);
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id, $userInfo->type);
$user = new User($userInfo->id);
$show = new ShowInstance($showInstanceId);
if($user->isHost($show->getShowId())) {
@ -289,7 +279,7 @@ class ScheduleController extends Zend_Controller_Action
public function scheduleShowDialogAction()
{
$showInstanceId = $this->_getParam('id');
$showInstanceId = $this->_getParam('id');
$this->sched_sess->showInstanceId = $showInstanceId;
$show = new ShowInstance($showInstanceId);
@ -331,13 +321,25 @@ class ScheduleController extends Zend_Controller_Action
public function showContentDialogAction()
{
$showInstanceId = $this->_getParam('id');
$showInstanceId = $this->_getParam('id');
$show = new ShowInstance($showInstanceId);
$this->view->showContent = $show->getShowListContent();
$this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml');
unset($this->view->showContent);
}
public function editShowAction()
{
$showInstanceId = $this->_getParam('id');
$showInstance = new ShowInstance($showInstanceId);
$show = new Show($showInstance->getShowId());
}
}

View file

@ -5,43 +5,89 @@ class UserController extends Zend_Controller_Action
public function init()
{
$ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('get-hosts', 'json')
->initContext();
$ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('get-hosts', 'json')
->addActionContext('get-user-data-table-info', 'json')
->addActionContext('get-user-data', 'json')
->addActionContext('remove-user', 'json')
->initContext();
}
public function indexAction()
{
}
public function addUserAction()
{
$request = $this->getRequest();
$form = new Application_Form_AddUser();
if ($request->isPost()) {
if ($form->isValid($request->getPost())) {
$formdata = $form->getValues();
User::addUser($formdata);
$form->reset();
}
}
$this->view->form = $form;
{
$this->view->headScript()->appendFile('/js/datatables/js/jquery.dataTables.js','text/javascript');
$this->view->headScript()->appendFile('/js/airtime/user/user.js','text/javascript');
$request = $this->getRequest();
$form = new Application_Form_AddUser();
if ($request->isPost()) {
if ($form->isValid($request->getPost())) {
$formdata = $form->getValues();
if ($form->validateLogin($formdata)){
$user = new User($formdata['user_id']);
$user->setFirstName($formdata['first_name']);
$user->setLastName($formdata['last_name']);
$user->setLogin($formdata['login']);
if ($formdata['password'] != "xxxxxx")
$user->setPassword($formdata['password']);
$user->setType($formdata['type']);
$user->save();
$form->reset();
}
}
}
$this->view->form = $form;
}
public function getHostsAction()
{
$search = $this->_getParam('term');
$this->view->hosts = User::getHosts($search);
$search = $this->_getParam('term');
$this->view->hosts = User::getHosts($search);
}
public function getUserDataTableInfoAction()
{
$post = $this->getRequest()->getPost();
$users = User::getUsersDataTablesInfo($post);
die(json_encode($users));
}
public function getUserDataAction()
{
$id = $this->_getParam('id');
$this->view->entries = User::GetUserData($id);
}
public function removeUserAction()
{
// action body
$id = $this->_getParam('id');
$user = new User($id);
$this->view->entries = $user->delete();
}
}