changing to context menu single edit/delete.

This commit is contained in:
Naomi Aro 2013-08-19 23:19:13 -04:00
parent 9b45b9dc72
commit 09693ef174
11 changed files with 609 additions and 311 deletions

View file

@ -53,7 +53,7 @@ class LibraryController extends Zend_Controller_Action
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/spl.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playlist/smart_blockbuilder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/observer/observer.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/config.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/curves.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
@ -68,9 +68,9 @@ class LibraryController extends Zend_Controller_Action
//arbitrary attributes need to be allowed to set an id for the templates.
$this->view->headScript()->setAllowArbitraryAttributes(true);
//$this->view->headScript()->appendScript(file_get_contents(APPLICATION_PATH.'/../public/js/waveformplaylist/templates/bottombar.tpl'),
//$this->view->headScript()->appendScript(file_get_contents(APPLICATION_PATH.'/../public/js/waveformplaylist/templates/bottombar.tpl'),
// 'text/template', array('id' => 'tpl_playlist_cues', 'noescape' => true));
$this->view->headLink()->appendStylesheet($baseUrl.'css/playlist_builder.css?'.$CC_CONFIG['airtime_version']);
try {
@ -179,9 +179,7 @@ class LibraryController extends Zend_Controller_Action
$type = $this->_getParam('type');
//playlist||timeline
$screen = $this->_getParam('screen');
$baseUrl = Application_Common_OsPath::getBaseDir();
$menu = array();
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
@ -250,7 +248,7 @@ class LibraryController extends Zend_Controller_Action
} elseif ($type == "stream") {
$webstream = CcWebstreamQuery::create()->findPK($id);
$obj = new Application_Model_Webstream($webstream);
$menu["play"]["mime"] = $webstream->getDbMime();
if (isset($obj_sess->id) && $screen == "playlist") {
@ -373,15 +371,15 @@ class LibraryController extends Zend_Controller_Action
$this->view->message = $message;
}
}
// duplicate playlist
public function duplicateAction(){
$params = $this->getRequest()->getParams();
$id = $params['id'];
$originalPl = new Application_Model_Playlist($id);
$newPl = new Application_Model_Playlist();
$contents = $originalPl->getContents();
foreach ($contents as &$c) {
if ($c['type'] == '0') {
@ -393,15 +391,15 @@ class LibraryController extends Zend_Controller_Action
}
$c[0] = $c['item_id'];
}
$newPl->addAudioClips($contents, null, 'before');
$newPl->setCreator(Application_Model_User::getCurrentUser()->getId());
$newPl->setDescription($originalPl->getDescription());
list($plFadeIn, ) = $originalPl->getFadeInfo(0);
list(, $plFadeOut) = $originalPl->getFadeInfo($originalPl->getSize()-1);
$newPl->setfades($plFadeIn, $plFadeOut);
$newPl->setName(sprintf(_("Copy of %s"), $originalPl->getName()));
}
@ -549,7 +547,7 @@ class LibraryController extends Zend_Controller_Action
$id = $this->_getParam('id');
Application_Model_Soundcloud::uploadSoundcloud($id);
// we should die with ui info
$this->_helper->json->sendJson(null);
$this->_helper->json->sendJson(null);
}
public function getUploadToSoundcloudStatusAction()

View file

@ -8,6 +8,7 @@ class PlayouthistoryController extends Zend_Controller_Action
$ajaxContext
->addActionContext('file-history-feed', 'json')
->addActionContext('item-history-feed', 'json')
->addActionContext('context-menu', 'json')
->addActionContext('edit-file-item', 'json')
->addActionContext('create-list-item', 'json')
->addActionContext('edit-list-item', 'json')
@ -67,7 +68,9 @@ class PlayouthistoryController extends Zend_Controller_Action
$this->view->headLink()->appendStylesheet($baseUrl.'js/datatables/plugin/TableTools-2.1.5/css/TableTools.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/playouthistory.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/history_styles.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery-ui-timepicker-addon.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']);
//set datatables columns for display of data.
@ -80,6 +83,28 @@ class PlayouthistoryController extends Zend_Controller_Action
$this->view->headScript()->appendScript($script);
}
public function contextMenuAction()
{
$baseUrl = Application_Common_OsPath::getBaseDir();
$id = $this->_getParam('id');
$menu = array();
$menu["edit"] = array(
"name"=> _("Edit"),
"icon" => "edit",
"url" => $baseUrl."playouthistory/edit-list-item/id/{$id}"
);
$menu["del"] = array(
"name"=> _("Delete"),
"icon" => "delete",
"url" => $baseUrl."playouthistory/delete-list-item/id/{$id}"
);
$this->view->items = $menu;
}
public function fileHistoryFeedAction()
{
try {
@ -228,6 +253,7 @@ class PlayouthistoryController extends Zend_Controller_Action
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playouthistory/template.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'css/history_styles.css?'.$CC_CONFIG['airtime_version']);
$historyService = new Application_Service_HistoryService();
$this->view->template_list = $historyService->getListItemTemplates();
@ -241,6 +267,7 @@ class PlayouthistoryController extends Zend_Controller_Action
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playouthistory/configuretemplate.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'css/history_styles.css?'.$CC_CONFIG['airtime_version']);
try {