CC-4090: Make code style PSR compliant
-removed all trailing whitespace
This commit is contained in:
parent
ee3447f903
commit
d9cde230cd
|
@ -74,7 +74,7 @@ class ApiController extends Zend_Controller_Action
|
|||
* This is only being used by schedule.js at the moment.
|
||||
*/
|
||||
public function calendarInitAction(){
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
if(is_null(Zend_Auth::getInstance()->getStorage()->read())) {
|
||||
|
@ -83,12 +83,12 @@ class ApiController extends Zend_Controller_Action
|
|||
return;
|
||||
}
|
||||
|
||||
$this->view->calendarInit = array(
|
||||
"timestamp" => time(),
|
||||
"timezoneOffset" => date("Z"),
|
||||
"timeScale" => Application_Model_Preference::GetCalendarTimeScale(),
|
||||
"timeInterval" => Application_Model_Preference::GetCalendarTimeInterval(),
|
||||
"weekStartDay" => Application_Model_Preference::GetWeekStartDay()
|
||||
$this->view->calendarInit = array(
|
||||
"timestamp" => time(),
|
||||
"timezoneOffset" => date("Z"),
|
||||
"timeScale" => Application_Model_Preference::GetCalendarTimeScale(),
|
||||
"timeInterval" => Application_Model_Preference::GetCalendarTimeInterval(),
|
||||
"weekStartDay" => Application_Model_Preference::GetWeekStartDay()
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -331,7 +331,7 @@ class ApiController extends Zend_Controller_Action
|
|||
|
||||
$result[$dow[$i]] = $shows;
|
||||
}
|
||||
$result['AIRTIME_API_VERSION'] = AIRTIME_API_VERSION; //used by caller to determine if the airtime they are running or widgets in use is out of date.
|
||||
$result['AIRTIME_API_VERSION'] = AIRTIME_API_VERSION; //used by caller to determine if the airtime they are running or widgets in use is out of date.
|
||||
header("Content-type: text/javascript");
|
||||
echo $_GET['callback'].'('.json_encode($result).')';
|
||||
} else {
|
||||
|
@ -466,8 +466,8 @@ class ApiController extends Zend_Controller_Action
|
|||
$this->view->showinstanceid = $show_instance_id;
|
||||
|
||||
|
||||
$showCanceled = false;
|
||||
$file = Application_Model_StoredFile::Recall($file_id);
|
||||
$showCanceled = false;
|
||||
$file = Application_Model_StoredFile::Recall($file_id);
|
||||
//$show_instance = $this->_getParam('show_instance');
|
||||
|
||||
$show_name = null;
|
||||
|
@ -508,7 +508,7 @@ class ApiController extends Zend_Controller_Action
|
|||
$tmpTitle = $file->getName();
|
||||
}
|
||||
|
||||
//$file->setMetadataValue('MDATA_KEY_TITLE', $tmpTitle);
|
||||
//$file->setMetadataValue('MDATA_KEY_TITLE', $tmpTitle);
|
||||
$file->setMetadataValue('MDATA_KEY_CREATOR', "Airtime Show Recorder");
|
||||
$file->setMetadataValue('MDATA_KEY_TRACKNUMBER', $show_instance_id);
|
||||
|
||||
|
|
|
@ -155,14 +155,14 @@ class PlaylistController extends Zend_Controller_Action
|
|||
public function newAction()
|
||||
{
|
||||
$pl_sess = $this->pl_sess;
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
|
||||
$pl = new Application_Model_Playlist();
|
||||
$pl->setName("Untitled Playlist");
|
||||
$pl->setPLMetaData('dc:creator', $userInfo->id);
|
||||
$pl->setPLMetaData('dc:creator', $userInfo->id);
|
||||
|
||||
$this->changePlaylist($pl->getId());
|
||||
$this->createFullResponse($pl);
|
||||
$this->changePlaylist($pl->getId());
|
||||
$this->createFullResponse($pl);
|
||||
}
|
||||
|
||||
public function editAction()
|
||||
|
@ -170,20 +170,20 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$id = $this->_getParam('id', null);
|
||||
Logging::log("editing playlist {$id}");
|
||||
|
||||
if (!is_null($id)) {
|
||||
$this->changePlaylist($id);
|
||||
}
|
||||
if (!is_null($id)) {
|
||||
$this->changePlaylist($id);
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
$pl = new Application_Model_Playlist($id);
|
||||
$this->createFullResponse($pl);
|
||||
}
|
||||
catch (PlaylistNotFoundException $e) {
|
||||
$this->playlistNotFound();
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$this->playlistUnknownError($e);
|
||||
}
|
||||
}
|
||||
catch (PlaylistNotFoundException $e) {
|
||||
$this->playlistNotFound();
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$this->playlistUnknownError($e);
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteAction()
|
||||
|
@ -219,8 +219,8 @@ class PlaylistController extends Zend_Controller_Action
|
|||
{
|
||||
$ids = $this->_getParam('ids', array());
|
||||
$ids = (!is_array($ids)) ? array($ids) : $ids;
|
||||
$afterItem = $this->_getParam('afterItem', null);
|
||||
$addType = $this->_getParam('type', 'after');
|
||||
$afterItem = $this->_getParam('afterItem', null);
|
||||
$addType = $this->_getParam('type', 'after');
|
||||
|
||||
try {
|
||||
$pl = $this->getPlaylist();
|
||||
|
@ -285,9 +285,9 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
public function setCueAction()
|
||||
{
|
||||
$id = $this->_getParam('id');
|
||||
$cueIn = $this->_getParam('cueIn', null);
|
||||
$cueOut = $this->_getParam('cueOut', null);
|
||||
$id = $this->_getParam('id');
|
||||
$cueIn = $this->_getParam('cueIn', null);
|
||||
$cueOut = $this->_getParam('cueOut', null);
|
||||
|
||||
try {
|
||||
$pl = $this->getPlaylist();
|
||||
|
@ -314,9 +314,9 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
public function setFadeAction()
|
||||
{
|
||||
$id = $this->_getParam('id');
|
||||
$fadeIn = $this->_getParam('fadeIn', null);
|
||||
$fadeOut = $this->_getParam('fadeOut', null);
|
||||
$id = $this->_getParam('id');
|
||||
$fadeIn = $this->_getParam('fadeIn', null);
|
||||
$fadeOut = $this->_getParam('fadeOut', null);
|
||||
|
||||
try {
|
||||
$pl = $this->getPlaylist();
|
||||
|
@ -369,8 +369,8 @@ class PlaylistController extends Zend_Controller_Action
|
|||
**/
|
||||
public function setPlaylistFadesAction()
|
||||
{
|
||||
$fadeIn = $this->_getParam('fadeIn', null);
|
||||
$fadeOut = $this->_getParam('fadeOut', null);
|
||||
$fadeIn = $this->_getParam('fadeIn', null);
|
||||
$fadeOut = $this->_getParam('fadeOut', null);
|
||||
|
||||
try {
|
||||
$pl = $this->getPlaylist();
|
||||
|
|
|
@ -2,19 +2,19 @@
|
|||
|
||||
class PlayoutHistoryController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext
|
||||
->addActionContext('playout-history-feed', 'json')
|
||||
->initContext();
|
||||
}
|
||||
public function init()
|
||||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext
|
||||
->addActionContext('playout-history-feed', 'json')
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
public function indexAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
$request = $this->getRequest();
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
|
||||
//default time is the last 24 hours.
|
||||
|
@ -37,48 +37,48 @@ class PlayoutHistoryController extends Zend_Controller_Action
|
|||
|
||||
$this->view->date_form = $form;
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.pluginAPI.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.fnSetFilteringDelay.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/TableTools/js/ZeroClipboard.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/TableTools/js/TableTools.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.pluginAPI.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.fnSetFilteringDelay.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/TableTools/js/ZeroClipboard.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/TableTools/js/TableTools.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
||||
$offset = date("Z") * -1;
|
||||
$this->view->headScript()->appendScript("var serverTimezoneOffset = {$offset}; //in seconds");
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/utilities/utilities.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/playouthistory/historytable.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$offset = date("Z") * -1;
|
||||
$this->view->headScript()->appendScript("var serverTimezoneOffset = {$offset}; //in seconds");
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/utilities/utilities.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/playouthistory/historytable.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'/js/datatables/plugin/TableTools/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.'/js/datatables/plugin/TableTools/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']);
|
||||
}
|
||||
|
||||
public function playoutHistoryFeedAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$current_time = time();
|
||||
public function playoutHistoryFeedAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$current_time = time();
|
||||
|
||||
$params = $request->getParams();
|
||||
$params = $request->getParams();
|
||||
|
||||
$starts_epoch = $request->getParam("start", $current_time - (60*60*24));
|
||||
$ends_epoch = $request->getParam("end", $current_time);
|
||||
$starts_epoch = $request->getParam("start", $current_time - (60*60*24));
|
||||
$ends_epoch = $request->getParam("end", $current_time);
|
||||
|
||||
$startsDT = DateTime::createFromFormat("U", $starts_epoch, new DateTimeZone("UTC"));
|
||||
$endsDT = DateTime::createFromFormat("U", $ends_epoch, new DateTimeZone("UTC"));
|
||||
$startsDT = DateTime::createFromFormat("U", $starts_epoch, new DateTimeZone("UTC"));
|
||||
$endsDT = DateTime::createFromFormat("U", $ends_epoch, new DateTimeZone("UTC"));
|
||||
|
||||
Logging::log("history starts {$startsDT->format("Y-m-d H:i:s")}");
|
||||
Logging::log("history ends {$endsDT->format("Y-m-d H:i:s")}");
|
||||
Logging::log("history starts {$startsDT->format("Y-m-d H:i:s")}");
|
||||
Logging::log("history ends {$endsDT->format("Y-m-d H:i:s")}");
|
||||
|
||||
$history = new Application_Model_PlayoutHistory($startsDT, $endsDT, $params);
|
||||
$history = new Application_Model_PlayoutHistory($startsDT, $endsDT, $params);
|
||||
|
||||
$r = $history->getItems();
|
||||
$r = $history->getItems();
|
||||
|
||||
$this->view->sEcho = $r["sEcho"];
|
||||
$this->view->iTotalDisplayRecords = $r["iTotalDisplayRecords"];
|
||||
$this->view->iTotalRecords = $r["iTotalRecords"];
|
||||
$this->view->history = $r["history"];
|
||||
}
|
||||
$this->view->sEcho = $r["sEcho"];
|
||||
$this->view->iTotalDisplayRecords = $r["iTotalDisplayRecords"];
|
||||
$this->view->iTotalRecords = $r["iTotalRecords"];
|
||||
$this->view->history = $r["history"];
|
||||
}
|
||||
}
|
|
@ -10,16 +10,16 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('event-feed', 'json')
|
||||
->addActionContext('make-context-menu', 'json')
|
||||
->addActionContext('add-show-dialog', 'json')
|
||||
->addActionContext('add-show', 'json')
|
||||
->addActionContext('edit-show', 'json')
|
||||
->addActionContext('move-show', 'json')
|
||||
->addActionContext('resize-show', 'json')
|
||||
->addActionContext('delete-show', 'json')
|
||||
->addActionContext('add-show-dialog', 'json')
|
||||
->addActionContext('add-show', 'json')
|
||||
->addActionContext('edit-show', 'json')
|
||||
->addActionContext('move-show', 'json')
|
||||
->addActionContext('resize-show', 'json')
|
||||
->addActionContext('delete-show', 'json')
|
||||
->addActionContext('show-content-dialog', 'json')
|
||||
->addActionContext('clear-show', 'json')
|
||||
->addActionContext('clear-show', 'json')
|
||||
->addActionContext('get-current-playlist', 'json')
|
||||
->addActionContext('remove-group', 'json')
|
||||
->addActionContext('remove-group', 'json')
|
||||
->addActionContext('populate-show-form', 'json')
|
||||
->addActionContext('populate-show-instance-form', 'json')
|
||||
->addActionContext('cancel-show', 'json')
|
||||
|
@ -35,7 +35,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
->addActionContext('get-current-show', 'json')
|
||||
->initContext();
|
||||
|
||||
$this->sched_sess = new Zend_Session_Namespace("schedule");
|
||||
$this->sched_sess = new Zend_Session_Namespace("schedule");
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
|
@ -106,7 +106,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$end = new DateTime($this->_getParam('end', null));
|
||||
$end->setTimezone(new DateTimeZone("UTC"));
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$user = new Application_Model_User($userInfo->id);
|
||||
if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
|
||||
$editable = true;
|
||||
|
@ -115,7 +115,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$editable = false;
|
||||
}
|
||||
|
||||
$this->view->events = Application_Model_Show::getFullCalendarEvents($start, $end, $editable);
|
||||
$this->view->events = Application_Model_Show::getFullCalendarEvents($start, $end, $editable);
|
||||
}
|
||||
|
||||
public function getCurrentShowAction() {
|
||||
|
@ -155,8 +155,8 @@ class ScheduleController extends Zend_Controller_Action
|
|||
public function resizeShowAction()
|
||||
{
|
||||
$deltaDay = $this->_getParam('day');
|
||||
$deltaMin = $this->_getParam('min');
|
||||
$showId = $this->_getParam('showId');
|
||||
$deltaMin = $this->_getParam('min');
|
||||
$showId = $this->_getParam('showId');
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$user = new Application_Model_User($userInfo->id);
|
||||
|
@ -168,34 +168,34 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$this->view->show_error = true;
|
||||
return false;
|
||||
}
|
||||
$error = $show->resizeShow($deltaDay, $deltaMin);
|
||||
$error = $show->resizeShow($deltaDay, $deltaMin);
|
||||
}
|
||||
|
||||
if (isset($error)) {
|
||||
$this->view->error = $error;
|
||||
}
|
||||
if (isset($error)) {
|
||||
$this->view->error = $error;
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteShowAction()
|
||||
{
|
||||
$showInstanceId = $this->_getParam('id');
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$user = new Application_Model_User($userInfo->id);
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$user = new Application_Model_User($userInfo->id);
|
||||
|
||||
if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
|
||||
|
||||
try {
|
||||
$showInstance = new Application_Model_ShowInstance($showInstanceId);
|
||||
$showInstance = new Application_Model_ShowInstance($showInstanceId);
|
||||
}
|
||||
catch(Exception $e){
|
||||
$this->view->show_error = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
$showInstance->delete();
|
||||
$showInstance->delete();
|
||||
|
||||
$this->view->show_id = $showInstance->getShowId();
|
||||
$this->view->show_id = $showInstance->getShowId();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -387,9 +387,9 @@ class ScheduleController extends Zend_Controller_Action
|
|||
{
|
||||
$showInstanceId = $this->sched_sess->showInstanceId;
|
||||
$group_id = $this->_getParam('groupId');
|
||||
$search = $this->_getParam('search', null);
|
||||
$search = $this->_getParam('search', null);
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$user = new Application_Model_User($userInfo->id);
|
||||
try{
|
||||
$show = new Application_Model_ShowInstance($showInstanceId);
|
||||
|
@ -399,14 +399,14 @@ class ScheduleController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
if($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER, UTYPE_HOST),$show->getShowId())) {
|
||||
$show->removeGroupFromShow($group_id);
|
||||
$show->removeGroupFromShow($group_id);
|
||||
}
|
||||
|
||||
$this->view->showContent = $show->getShowContent();
|
||||
$this->view->timeFilled = $show->getTimeScheduled();
|
||||
$this->view->percentFilled = $show->getPercentScheduled();
|
||||
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
|
||||
unset($this->view->showContent);
|
||||
$this->view->showContent = $show->getShowContent();
|
||||
$this->view->timeFilled = $show->getTimeScheduled();
|
||||
$this->view->percentFilled = $show->getPercentScheduled();
|
||||
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
|
||||
unset($this->view->showContent);
|
||||
}
|
||||
|
||||
public function showContentDialogAction()
|
||||
|
@ -451,24 +451,24 @@ class ScheduleController extends Zend_Controller_Action
|
|||
// this feature is disabled in 2.1 and should be back in 2.2
|
||||
/*public function populateShowInstanceFormAction(){
|
||||
$formWhat = new Application_Form_AddShowWhat();
|
||||
$formWho = new Application_Form_AddShowWho();
|
||||
$formWhen = new Application_Form_AddShowWhen();
|
||||
$formRepeats = new Application_Form_AddShowRepeats();
|
||||
$formStyle = new Application_Form_AddShowStyle();
|
||||
$formLive = new Application_Form_AddShowLiveStream();
|
||||
$formWho = new Application_Form_AddShowWho();
|
||||
$formWhen = new Application_Form_AddShowWhen();
|
||||
$formRepeats = new Application_Form_AddShowRepeats();
|
||||
$formStyle = new Application_Form_AddShowStyle();
|
||||
$formLive = new Application_Form_AddShowLiveStream();
|
||||
|
||||
$formWhat->removeDecorator('DtDdWrapper');
|
||||
$formWho->removeDecorator('DtDdWrapper');
|
||||
$formWhen->removeDecorator('DtDdWrapper');
|
||||
$formRepeats->removeDecorator('DtDdWrapper');
|
||||
$formStyle->removeDecorator('DtDdWrapper');
|
||||
$formWhat->removeDecorator('DtDdWrapper');
|
||||
$formWho->removeDecorator('DtDdWrapper');
|
||||
$formWhen->removeDecorator('DtDdWrapper');
|
||||
$formRepeats->removeDecorator('DtDdWrapper');
|
||||
$formStyle->removeDecorator('DtDdWrapper');
|
||||
|
||||
$this->view->what = $formWhat;
|
||||
$this->view->when = $formWhen;
|
||||
$this->view->repeats = $formRepeats;
|
||||
$this->view->who = $formWho;
|
||||
$this->view->style = $formStyle;
|
||||
$this->view->live = $formLive;
|
||||
$this->view->when = $formWhen;
|
||||
$this->view->repeats = $formRepeats;
|
||||
$this->view->who = $formWho;
|
||||
$this->view->style = $formStyle;
|
||||
$this->view->live = $formLive;
|
||||
$this->view->addNewShow = false;
|
||||
|
||||
$showInstanceId = $this->_getParam('id');
|
||||
|
@ -496,8 +496,8 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
$formWhen->populate(array('add_show_start_date' => $starts_datetime->format("Y-m-d"),
|
||||
'add_show_start_time' => $starts_datetime->format("H:i"),
|
||||
'add_show_end_date_no_repeat' => $ends_datetime->format("Y-m-d"),
|
||||
'add_show_end_time' => $ends_datetime->format("H:i"),
|
||||
'add_show_end_date_no_repeat' => $ends_datetime->format("Y-m-d"),
|
||||
'add_show_end_time' => $ends_datetime->format("H:i"),
|
||||
'add_show_duration' => $instance_duration->format("%h")));
|
||||
|
||||
$formWhat->disable();
|
||||
|
@ -548,24 +548,24 @@ class ScheduleController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
$formWhat = new Application_Form_AddShowWhat();
|
||||
$formWho = new Application_Form_AddShowWho();
|
||||
$formWhen = new Application_Form_AddShowWhen();
|
||||
$formRepeats = new Application_Form_AddShowRepeats();
|
||||
$formStyle = new Application_Form_AddShowStyle();
|
||||
$formLive = new Application_Form_AddShowLiveStream();
|
||||
$formWho = new Application_Form_AddShowWho();
|
||||
$formWhen = new Application_Form_AddShowWhen();
|
||||
$formRepeats = new Application_Form_AddShowRepeats();
|
||||
$formStyle = new Application_Form_AddShowStyle();
|
||||
$formLive = new Application_Form_AddShowLiveStream();
|
||||
|
||||
$formWhat->removeDecorator('DtDdWrapper');
|
||||
$formWho->removeDecorator('DtDdWrapper');
|
||||
$formWhen->removeDecorator('DtDdWrapper');
|
||||
$formRepeats->removeDecorator('DtDdWrapper');
|
||||
$formStyle->removeDecorator('DtDdWrapper');
|
||||
$formWhat->removeDecorator('DtDdWrapper');
|
||||
$formWho->removeDecorator('DtDdWrapper');
|
||||
$formWhen->removeDecorator('DtDdWrapper');
|
||||
$formRepeats->removeDecorator('DtDdWrapper');
|
||||
$formStyle->removeDecorator('DtDdWrapper');
|
||||
|
||||
$this->view->what = $formWhat;
|
||||
$this->view->when = $formWhen;
|
||||
$this->view->repeats = $formRepeats;
|
||||
$this->view->who = $formWho;
|
||||
$this->view->style = $formStyle;
|
||||
$this->view->live = $formLive;
|
||||
$this->view->when = $formWhen;
|
||||
$this->view->repeats = $formRepeats;
|
||||
$this->view->who = $formWho;
|
||||
$this->view->style = $formStyle;
|
||||
$this->view->live = $formLive;
|
||||
$this->view->addNewShow = false;
|
||||
|
||||
$show = new Application_Model_Show($showInstance->getShowId());
|
||||
|
@ -585,8 +585,8 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
$formWhen->populate(array('add_show_start_date' => $startsDateTime->format("Y-m-d"),
|
||||
'add_show_start_time' => $startsDateTime->format("H:i"),
|
||||
'add_show_end_date_no_repeat' => $endsDateTime->format("Y-m-d"),
|
||||
'add_show_end_time' => $endsDateTime->format("H:i"),
|
||||
'add_show_end_date_no_repeat' => $endsDateTime->format("Y-m-d"),
|
||||
'add_show_end_time' => $endsDateTime->format("H:i"),
|
||||
'add_show_duration' => $show->getDuration(true),
|
||||
'add_show_repeats' => $show->isRepeating() ? 1 : 0));
|
||||
|
||||
|
@ -825,11 +825,11 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$user = Application_Model_User::getCurrentUser();
|
||||
|
||||
if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
|
||||
$showInstanceId = $this->_getParam('id');
|
||||
$showInstanceId = $this->_getParam('id');
|
||||
|
||||
try {
|
||||
try {
|
||||
$showInstance = new Application_Model_ShowInstance($showInstanceId);
|
||||
} catch(Exception $e) {
|
||||
} catch(Exception $e) {
|
||||
$this->view->show_error = true;
|
||||
return false;
|
||||
}
|
||||
|
@ -864,9 +864,9 @@ class ScheduleController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
public function contentContextMenuAction(){
|
||||
global $CC_CONFIG;
|
||||
global $CC_CONFIG;
|
||||
|
||||
$id = $this->_getParam('id');
|
||||
$id = $this->_getParam('id');
|
||||
|
||||
$params = '/format/json/id/#id#/';
|
||||
|
||||
|
@ -881,7 +881,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$baseUrl = $this->getRequest()->getBaseUrl();
|
||||
$url = $file->getRelativeFileUrl($baseUrl).'/download/true';
|
||||
$menu[] = array('action' => array('type' => 'gourl', 'url' => $url),
|
||||
'title' => 'Download');
|
||||
'title' => 'Download');
|
||||
|
||||
//returns format jjmenu is looking for.
|
||||
die(json_encode($menu));
|
||||
|
@ -892,7 +892,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
* This is only being used by schedule.js at the moment.
|
||||
*/
|
||||
public function setTimeScaleAction() {
|
||||
Application_Model_Preference::SetCalendarTimeScale($this->_getParam('timeScale'));
|
||||
Application_Model_Preference::SetCalendarTimeScale($this->_getParam('timeScale'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -900,7 +900,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
* This is only being used by schedule.js at the moment.
|
||||
*/
|
||||
public function setTimeIntervalAction() {
|
||||
Application_Model_Preference::SetCalendarTimeInterval($this->_getParam('timeInterval'));
|
||||
Application_Model_Preference::SetCalendarTimeInterval($this->_getParam('timeInterval'));
|
||||
}
|
||||
|
||||
public function calculateDurationAction() {
|
||||
|
|
|
@ -68,68 +68,68 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
$refer_sses = new Zend_Session_Namespace('referrer');
|
||||
|
||||
if ($request->isPost()) {
|
||||
$form = new Application_Form_RegisterAirtime();
|
||||
$form = new Application_Form_RegisterAirtime();
|
||||
|
||||
$values = $request->getPost();
|
||||
if ($values["Publicise"] != 1 && $form->isValid($values)) {
|
||||
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||
$values = $request->getPost();
|
||||
if ($values["Publicise"] != 1 && $form->isValid($values)) {
|
||||
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||
|
||||
if (isset($values["Privacy"])) {
|
||||
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||
}
|
||||
// unset session
|
||||
Zend_Session::namespaceUnset('referrer');
|
||||
}
|
||||
else if ($values["Publicise"] == '1' && $form->isValid($values)) {
|
||||
Application_Model_Preference::SetHeadTitle($values["stnName"], $this->view);
|
||||
Application_Model_Preference::SetPhone($values["Phone"]);
|
||||
Application_Model_Preference::SetEmail($values["Email"]);
|
||||
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
|
||||
Application_Model_Preference::SetPublicise($values["Publicise"]);
|
||||
if (isset($values["Privacy"])) {
|
||||
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||
}
|
||||
// unset session
|
||||
Zend_Session::namespaceUnset('referrer');
|
||||
}
|
||||
else if ($values["Publicise"] == '1' && $form->isValid($values)) {
|
||||
Application_Model_Preference::SetHeadTitle($values["stnName"], $this->view);
|
||||
Application_Model_Preference::SetPhone($values["Phone"]);
|
||||
Application_Model_Preference::SetEmail($values["Email"]);
|
||||
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
|
||||
Application_Model_Preference::SetPublicise($values["Publicise"]);
|
||||
|
||||
$form->Logo->receive();
|
||||
$imagePath = $form->Logo->getFileName();
|
||||
$form->Logo->receive();
|
||||
$imagePath = $form->Logo->getFileName();
|
||||
|
||||
Application_Model_Preference::SetStationCountry($values["Country"]);
|
||||
Application_Model_Preference::SetStationCity($values["City"]);
|
||||
Application_Model_Preference::SetStationDescription($values["Description"]);
|
||||
Application_Model_Preference::SetStationLogo($imagePath);
|
||||
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||
Application_Model_Preference::SetStationCountry($values["Country"]);
|
||||
Application_Model_Preference::SetStationCity($values["City"]);
|
||||
Application_Model_Preference::SetStationDescription($values["Description"]);
|
||||
Application_Model_Preference::SetStationLogo($imagePath);
|
||||
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||
|
||||
if (isset($values["Privacy"])){
|
||||
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||
}
|
||||
// unset session
|
||||
Zend_Session::namespaceUnset('referrer');
|
||||
}
|
||||
else {
|
||||
$logo = Application_Model_Preference::GetStationLogo();
|
||||
if ($logo) {
|
||||
$this->view->logoImg = $logo;
|
||||
}
|
||||
$this->view->dialog = $form;
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/register.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
}
|
||||
if (isset($values["Privacy"])){
|
||||
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||
}
|
||||
// unset session
|
||||
Zend_Session::namespaceUnset('referrer');
|
||||
}
|
||||
else {
|
||||
$logo = Application_Model_Preference::GetStationLogo();
|
||||
if ($logo) {
|
||||
$this->view->logoImg = $logo;
|
||||
}
|
||||
$this->view->dialog = $form;
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/register.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
}
|
||||
}
|
||||
|
||||
//popup if previous page was login
|
||||
if ($refer_sses->referrer == 'login' && Application_Model_Preference::ShouldShowPopUp()
|
||||
&& !Application_Model_Preference::GetSupportFeedback() && $user->isAdmin()){
|
||||
//popup if previous page was login
|
||||
if ($refer_sses->referrer == 'login' && Application_Model_Preference::ShouldShowPopUp()
|
||||
&& !Application_Model_Preference::GetSupportFeedback() && $user->isAdmin()){
|
||||
|
||||
$form = new Application_Form_RegisterAirtime();
|
||||
$form = new Application_Form_RegisterAirtime();
|
||||
|
||||
$logo = Application_Model_Preference::GetStationLogo();
|
||||
if ($logo) {
|
||||
$this->view->logoImg = $logo;
|
||||
}
|
||||
$this->view->dialog = $form;
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/register.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
}
|
||||
$logo = Application_Model_Preference::GetStationLogo();
|
||||
if ($logo) {
|
||||
$this->view->logoImg = $logo;
|
||||
}
|
||||
$this->view->dialog = $form;
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/register.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
}
|
||||
|
||||
//determine whether to remove/hide/display the library.
|
||||
$showLib = false;
|
||||
if (!$user->isGuest()) {
|
||||
$disableLib = false;
|
||||
//determine whether to remove/hide/display the library.
|
||||
$showLib = false;
|
||||
if (!$user->isGuest()) {
|
||||
$disableLib = false;
|
||||
$data = Application_Model_Preference::getValue("nowplaying_screen", true);
|
||||
if ($data != "") {
|
||||
$settings = unserialize($data);
|
||||
|
@ -138,12 +138,12 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
$showLib = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$disableLib = true;
|
||||
}
|
||||
$this->view->disableLib = $disableLib;
|
||||
$this->view->showLib = $showLib;
|
||||
}
|
||||
else {
|
||||
$disableLib = true;
|
||||
}
|
||||
$this->view->disableLib = $disableLib;
|
||||
$this->view->showLib = $showLib;
|
||||
|
||||
//populate date range form for show builder.
|
||||
$now = time();
|
||||
|
|
|
@ -37,7 +37,7 @@ class UserController extends Zend_Controller_Action
|
|||
if ($request->isPost()) {
|
||||
if ($form->isValid($request->getPost())) {
|
||||
|
||||
$formdata = $form->getValues();
|
||||
$formdata = $form->getValues();
|
||||
if(isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1 && $formdata['login'] == 'admin' && $formdata['user_id'] != 0){
|
||||
$this->view->successMessage = "<div class='errors'>Specific action is not allowed in demo version!</div>";
|
||||
}
|
||||
|
|
|
@ -69,10 +69,10 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
return $this->_roleName;
|
||||
}
|
||||
|
||||
public function setRoleName($type)
|
||||
{
|
||||
$this->_roleName = $type;
|
||||
}
|
||||
public function setRoleName($type)
|
||||
{
|
||||
$this->_roleName = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the error page
|
||||
|
@ -108,58 +108,58 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
**/
|
||||
public function preDispatch(Zend_Controller_Request_Abstract $request)
|
||||
{
|
||||
$controller = strtolower($request->getControllerName());
|
||||
$controller = strtolower($request->getControllerName());
|
||||
|
||||
if (in_array($controller, array("api", "auth"))){
|
||||
if (in_array($controller, array("api", "auth"))){
|
||||
|
||||
$this->setRoleName("G");
|
||||
}
|
||||
$this->setRoleName("G");
|
||||
}
|
||||
else if (!Zend_Auth::getInstance()->hasIdentity()){
|
||||
|
||||
if ($controller !== 'login') {
|
||||
if ($controller !== 'login') {
|
||||
|
||||
if ($request->isXmlHttpRequest()) {
|
||||
if ($request->isXmlHttpRequest()) {
|
||||
|
||||
$url = 'http://'.$request->getHttpHost().'/login';
|
||||
$json = Zend_Json::encode(array('auth' => false, 'url' => $url));
|
||||
$url = 'http://'.$request->getHttpHost().'/login';
|
||||
$json = Zend_Json::encode(array('auth' => false, 'url' => $url));
|
||||
|
||||
// Prepare response
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(401)
|
||||
->setBody($json)
|
||||
->sendResponse();
|
||||
// Prepare response
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(401)
|
||||
->setBody($json)
|
||||
->sendResponse();
|
||||
|
||||
//redirectAndExit() cleans up, sends the headers and stops the script
|
||||
Zend_Controller_Action_HelperBroker::getStaticHelper('redirector')->redirectAndExit();
|
||||
}
|
||||
else {
|
||||
$r = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
|
||||
$r->gotoSimpleAndExit('index', 'login', $request->getModuleName());
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
//redirectAndExit() cleans up, sends the headers and stops the script
|
||||
Zend_Controller_Action_HelperBroker::getStaticHelper('redirector')->redirectAndExit();
|
||||
}
|
||||
else {
|
||||
$r = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
|
||||
$r->gotoSimpleAndExit('index', 'login', $request->getModuleName());
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$this->setRoleName($userInfo->type);
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$this->setRoleName($userInfo->type);
|
||||
|
||||
Zend_View_Helper_Navigation_HelperAbstract::setDefaultAcl($this->_acl);
|
||||
Zend_View_Helper_Navigation_HelperAbstract::setDefaultRole($this->_roleName);
|
||||
Zend_View_Helper_Navigation_HelperAbstract::setDefaultRole($this->_roleName);
|
||||
|
||||
$resourceName = '';
|
||||
$resourceName = '';
|
||||
|
||||
if ($request->getModuleName() != 'default') {
|
||||
$resourceName .= strtolower($request->getModuleName()) . ':';
|
||||
}
|
||||
if ($request->getModuleName() != 'default') {
|
||||
$resourceName .= strtolower($request->getModuleName()) . ':';
|
||||
}
|
||||
|
||||
$resourceName .= $controller;
|
||||
$resourceName .= $controller;
|
||||
|
||||
/** Check if the controller/action can be accessed by the current user */
|
||||
if (!$this->getAcl()->isAllowed($this->_roleName, $resourceName, $request->getActionName())) {
|
||||
/** Redirect to access denied page */
|
||||
$this->denyAccess();
|
||||
}
|
||||
}
|
||||
/** Check if the controller/action can be accessed by the current user */
|
||||
if (!$this->getAcl()->isAllowed($this->_roleName, $resourceName, $request->getActionName())) {
|
||||
/** Redirect to access denied page */
|
||||
$this->denyAccess();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue