diff --git a/application/Bootstrap.php b/application/Bootstrap.php
index c44768e97..3a7c5b214 100644
--- a/application/Bootstrap.php
+++ b/application/Bootstrap.php
@@ -45,16 +45,14 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
$view = $this->getResource('view');
- $view->headLink()->appendStylesheet('/css/excite-bike/jquery-ui-1.8.7.custom.css');
+ $view->headLink()->appendStylesheet('/css/redmond/jquery-ui-1.8.8.custom.css');
}
protected function _initHeadScript()
{
$view = $this->getResource('view');
$view->headScript()->appendFile('/js/libs/jquery-1.4.4.min.js','text/javascript');
- $view->headScript()->appendFile('/js/libs/jquery-ui-1.8.7.custom.min.js','text/javascript');
- //$view->headScript()->appendFile('/js/playlist/playlist.js','text/javascript');
- //$view->headScript()->appendFile('/js/progressbar/jquery.progressbar.min.js','text/javascript');
+ $view->headScript()->appendFile('/js/libs/jquery-ui-1.8.8.custom.min.js','text/javascript');
}
}
diff --git a/application/configs/navigation.php b/application/configs/navigation.php
index a451b8340..d727466b6 100644
--- a/application/configs/navigation.php
+++ b/application/configs/navigation.php
@@ -22,31 +22,6 @@ $pages = array(
'action' => 'add-user',
'resource' => 'user'
),
- array(
- 'label' => 'Playlists',
- 'module' => 'default',
- 'controller' => 'Playlist',
- 'action' => 'index',
- 'resource' => 'playlist',
- 'pages' => array(
- array(
- 'label' => 'New',
- 'module' => 'default',
- 'controller' => 'Playlist',
- 'action' => 'new',
- 'resource' => 'playlist',
- 'visible' => false
- ),
- array(
- 'label' => 'Edit',
- 'module' => 'default',
- 'controller' => 'Playlist',
- 'action' => 'edit',
- 'resource' => 'playlist',
- 'visible' => false
- )
- )
- ),
array(
'label' => 'Media Library',
'module' => 'default',
diff --git a/application/controllers/LibraryController.php b/application/controllers/LibraryController.php
index da98fae22..7a618fa86 100644
--- a/application/controllers/LibraryController.php
+++ b/application/controllers/LibraryController.php
@@ -38,9 +38,9 @@ class LibraryController extends Zend_Controller_Action
unset($this->search_sess->page);
unset($this->search_sess->md);
+ $this->_helper->actionStack('index', 'playlist');
$this->_helper->actionStack('contents', 'library');
$this->_helper->actionStack('quick-search', 'library');
- $this->_helper->actionStack('index', 'sideplaylist');
}
public function contextMenuAction()
@@ -71,21 +71,18 @@ class LibraryController extends Zend_Controller_Action
if(!isset($pl_sess->id) || $pl_sess->id !== $id) {
$menu[] = array('action' =>
array('type' => 'ajax',
- 'url' => '/Playlist/edit/view/spl'.$params,
+ 'url' => '/Playlist/edit'.$params,
'callback' => 'window["openDiffSPL"]'),
'title' => 'Edit');
}
else if(isset($pl_sess->id) && $pl_sess->id === $id) {
$menu[] = array('action' =>
array('type' => 'ajax',
- 'url' => '/Playlist/close/view/spl'.$params,
+ 'url' => '/Playlist/close'.$params,
'callback' => 'window["noOpenPL"]'),
'title' => 'Close');
}
- $menu[] = array('action' => array('type' => 'gourl', 'url' => '/Playlist/metadata'.$params),
- 'title' => 'Description');
-
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Playlist/delete'.$params, 'callback' => 'window["deletePlaylist"]'),
'title' => 'Delete');
@@ -125,6 +122,7 @@ class LibraryController extends Zend_Controller_Action
public function contentsAction()
{
$this->view->headScript()->appendFile('/js/airtime/library/library.js','text/javascript');
+ $this->view->headLink()->appendStylesheet('/css/media_library.css');
$this->_helper->viewRenderer->setResponseSegment('library');
@@ -214,7 +212,7 @@ class LibraryController extends Zend_Controller_Action
$search = $this->_getParam('search', null);
$this->search_sess->quick_string = $search;
- $categories = array("dc:title", "dc:creator", "dc:source", "ls:type");
+ $categories = array("dc:title", "dc:creator", "dc:source");
$keywords = explode(" ", $search);
$md = array();
diff --git a/application/controllers/PlaylistController.php b/application/controllers/PlaylistController.php
index bd1790e03..f1ab7fa77 100644
--- a/application/controllers/PlaylistController.php
+++ b/application/controllers/PlaylistController.php
@@ -19,6 +19,8 @@ class PlaylistController extends Zend_Controller_Action
->addActionContext('set-cue', 'json')
->addActionContext('move-item', 'json')
->addActionContext('close', 'json')
+ ->addActionContext('new', 'json')
+ ->addActionContext('metadata', 'json')
->addActionContext('edit', 'json')
->addActionContext('delete-active', 'json')
->addActionContext('delete', 'json')
@@ -36,13 +38,10 @@ class PlaylistController extends Zend_Controller_Action
$pl = Playlist::Recall($pl_sess->id);
if($pl === FALSE) {
unset($pl_sess->id);
- $this->_helper->redirector('index');
+ return;
}
-
return $pl;
}
-
- $this->_helper->redirector('index');
}
private function changePlaylist($pl_id){
@@ -80,7 +79,14 @@ class PlaylistController extends Zend_Controller_Action
public function indexAction()
{
-
+ $this->view->headScript()->appendFile('/js/airtime/library/spl.js','text/javascript');
+ $this->view->headLink()->appendStylesheet('/css/playlist_builder.css');
+
+ $this->_helper->viewRenderer->setResponseSegment('spl');
+
+ $pl_sess = $this->pl_sess;
+
+ $this->view->pl = $this->getPlaylist();
}
public function newAction()
@@ -94,7 +100,9 @@ class PlaylistController extends Zend_Controller_Action
$this->changePlaylist($pl_id);
- $this->_helper->redirector('metadata');
+ $form = new Application_Form_PlaylistMetadata();
+
+ $this->view->form = $form->__toString();
}
public function metadataAction()
@@ -121,17 +129,19 @@ class PlaylistController extends Zend_Controller_Action
$formdata = $form->getValues();
$pl = $this->getPlaylist();
- $pl->setPLMetaData(UI_MDATA_KEY_TITLE, $formdata["title"]);
+ $pl->setName($formdata["title"]);
if(isset($formdata["description"])) {
$pl->setPLMetaData(UI_MDATA_KEY_DESCRIPTION, $formdata["description"]);
}
- $this->_helper->redirector('edit');
+ $this->view->pl = $pl;
+ $this->view->html = $this->view->render('playlist/index.phtml');
+ unset($this->view->pl);
}
}
- $this->view->form = $form;
+ $this->view->form = $form->__toString();
}
public function editAction()
@@ -139,7 +149,7 @@ class PlaylistController extends Zend_Controller_Action
$this->view->headScript()->appendFile('/js/airtime/playlist/playlist.js','text/javascript');
$pl_id = $this->_getParam('id', null);
- $display = $this->_getParam('view', null);
+
if(!is_null($pl_id)) {
$this->changePlaylist($pl_id);
}
@@ -147,11 +157,8 @@ class PlaylistController extends Zend_Controller_Action
$pl = $this->getPlaylist();
$this->view->pl = $pl;
-
- if($display === 'spl') {
- $this->view->html = $this->view->render('sideplaylist/index.phtml');
- unset($this->view->pl);
- }
+ $this->view->html = $this->view->render('playlist/index.phtml');
+ unset($this->view->pl);
}
public function addItemAction()
@@ -168,7 +175,7 @@ class PlaylistController extends Zend_Controller_Action
}
$this->view->pl = $pl;
- $this->view->html = $this->view->render('sideplaylist/update.phtml');
+ $this->view->html = $this->view->render('playlist/update.phtml');
$this->view->name = $pl->getName();
$this->view->length = $pl->getLength();
@@ -182,20 +189,13 @@ class PlaylistController extends Zend_Controller_Action
{
$oldPos = $this->_getParam('oldPos');
$newPos = $this->_getParam('newPos');
- $display = $this->_getParam('view');
-
+
$pl = $this->getPlaylist();
$pl->moveAudioClip($oldPos, $newPos);
$this->view->pl = $pl;
-
- if($display === 'pl') {
- $this->view->html = $this->view->render('playlist/update.phtml');
- }
- else {
- $this->view->html = $this->view->render('sideplaylist/update.phtml');
- }
+ $this->view->html = $this->view->render('playlist/update.phtml');
$this->view->name = $pl->getName();
$this->view->length = $pl->getLength();
@@ -205,8 +205,7 @@ class PlaylistController extends Zend_Controller_Action
public function deleteItemAction()
{
$positions = $this->_getParam('pos', array());
- $display = $this->_getParam('view');
-
+
if (!is_array($positions))
$positions = array($positions);
@@ -221,13 +220,7 @@ class PlaylistController extends Zend_Controller_Action
}
$this->view->pl = $pl;
-
- if($display === 'pl') {
- $this->view->html = $this->view->render('playlist/update.phtml');
- }
- else {
- $this->view->html = $this->view->render('sideplaylist/update.phtml');
- }
+ $this->view->html = $this->view->render('playlist/update.phtml');
$this->view->name = $pl->getName();
$this->view->length = $pl->getLength();
@@ -236,27 +229,52 @@ class PlaylistController extends Zend_Controller_Action
public function setCueAction()
{
+ $request = $this->getRequest();
$pos = $this->_getParam('pos');
- $cueIn = $this->_getParam('cueIn', null);
- $cueOut = $this->_getParam('cueOut', null);
-
$pl = $this->getPlaylist();
- $response = $pl->changeClipLength($pos, $cueIn, $cueOut);
- die(json_encode($response));
+ if($request->isPost()) {
+ $cueIn = $this->_getParam('cueIn', null);
+ $cueOut = $this->_getParam('cueOut', null);
+
+ $response = $pl->changeClipLength($pos, $cueIn, $cueOut);
+
+ $this->view->response = $response;
+ return;
+ }
+
+ $cues = $pl->getCueInfo($pos);
+
+ $this->view->pos = $pos;
+ $this->view->cueIn = $cues[0];
+ $this->view->cueOut = $cues[1];
+ $this->view->html = $this->view->render('playlist/set-cue.phtml');
}
public function setFadeAction()
{
+ $request = $this->getRequest();
$pos = $this->_getParam('pos');
- $fadeIn = $this->_getParam('fadeIn', null);
- $fadeOut = $this->_getParam('fadeOut', null);
-
$pl = $this->getPlaylist();
-
- $response = $pl->changeFadeInfo($pos, $fadeIn, $fadeOut);
- die(json_encode($response));
+ if($request->isPost()) {
+ $fadeIn = $this->_getParam('fadeIn', null);
+ $fadeOut = $this->_getParam('fadeOut', null);
+
+ $response = $pl->changeFadeInfo($pos, $fadeIn, $fadeOut);
+
+ $this->view->response = $response;
+ return;
+ }
+
+ $this->view->pos = $pos;
+
+ $fades = $pl->getFadeInfo($pos);
+ $this->view->fadeIn = $fades[0];
+
+ $fades = $pl->getFadeInfo($pos-1);
+ $this->view->fadeOut = $fades[1];
+ $this->view->html = $this->view->render('playlist/set-fade.phtml');
}
public function deleteAction()
@@ -280,35 +298,21 @@ class PlaylistController extends Zend_Controller_Action
public function deleteActiveAction()
{
- $display = $this->_getParam('view');
-
$pl = $this->getPlaylist();
Playlist::Delete($pl->getId());
$pl_sess = $this->pl_sess;
unset($pl_sess->id);
- if($display === 'spl') {
- $this->view->html = $this->view->render('sideplaylist/index.phtml');
- return;
- }
-
- $this->_helper->redirector('index');
+ $this->view->html = $this->view->render('playlist/index.phtml');
}
public function closeAction()
{
- $display = $this->_getParam('view');
-
$pl = $this->getPlaylist();
$this->closePlaylist($pl);
- if($display === 'spl') {
- $this->view->html = $this->view->render('sideplaylist/index.phtml');
- return;
- }
-
- $this->_helper->redirector('index');
+ $this->view->html = $this->view->render('playlist/index.phtml');
}
}
diff --git a/application/controllers/ScheduleController.php b/application/controllers/ScheduleController.php
index fadbdb161..ab72626b0 100644
--- a/application/controllers/ScheduleController.php
+++ b/application/controllers/ScheduleController.php
@@ -2,6 +2,7 @@
class ScheduleController extends Zend_Controller_Action
{
+ protected $sched_sess = null;
public function init()
{
@@ -18,10 +19,14 @@ class ScheduleController extends Zend_Controller_Action
->addActionContext('resize-show', 'json')
->addActionContext('delete-show', 'json')
->addActionContext('schedule-show', 'json')
+ ->addActionContext('schedule-show-dialog', 'json')
->addActionContext('clear-show', 'json')
->addActionContext('get-current-playlist', 'json')
->addActionContext('find-playlists', 'html')
+ ->addActionContext('remove-group', 'json')
->initContext();
+
+ $this->sched_sess = new Zend_Session_Namespace("schedule");
}
public function indexAction()
@@ -126,7 +131,7 @@ class ScheduleController extends Zend_Controller_Action
public function deleteShowAction()
{
$showId = $this->_getParam('showId');
-
+
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$show = new Show(new User($userInfo->id, $userInfo->type));
@@ -139,14 +144,12 @@ class ScheduleController extends Zend_Controller_Action
}
public function scheduleShowAction()
- {
- $request = $this->getRequest();
-
- $start = $this->_getParam('start');
- $end = $this->_getParam('end');
- $showId = $this->_getParam('showId');
- $day = $this->_getParam('day');
+ {
+ $start_timestamp = $this->sched_sess->showStart;
+ $end_timestamp = $this->sched_sess->showEnd;
+ $showId = $this->sched_sess->showId;
$search = $this->_getParam('search', null);
+ $plId = $this->_getParam('plId');
if($search == "") {
$search = null;
@@ -157,23 +160,20 @@ class ScheduleController extends Zend_Controller_Action
$user = new User($userInfo->id, $userInfo->type);
$show = new Show($user, $showId);
- if($request->isPost()) {
+ $show->scheduleShow($start_timestamp, array($plId));
- $plId = $this->_getParam('plId');
+ $this->view->playlists = $show->searchPlaylistsForShow($start_timestamp, $search);
+ $this->view->showContent = $show->getShowContent($start_timestamp);
- $show->scheduleShow($start, array($plId));
- }
-
- $this->view->playlists = $show->searchPlaylistsForShow($day, $search);
- $this->view->showContent = $show->getShowContent($start);
+ $this->view->timeFilled = $show->getTimeScheduled($start_timestamp, $end_timestamp);
+ $this->view->showLength = $show->getShowLength($start_timestamp, $end_timestamp);
+ $this->view->percentFilled = Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp);
$this->view->choice = $this->view->render('schedule/find-playlists.phtml');
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
- $this->view->dialog = $this->view->render('schedule/schedule-show.phtml');
-
+
unset($this->view->showContent);
unset($this->view->playlists);
-
}
public function clearShowAction()
@@ -203,15 +203,73 @@ class ScheduleController extends Zend_Controller_Action
public function findPlaylistsAction()
{
- $search = $this->_getParam('search');
- $show_id = $this->_getParam('id');
- $dofw = $this->_getParam('day');
+ $search = $this->_getParam('search');
+ $show_id = $this->sched_sess->showId;
+ $start_timestamp = $this->sched_sess->showStart;
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$show = new Show(new User($userInfo->id, $userInfo->type), $show_id);
- $this->view->playlists = $show->searchPlaylistsForShow($dofw, $search);
-
+ $this->view->playlists = $show->searchPlaylistsForShow($start_timestamp, $search);
}
+
+ public function removeGroupAction()
+ {
+ $group_id = $this->_getParam('groupId');
+ $start_timestamp = $this->sched_sess->showStart;
+ $end_timestamp = $this->sched_sess->showEnd;
+ $show_id = $this->sched_sess->showId;
+ $search = $this->_getParam('search', null);
+
+ $userInfo = Zend_Auth::getInstance()->getStorage()->read();
+ $show = new Show(new User($userInfo->id, $userInfo->type), $show_id);
+
+ $show->removeGroupFromShow($start_timestamp, $group_id);
+
+ $this->view->playlists = $show->searchPlaylistsForShow($start_timestamp, $search);
+ $this->view->showContent = $show->getShowContent($start_timestamp);
+
+ $this->view->timeFilled = $show->getTimeScheduled($start_timestamp, $end_timestamp);
+ $this->view->showLength = $show->getShowLength($start_timestamp, $end_timestamp);
+ $this->view->percentFilled = Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp);
+
+ $this->view->choice = $this->view->render('schedule/find-playlists.phtml');
+ $this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
+
+ unset($this->view->showContent);
+ unset($this->view->playlists);
+ }
+
+ public function scheduleShowDialogAction()
+ {
+ $start_timestamp = $this->_getParam('start');
+ $end_timestamp = $this->_getParam('end');
+ $showId = $this->_getParam('showId');
+
+ $this->sched_sess->showId = $showId;
+ $this->sched_sess->showStart = $start_timestamp;
+ $this->sched_sess->showEnd = $end_timestamp;
+
+ $userInfo = Zend_Auth::getInstance()->getStorage()->read();
+
+ $user = new User($userInfo->id, $userInfo->type);
+ $show = new Show($user, $showId);
+
+ $this->view->playlists = $show->searchPlaylistsForShow($start_timestamp);
+ $this->view->showContent = $show->getShowContent($start_timestamp);
+
+ $this->view->timeFilled = $show->getTimeScheduled($start_timestamp, $end_timestamp);
+ $this->view->showLength = $show->getShowLength($start_timestamp, $end_timestamp);
+ $this->view->percentFilled = Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp);
+
+ $this->view->choice = $this->view->render('schedule/find-playlists.phtml');
+ $this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
+ $this->view->dialog = $this->view->render('schedule/schedule-show-dialog.phtml');
+
+ unset($this->view->showContent);
+ unset($this->view->playlists);
+ }
+
+
}
@@ -229,6 +287,10 @@ class ScheduleController extends Zend_Controller_Action
+
+
+
+
diff --git a/application/controllers/SearchController.php b/application/controllers/SearchController.php
index d31bbae12..7a8981d9f 100644
--- a/application/controllers/SearchController.php
+++ b/application/controllers/SearchController.php
@@ -51,7 +51,7 @@ class SearchController extends Zend_Controller_Action
$this->_helper->actionStack('contents', 'library');
$this->_helper->actionStack('display', 'search');
- $this->_helper->actionStack('index', 'sideplaylist');
+ $this->_helper->actionStack('index', 'playlist');
}
public function displayAction()
diff --git a/application/controllers/SideplaylistController.php b/application/controllers/SideplaylistController.php
deleted file mode 100644
index 6c9f31310..000000000
--- a/application/controllers/SideplaylistController.php
+++ /dev/null
@@ -1,40 +0,0 @@
-hasIdentity())
- {
- $this->_redirect('login/index');
- }
-
- $this->pl_sess = new Zend_Session_Namespace(UI_PLAYLIST_SESSNAME);
- }
-
- public function indexAction()
- {
- $this->view->headScript()->appendFile('/js/airtime/library/spl.js','text/javascript');
-
- $this->_helper->viewRenderer->setResponseSegment('spl');
-
- $pl_sess = $this->pl_sess;
-
- if(isset($pl_sess->id)) {
-
- $pl = Playlist::Recall($pl_sess->id);
- if($pl === FALSE) {
- unset($pl_sess->id);
- return;
- }
-
- $this->view->pl = $pl;
- }
- }
-}
-
-
-
diff --git a/application/forms/PlaylistMetadata.php b/application/forms/PlaylistMetadata.php
index fb15ee544..997620c45 100644
--- a/application/forms/PlaylistMetadata.php
+++ b/application/forms/PlaylistMetadata.php
@@ -5,9 +5,6 @@ class Application_Form_PlaylistMetadata extends Zend_Form
public function init()
{
- // Set the method for the display form to POST
- $this->setMethod('post');
-
// Add username element
$this->addElement('text', 'title', array(
'label' => 'Title:',
@@ -23,12 +20,6 @@ class Application_Form_PlaylistMetadata extends Zend_Form
'label' => 'Description:',
'required' => false,
));
-
- // Add the submit button
- $this->addElement('submit', 'submit', array(
- 'ignore' => true,
- 'label' => 'Submit',
- ));
}
diff --git a/application/layouts/scripts/library.phtml b/application/layouts/scripts/library.phtml
index 6d7a40698..c4c1295bb 100644
--- a/application/layouts/scripts/library.phtml
+++ b/application/layouts/scripts/library.phtml
@@ -12,9 +12,9 @@
navigation()->menu()->setRenderInvisible(true) ?>
layout()->quick_search ?>
-layout()->library ?>
+layout()->library ?>
-layout()->spl ?>
+layout()->spl ?>