CC-3174 : showbuilder

including context menu to delete items from timeline.
This commit is contained in:
Naomi Aro 2012-03-15 16:11:29 +01:00
parent 2beadc9301
commit 7a8398bd32
4 changed files with 81 additions and 3 deletions

View file

@ -73,8 +73,6 @@ class LibraryController extends Zend_Controller_Action
public function contextMenuAction()
{
global $CC_CONFIG;
$id = $this->_getParam('id');
$type = $this->_getParam('type');
//playlist||timeline

View file

@ -12,6 +12,7 @@ class ShowbuilderController extends Zend_Controller_Action
->addActionContext('builder-dialog', 'json')
->addActionContext('check-builder-feed', 'json')
->addActionContext('builder-feed', 'json')
->addActionContext('context-menu', 'json')
->initContext();
}
@ -94,6 +95,28 @@ class ShowbuilderController extends Zend_Controller_Action
$this->_helper->actionStack('library', 'library');
$this->_helper->actionStack('builder', 'showbuilder');
}
public function contextMenuAction()
{
$id = $this->_getParam('id');
$now = time();
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$menu = array();
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id);
$item = CcScheduleQuery::create()->findPK($id);
$instance = $item->getCcShowInstances();
if ($now < intval($item->getDbStarts("U")) && $user->canSchedule($instance->getDbShowId())) {
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/showbuilder/schedule-remove");
}
$this->view->items = $menu;
}
public function builderAction() {