CC-4109: Playlist Builder: Add a button to remove all the items in the current editing playlist

This commit is contained in:
denise 2013-01-23 12:09:21 -05:00
parent d4e89df94e
commit 384298f680
7 changed files with 42 additions and 2 deletions

View file

@ -26,6 +26,7 @@ class PlaylistController extends Zend_Controller_Action
->addActionContext('smart-block-shuffle', 'json')
->addActionContext('get-block-info', 'json')
->addActionContext('shuffle', 'json')
->addActionContext('empty-content', 'json')
->initContext();
}
@ -336,6 +337,26 @@ class PlaylistController extends Zend_Controller_Action
$this->playlistUnknownError($e);
}
}
public function emptyContentAction()
{
$type = $this->_getParam('obj_type');
try {
$obj = $this->getPlaylist($type);
if ($type == 'playlist') {
$obj->deleteAllFilesFromPlaylist();
} else {
$obj->deleteAllFilesFromBlock();
}
$this->createUpdateResponse($obj);
} catch (PlaylistOutDatedException $e) {
$this->playlistOutdated($e);
} catch (PlaylistNotFoundException $e) {
$this->playlistNotFound($type);
} catch (Exception $e) {
$this->playlistUnknownError($e);
}
}
public function setCueAction()
{