diff --git a/.zfproject.xml b/.zfproject.xml index 432033fc5..9c7094a03 100644 --- a/.zfproject.xml +++ b/.zfproject.xml @@ -76,10 +76,6 @@ - - - - @@ -220,15 +216,6 @@ - - - - - - - - - @@ -292,8 +279,6 @@ - - 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..f333e4b49 100644 --- a/application/controllers/LibraryController.php +++ b/application/controllers/LibraryController.php @@ -32,6 +32,7 @@ class LibraryController extends Zend_Controller_Action $this->view->headScript()->appendFile('/js/airtime/onready/library.js','text/javascript'); $this->view->headScript()->appendFile('/js/contextmenu/jjmenu.js','text/javascript'); $this->view->headLink()->appendStylesheet('/css/contextmenu.css'); + $this->view->headLink()->appendStylesheet('/css/media_library.css'); $this->_helper->layout->setLayout('library'); @@ -40,7 +41,7 @@ class LibraryController extends Zend_Controller_Action $this->_helper->actionStack('contents', 'library'); $this->_helper->actionStack('quick-search', 'library'); - $this->_helper->actionStack('index', 'sideplaylist'); + $this->_helper->actionStack('index', 'playlist'); } public function contextMenuAction() diff --git a/application/controllers/PlaylistController.php b/application/controllers/PlaylistController.php index bd1790e03..0230bb5f0 100644 --- a/application/controllers/PlaylistController.php +++ b/application/controllers/PlaylistController.php @@ -80,7 +80,19 @@ 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; + + if(isset($pl_sess->id)) { + + $pl = $this->getPlaylist(); + + $this->view->pl = $pl; + } } public function newAction() @@ -139,7 +151,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 +159,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 +177,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 +191,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 +207,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 +222,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(); @@ -280,35 +275,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/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/views/scripts/playlist/index.phtml b/application/views/scripts/playlist/index.phtml index 755bd12d0..d37aff9dc 100644 --- a/application/views/scripts/playlist/index.phtml +++ b/application/views/scripts/playlist/index.phtml @@ -1,19 +1,22 @@ - +New +pl)) : ?> +Delete +Close + - +pl)) : ?> -pl->getName(); ?> +
pl->getLength(); ?>
-echo $this->form; +
    + pl->getContents())) : ?> + partialLoop('sideplaylist/sidebarcontent.phtml', $this->pl->getContents()); ?> + +
  • Empty playlist
  • + +
