delete active pl done for side playlist
This commit is contained in:
parent
461df7b61f
commit
b1a4cb5bd4
|
@ -19,6 +19,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
->addActionContext('set-cue', 'json')
|
||||
->addActionContext('move-item', 'json')
|
||||
->addActionContext('close', 'json')
|
||||
->addActionContext('delete-active', 'json')
|
||||
->initContext();
|
||||
|
||||
$this->pl_sess = new Zend_Session_Namespace(UI_PLAYLIST_SESSNAME);
|
||||
|
@ -225,12 +226,20 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
public function deleteActiveAction()
|
||||
{
|
||||
$pl = $this->getPlaylist();
|
||||
$this->closePlaylist($pl);
|
||||
|
||||
Playlist::Delete($pl_sess->id);
|
||||
$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');
|
||||
}
|
||||
|
||||
public function closeAction()
|
||||
|
|
|
@ -68,16 +68,26 @@ function moveSPLItem(event, ui) {
|
|||
$.post(url, setSPLContent);
|
||||
}
|
||||
|
||||
function noOpenPL(json) {
|
||||
$("#side_playlist")
|
||||
.empty()
|
||||
.append(json.html);
|
||||
}
|
||||
|
||||
function closeSPL() {
|
||||
var url;
|
||||
|
||||
url = '/Playlist/close/format/json/view/spl';
|
||||
|
||||
$.post(url, function(json){
|
||||
$("#side_playlist")
|
||||
.empty()
|
||||
.append(json.html);
|
||||
});
|
||||
$.post(url, noOpenPL);
|
||||
}
|
||||
|
||||
function deleteSPL() {
|
||||
var url;
|
||||
|
||||
url = '/Playlist/delete-active/format/json/view/spl';
|
||||
|
||||
$.post(url, noOpenPL);
|
||||
}
|
||||
|
||||
function setUpSPL() {
|
||||
|
@ -86,6 +96,7 @@ function setUpSPL() {
|
|||
$("#spl_sortable" ).bind( "sortstop", moveSPLItem);
|
||||
$("#spl_remove_selected").click(deleteSPLItem);
|
||||
$("#spl_close").click(closeSPL);
|
||||
$("#spl_delete").click(deleteSPL);
|
||||
|
||||
$("#spl_sortable").droppable();
|
||||
$("#spl_sortable" ).bind( "drop", addSPLItem);
|
||||
|
|
Loading…
Reference in New Issue