Пример #1
0
 /**
  * Add a media file as the last item in the show.
  *
  * @param int $file_id
  */
 public function addFileToShow($file_id, $checkUserPerm = true)
 {
     $ts = intval($this->_showInstance->getDbLastScheduled("U")) ?: 0;
     $id = $this->_showInstance->getDbId();
     $scheduler = new Application_Model_Scheduler();
     $scheduler->setCheckUserPermissions($checkUserPerm);
     $scheduler->scheduleAfter(array(array("id" => 0, "instance" => $id, "timestamp" => $ts)), array(array("id" => $file_id, "type" => "audioclip")));
 }
Пример #2
0
 public function scheduleAddAction()
 {
     $request = $this->getRequest();
     $mediaItems = $request->getParam("mediaIds", array());
     $scheduledItems = $request->getParam("schedIds", array());
     try {
         $scheduler = new Application_Model_Scheduler();
         $scheduler->scheduleAfter($scheduledItems, $mediaItems);
     } catch (OutDatedScheduleException $e) {
         $this->view->error = $e->getMessage();
         Logging::info($e->getMessage());
     } catch (Exception $e) {
         $this->view->error = $e->getMessage();
         Logging::info($e->getMessage());
     }
 }