+ + +
No open playlist
+ diff --git a/application/views/scripts/playlist/sidebarcontent.phtml b/application/views/scripts/playlist/sidebarcontent.phtml new file mode 100644 index 000000000..5f4a9a0ad --- /dev/null +++ b/application/views/scripts/playlist/sidebarcontent.phtml @@ -0,0 +1,6 @@ +
  • + CcFiles['track_title'] ?> + cliplength ?> + + CcFiles['artist_name'] ?> +
  • diff --git a/application/views/scripts/playlist/update.phtml b/application/views/scripts/playlist/update.phtml index 3643c73ab..46231963f 100644 --- a/application/views/scripts/playlist/update.phtml +++ b/application/views/scripts/playlist/update.phtml @@ -1,8 +1,7 @@ -pl->getContents())) { - echo $this->partialLoop('playlist/playlistEditorTable.phtml', $this->pl->getContents()); - } - else { - echo '
    Empty playlist
    '; - } -?> +pl->getContents())) { + echo $this->partialLoop('sideplaylist/sidebarcontent.phtml', $this->pl->getContents()); +} +else { + echo '
  • Empty playlist
  • '; +} diff --git a/application/views/scripts/sideplaylist/index.phtml b/application/views/scripts/sideplaylist/index.phtml deleted file mode 100644 index e0e5528f8..000000000 --- a/application/views/scripts/sideplaylist/index.phtml +++ /dev/null @@ -1,46 +0,0 @@ -
    -
    - - New - - pl)) { echo 'Delete';} ?> - pl)) { echo 'Close';} ?> -
    -
    pl)) { echo $this->pl->getName(); } ?>
    -
    pl)) { echo $this->pl->getLength(); } ?>
    -
    - pl)) { - - echo '
    '; - echo ''; - echo 'Title'; - echo 'Creator'; - echo 'Playlength'; - echo '
    '; - - echo '
      '; - - if (count($this->pl->getContents())) { - echo $this->partialLoop('sideplaylist/sidebarcontent.phtml', $this->pl->getContents()); - } - else { - echo '
    • Empty playlist
    • '; - } - - echo '
    '; - } - else { - echo '
    No open playlist
    '; - } - ?> - - diff --git a/application/views/scripts/sideplaylist/sidebarcontent.phtml b/application/views/scripts/sideplaylist/sidebarcontent.phtml deleted file mode 100644 index b9c57eac4..000000000 --- a/application/views/scripts/sideplaylist/sidebarcontent.phtml +++ /dev/null @@ -1,14 +0,0 @@ -
  • - - - - - CcFiles['track_title'] ?> - - - CcFiles['artist_name'] ?> - - - cliplength ?> - -
  • diff --git a/application/views/scripts/sideplaylist/update.phtml b/application/views/scripts/sideplaylist/update.phtml deleted file mode 100644 index 46231963f..000000000 --- a/application/views/scripts/sideplaylist/update.phtml +++ /dev/null @@ -1,7 +0,0 @@ -pl->getContents())) { - echo $this->partialLoop('sideplaylist/sidebarcontent.phtml', $this->pl->getContents()); -} -else { - echo '
  • Empty playlist
  • '; -} diff --git a/public/css/media_library.css b/public/css/media_library.css new file mode 100644 index 000000000..e69de29bb diff --git a/public/css/playlist_builder.css b/public/css/playlist_builder.css new file mode 100644 index 000000000..dc47ccfec --- /dev/null +++ b/public/css/playlist_builder.css @@ -0,0 +1,8 @@ +#side_playlist div, #side_playlist span, #side_playlist ul, #side_playlist li { + float: left; +} + +#spl_sortable, #spl_sortable > li, .spl_artist, #side_playlist > div{ + clear: left; +} + diff --git a/public/js/airtime/library/spl.js b/public/js/airtime/library/spl.js index e307afc63..b828e1fd6 100644 --- a/public/js/airtime/library/spl.js +++ b/public/js/airtime/library/spl.js @@ -9,14 +9,14 @@ function setSPLContent(json) { return; } - $('input[name="all"]').attr("checked", false); - $('#spl_name').empty() .append(json.name); $('#spl_length').empty() .append(json.length); $('#spl_sortable').empty() .append(json.html); + + $(".ui-icon-close").click(deleteSPLItem); } function addSPLItem(event, ui){ @@ -37,16 +37,12 @@ function addSPLItem(event, ui){ } function deleteSPLItem(){ - var url, pos; - url = '/Playlist/delete-item/format/json/view/spl'; + pos = $(this).parent().attr("id").split("_").pop(); - pos = $('form[name="SPL"]').find(':checked').not('input[name="all"]').map(function() { - return "/pos/" + $(this).attr('name'); - }).get().join(""); - - url = url + pos; + url = '/Playlist/delete-item/format/json'; + url = url + '/pos/' + pos; $.post(url, setSPLContent); } @@ -61,7 +57,6 @@ function moveSPLItem(event, ui) { url = '/Playlist/move-item' url = url + '/format/json'; - url = url + '/view/spl'; url = url + '/oldPos/' + oldPos; url = url + '/newPos/' + newPos; @@ -77,15 +72,19 @@ function noOpenPL(json) { function closeSPL() { var url; - url = '/Playlist/close/format/json/view/spl'; + url = '/Playlist/close/format/json'; $.post(url, noOpenPL); } +function newSPL() { + +} + function deleteSPL() { var url; - url = '/Playlist/delete-active/format/json/view/spl'; + url = '/Playlist/delete-active/format/json'; $.post(url, noOpenPL); } @@ -106,12 +105,10 @@ function setUpSPL() { $("#spl_remove_selected").click(deleteSPLItem); $("#spl_close").click(closeSPL); $("#spl_delete").click(deleteSPL); + $(".ui-icon-close").click(deleteSPLItem); $("#spl_sortable").droppable(); $("#spl_sortable" ).bind( "drop", addSPLItem); - $('input[name="all"]').click(function(){ - $('form[name="SPL"]').find('input').attr("checked", $(this).attr("checked")); - }); }