CC-4090: Make code style PSR compliant

-removed all trailing whitespace
This commit is contained in:
Martin Konecny 2012-07-10 18:53:06 -04:00
parent ee3447f903
commit d9cde230cd
17 changed files with 484 additions and 484 deletions

View File

@ -74,7 +74,7 @@ class ApiController extends Zend_Controller_Action
* This is only being used by schedule.js at the moment. * This is only being used by schedule.js at the moment.
*/ */
public function calendarInitAction(){ public function calendarInitAction(){
$this->view->layout()->disableLayout(); $this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true); $this->_helper->viewRenderer->setNoRender(true);
if(is_null(Zend_Auth::getInstance()->getStorage()->read())) { if(is_null(Zend_Auth::getInstance()->getStorage()->read())) {
@ -83,12 +83,12 @@ class ApiController extends Zend_Controller_Action
return; return;
} }
$this->view->calendarInit = array( $this->view->calendarInit = array(
"timestamp" => time(), "timestamp" => time(),
"timezoneOffset" => date("Z"), "timezoneOffset" => date("Z"),
"timeScale" => Application_Model_Preference::GetCalendarTimeScale(), "timeScale" => Application_Model_Preference::GetCalendarTimeScale(),
"timeInterval" => Application_Model_Preference::GetCalendarTimeInterval(), "timeInterval" => Application_Model_Preference::GetCalendarTimeInterval(),
"weekStartDay" => Application_Model_Preference::GetWeekStartDay() "weekStartDay" => Application_Model_Preference::GetWeekStartDay()
); );
} }
@ -331,7 +331,7 @@ class ApiController extends Zend_Controller_Action
$result[$dow[$i]] = $shows; $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"); header("Content-type: text/javascript");
echo $_GET['callback'].'('.json_encode($result).')'; echo $_GET['callback'].'('.json_encode($result).')';
} else { } else {
@ -466,8 +466,8 @@ class ApiController extends Zend_Controller_Action
$this->view->showinstanceid = $show_instance_id; $this->view->showinstanceid = $show_instance_id;
$showCanceled = false; $showCanceled = false;
$file = Application_Model_StoredFile::Recall($file_id); $file = Application_Model_StoredFile::Recall($file_id);
//$show_instance = $this->_getParam('show_instance'); //$show_instance = $this->_getParam('show_instance');
$show_name = null; $show_name = null;
@ -508,7 +508,7 @@ class ApiController extends Zend_Controller_Action
$tmpTitle = $file->getName(); $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_CREATOR', "Airtime Show Recorder");
$file->setMetadataValue('MDATA_KEY_TRACKNUMBER', $show_instance_id); $file->setMetadataValue('MDATA_KEY_TRACKNUMBER', $show_instance_id);

View File

@ -155,14 +155,14 @@ class PlaylistController extends Zend_Controller_Action
public function newAction() public function newAction()
{ {
$pl_sess = $this->pl_sess; $pl_sess = $this->pl_sess;
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$pl = new Application_Model_Playlist(); $pl = new Application_Model_Playlist();
$pl->setName("Untitled Playlist"); $pl->setName("Untitled Playlist");
$pl->setPLMetaData('dc:creator', $userInfo->id); $pl->setPLMetaData('dc:creator', $userInfo->id);
$this->changePlaylist($pl->getId()); $this->changePlaylist($pl->getId());
$this->createFullResponse($pl); $this->createFullResponse($pl);
} }
public function editAction() public function editAction()
@ -170,20 +170,20 @@ class PlaylistController extends Zend_Controller_Action
$id = $this->_getParam('id', null); $id = $this->_getParam('id', null);
Logging::log("editing playlist {$id}"); Logging::log("editing playlist {$id}");
if (!is_null($id)) { if (!is_null($id)) {
$this->changePlaylist($id); $this->changePlaylist($id);
} }
try { try {
$pl = new Application_Model_Playlist($id); $pl = new Application_Model_Playlist($id);
$this->createFullResponse($pl); $this->createFullResponse($pl);
} }
catch (PlaylistNotFoundException $e) { catch (PlaylistNotFoundException $e) {
$this->playlistNotFound(); $this->playlistNotFound();
} }
catch (Exception $e) { catch (Exception $e) {
$this->playlistUnknownError($e); $this->playlistUnknownError($e);
} }
} }
public function deleteAction() public function deleteAction()
@ -219,8 +219,8 @@ class PlaylistController extends Zend_Controller_Action
{ {
$ids = $this->_getParam('ids', array()); $ids = $this->_getParam('ids', array());
$ids = (!is_array($ids)) ? array($ids) : $ids; $ids = (!is_array($ids)) ? array($ids) : $ids;
$afterItem = $this->_getParam('afterItem', null); $afterItem = $this->_getParam('afterItem', null);
$addType = $this->_getParam('type', 'after'); $addType = $this->_getParam('type', 'after');
try { try {
$pl = $this->getPlaylist(); $pl = $this->getPlaylist();
@ -285,9 +285,9 @@ class PlaylistController extends Zend_Controller_Action
public function setCueAction() public function setCueAction()
{ {
$id = $this->_getParam('id'); $id = $this->_getParam('id');
$cueIn = $this->_getParam('cueIn', null); $cueIn = $this->_getParam('cueIn', null);
$cueOut = $this->_getParam('cueOut', null); $cueOut = $this->_getParam('cueOut', null);
try { try {
$pl = $this->getPlaylist(); $pl = $this->getPlaylist();
@ -314,9 +314,9 @@ class PlaylistController extends Zend_Controller_Action
public function setFadeAction() public function setFadeAction()
{ {
$id = $this->_getParam('id'); $id = $this->_getParam('id');
$fadeIn = $this->_getParam('fadeIn', null); $fadeIn = $this->_getParam('fadeIn', null);
$fadeOut = $this->_getParam('fadeOut', null); $fadeOut = $this->_getParam('fadeOut', null);
try { try {
$pl = $this->getPlaylist(); $pl = $this->getPlaylist();
@ -369,8 +369,8 @@ class PlaylistController extends Zend_Controller_Action
**/ **/
public function setPlaylistFadesAction() public function setPlaylistFadesAction()
{ {
$fadeIn = $this->_getParam('fadeIn', null); $fadeIn = $this->_getParam('fadeIn', null);
$fadeOut = $this->_getParam('fadeOut', null); $fadeOut = $this->_getParam('fadeOut', null);
try { try {
$pl = $this->getPlaylist(); $pl = $this->getPlaylist();

View File

@ -2,19 +2,19 @@
class PlayoutHistoryController extends Zend_Controller_Action class PlayoutHistoryController extends Zend_Controller_Action
{ {
public function init() public function init()
{ {
$ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext $ajaxContext
->addActionContext('playout-history-feed', 'json') ->addActionContext('playout-history-feed', 'json')
->initContext(); ->initContext();
} }
public function indexAction() public function indexAction()
{ {
global $CC_CONFIG; global $CC_CONFIG;
$request = $this->getRequest(); $request = $this->getRequest();
$baseUrl = $request->getBaseUrl(); $baseUrl = $request->getBaseUrl();
//default time is the last 24 hours. //default time is the last 24 hours.
@ -37,48 +37,48 @@ class PlayoutHistoryController extends Zend_Controller_Action
$this->view->date_form = $form; $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/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/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.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/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/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/datatables/plugin/TableTools/js/TableTools.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$offset = date("Z") * -1; $offset = date("Z") * -1;
$this->view->headScript()->appendScript("var serverTimezoneOffset = {$offset}; //in seconds"); $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/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/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/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->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.'/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/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/playouthistory.css?'.$CC_CONFIG['airtime_version']);
} }
public function playoutHistoryFeedAction() public function playoutHistoryFeedAction()
{ {
$request = $this->getRequest(); $request = $this->getRequest();
$current_time = time(); $current_time = time();
$params = $request->getParams(); $params = $request->getParams();
$starts_epoch = $request->getParam("start", $current_time - (60*60*24)); $starts_epoch = $request->getParam("start", $current_time - (60*60*24));
$ends_epoch = $request->getParam("end", $current_time); $ends_epoch = $request->getParam("end", $current_time);
$startsDT = DateTime::createFromFormat("U", $starts_epoch, new DateTimeZone("UTC")); $startsDT = DateTime::createFromFormat("U", $starts_epoch, new DateTimeZone("UTC"));
$endsDT = DateTime::createFromFormat("U", $ends_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 starts {$startsDT->format("Y-m-d H:i:s")}");
Logging::log("history ends {$endsDT->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->sEcho = $r["sEcho"];
$this->view->iTotalDisplayRecords = $r["iTotalDisplayRecords"]; $this->view->iTotalDisplayRecords = $r["iTotalDisplayRecords"];
$this->view->iTotalRecords = $r["iTotalRecords"]; $this->view->iTotalRecords = $r["iTotalRecords"];
$this->view->history = $r["history"]; $this->view->history = $r["history"];
} }
} }

View File

@ -10,16 +10,16 @@ class ScheduleController extends Zend_Controller_Action
$ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('event-feed', 'json') $ajaxContext->addActionContext('event-feed', 'json')
->addActionContext('make-context-menu', 'json') ->addActionContext('make-context-menu', 'json')
->addActionContext('add-show-dialog', 'json') ->addActionContext('add-show-dialog', 'json')
->addActionContext('add-show', 'json') ->addActionContext('add-show', 'json')
->addActionContext('edit-show', 'json') ->addActionContext('edit-show', 'json')
->addActionContext('move-show', 'json') ->addActionContext('move-show', 'json')
->addActionContext('resize-show', 'json') ->addActionContext('resize-show', 'json')
->addActionContext('delete-show', 'json') ->addActionContext('delete-show', 'json')
->addActionContext('show-content-dialog', 'json') ->addActionContext('show-content-dialog', 'json')
->addActionContext('clear-show', 'json') ->addActionContext('clear-show', 'json')
->addActionContext('get-current-playlist', 'json') ->addActionContext('get-current-playlist', 'json')
->addActionContext('remove-group', 'json') ->addActionContext('remove-group', 'json')
->addActionContext('populate-show-form', 'json') ->addActionContext('populate-show-form', 'json')
->addActionContext('populate-show-instance-form', 'json') ->addActionContext('populate-show-instance-form', 'json')
->addActionContext('cancel-show', 'json') ->addActionContext('cancel-show', 'json')
@ -35,7 +35,7 @@ class ScheduleController extends Zend_Controller_Action
->addActionContext('get-current-show', 'json') ->addActionContext('get-current-show', 'json')
->initContext(); ->initContext();
$this->sched_sess = new Zend_Session_Namespace("schedule"); $this->sched_sess = new Zend_Session_Namespace("schedule");
} }
public function indexAction() public function indexAction()
@ -106,7 +106,7 @@ class ScheduleController extends Zend_Controller_Action
$end = new DateTime($this->_getParam('end', null)); $end = new DateTime($this->_getParam('end', null));
$end->setTimezone(new DateTimeZone("UTC")); $end->setTimezone(new DateTimeZone("UTC"));
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id); $user = new Application_Model_User($userInfo->id);
if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
$editable = true; $editable = true;
@ -115,7 +115,7 @@ class ScheduleController extends Zend_Controller_Action
$editable = false; $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() { public function getCurrentShowAction() {
@ -155,8 +155,8 @@ class ScheduleController extends Zend_Controller_Action
public function resizeShowAction() public function resizeShowAction()
{ {
$deltaDay = $this->_getParam('day'); $deltaDay = $this->_getParam('day');
$deltaMin = $this->_getParam('min'); $deltaMin = $this->_getParam('min');
$showId = $this->_getParam('showId'); $showId = $this->_getParam('showId');
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id); $user = new Application_Model_User($userInfo->id);
@ -168,34 +168,34 @@ class ScheduleController extends Zend_Controller_Action
$this->view->show_error = true; $this->view->show_error = true;
return false; return false;
} }
$error = $show->resizeShow($deltaDay, $deltaMin); $error = $show->resizeShow($deltaDay, $deltaMin);
} }
if (isset($error)) { if (isset($error)) {
$this->view->error = $error; $this->view->error = $error;
} }
} }
public function deleteShowAction() public function deleteShowAction()
{ {
$showInstanceId = $this->_getParam('id'); $showInstanceId = $this->_getParam('id');
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id); $user = new Application_Model_User($userInfo->id);
if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
try { try {
$showInstance = new Application_Model_ShowInstance($showInstanceId); $showInstance = new Application_Model_ShowInstance($showInstanceId);
} }
catch(Exception $e){ catch(Exception $e){
$this->view->show_error = true; $this->view->show_error = true;
return false; 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; $showInstanceId = $this->sched_sess->showInstanceId;
$group_id = $this->_getParam('groupId'); $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); $user = new Application_Model_User($userInfo->id);
try{ try{
$show = new Application_Model_ShowInstance($showInstanceId); $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())) { 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->showContent = $show->getShowContent();
$this->view->timeFilled = $show->getTimeScheduled(); $this->view->timeFilled = $show->getTimeScheduled();
$this->view->percentFilled = $show->getPercentScheduled(); $this->view->percentFilled = $show->getPercentScheduled();
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml'); $this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
unset($this->view->showContent); unset($this->view->showContent);
} }
public function showContentDialogAction() 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 // this feature is disabled in 2.1 and should be back in 2.2
/*public function populateShowInstanceFormAction(){ /*public function populateShowInstanceFormAction(){
$formWhat = new Application_Form_AddShowWhat(); $formWhat = new Application_Form_AddShowWhat();
$formWho = new Application_Form_AddShowWho(); $formWho = new Application_Form_AddShowWho();
$formWhen = new Application_Form_AddShowWhen(); $formWhen = new Application_Form_AddShowWhen();
$formRepeats = new Application_Form_AddShowRepeats(); $formRepeats = new Application_Form_AddShowRepeats();
$formStyle = new Application_Form_AddShowStyle(); $formStyle = new Application_Form_AddShowStyle();
$formLive = new Application_Form_AddShowLiveStream(); $formLive = new Application_Form_AddShowLiveStream();
$formWhat->removeDecorator('DtDdWrapper'); $formWhat->removeDecorator('DtDdWrapper');
$formWho->removeDecorator('DtDdWrapper'); $formWho->removeDecorator('DtDdWrapper');
$formWhen->removeDecorator('DtDdWrapper'); $formWhen->removeDecorator('DtDdWrapper');
$formRepeats->removeDecorator('DtDdWrapper'); $formRepeats->removeDecorator('DtDdWrapper');
$formStyle->removeDecorator('DtDdWrapper'); $formStyle->removeDecorator('DtDdWrapper');
$this->view->what = $formWhat; $this->view->what = $formWhat;
$this->view->when = $formWhen; $this->view->when = $formWhen;
$this->view->repeats = $formRepeats; $this->view->repeats = $formRepeats;
$this->view->who = $formWho; $this->view->who = $formWho;
$this->view->style = $formStyle; $this->view->style = $formStyle;
$this->view->live = $formLive; $this->view->live = $formLive;
$this->view->addNewShow = false; $this->view->addNewShow = false;
$showInstanceId = $this->_getParam('id'); $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"), $formWhen->populate(array('add_show_start_date' => $starts_datetime->format("Y-m-d"),
'add_show_start_time' => $starts_datetime->format("H:i"), 'add_show_start_time' => $starts_datetime->format("H:i"),
'add_show_end_date_no_repeat' => $ends_datetime->format("Y-m-d"), 'add_show_end_date_no_repeat' => $ends_datetime->format("Y-m-d"),
'add_show_end_time' => $ends_datetime->format("H:i"), 'add_show_end_time' => $ends_datetime->format("H:i"),
'add_show_duration' => $instance_duration->format("%h"))); 'add_show_duration' => $instance_duration->format("%h")));
$formWhat->disable(); $formWhat->disable();
@ -548,24 +548,24 @@ class ScheduleController extends Zend_Controller_Action
} }
$formWhat = new Application_Form_AddShowWhat(); $formWhat = new Application_Form_AddShowWhat();
$formWho = new Application_Form_AddShowWho(); $formWho = new Application_Form_AddShowWho();
$formWhen = new Application_Form_AddShowWhen(); $formWhen = new Application_Form_AddShowWhen();
$formRepeats = new Application_Form_AddShowRepeats(); $formRepeats = new Application_Form_AddShowRepeats();
$formStyle = new Application_Form_AddShowStyle(); $formStyle = new Application_Form_AddShowStyle();
$formLive = new Application_Form_AddShowLiveStream(); $formLive = new Application_Form_AddShowLiveStream();
$formWhat->removeDecorator('DtDdWrapper'); $formWhat->removeDecorator('DtDdWrapper');
$formWho->removeDecorator('DtDdWrapper'); $formWho->removeDecorator('DtDdWrapper');
$formWhen->removeDecorator('DtDdWrapper'); $formWhen->removeDecorator('DtDdWrapper');
$formRepeats->removeDecorator('DtDdWrapper'); $formRepeats->removeDecorator('DtDdWrapper');
$formStyle->removeDecorator('DtDdWrapper'); $formStyle->removeDecorator('DtDdWrapper');
$this->view->what = $formWhat; $this->view->what = $formWhat;
$this->view->when = $formWhen; $this->view->when = $formWhen;
$this->view->repeats = $formRepeats; $this->view->repeats = $formRepeats;
$this->view->who = $formWho; $this->view->who = $formWho;
$this->view->style = $formStyle; $this->view->style = $formStyle;
$this->view->live = $formLive; $this->view->live = $formLive;
$this->view->addNewShow = false; $this->view->addNewShow = false;
$show = new Application_Model_Show($showInstance->getShowId()); $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"), $formWhen->populate(array('add_show_start_date' => $startsDateTime->format("Y-m-d"),
'add_show_start_time' => $startsDateTime->format("H:i"), 'add_show_start_time' => $startsDateTime->format("H:i"),
'add_show_end_date_no_repeat' => $endsDateTime->format("Y-m-d"), 'add_show_end_date_no_repeat' => $endsDateTime->format("Y-m-d"),
'add_show_end_time' => $endsDateTime->format("H:i"), 'add_show_end_time' => $endsDateTime->format("H:i"),
'add_show_duration' => $show->getDuration(true), 'add_show_duration' => $show->getDuration(true),
'add_show_repeats' => $show->isRepeating() ? 1 : 0)); 'add_show_repeats' => $show->isRepeating() ? 1 : 0));
@ -825,11 +825,11 @@ class ScheduleController extends Zend_Controller_Action
$user = Application_Model_User::getCurrentUser(); $user = Application_Model_User::getCurrentUser();
if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { 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); $showInstance = new Application_Model_ShowInstance($showInstanceId);
} catch(Exception $e) { } catch(Exception $e) {
$this->view->show_error = true; $this->view->show_error = true;
return false; return false;
} }
@ -864,9 +864,9 @@ class ScheduleController extends Zend_Controller_Action
} }
public function contentContextMenuAction(){ public function contentContextMenuAction(){
global $CC_CONFIG; global $CC_CONFIG;
$id = $this->_getParam('id'); $id = $this->_getParam('id');
$params = '/format/json/id/#id#/'; $params = '/format/json/id/#id#/';
@ -881,7 +881,7 @@ class ScheduleController extends Zend_Controller_Action
$baseUrl = $this->getRequest()->getBaseUrl(); $baseUrl = $this->getRequest()->getBaseUrl();
$url = $file->getRelativeFileUrl($baseUrl).'/download/true'; $url = $file->getRelativeFileUrl($baseUrl).'/download/true';
$menu[] = array('action' => array('type' => 'gourl', 'url' => $url), $menu[] = array('action' => array('type' => 'gourl', 'url' => $url),
'title' => 'Download'); 'title' => 'Download');
//returns format jjmenu is looking for. //returns format jjmenu is looking for.
die(json_encode($menu)); 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. * This is only being used by schedule.js at the moment.
*/ */
public function setTimeScaleAction() { 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. * This is only being used by schedule.js at the moment.
*/ */
public function setTimeIntervalAction() { public function setTimeIntervalAction() {
Application_Model_Preference::SetCalendarTimeInterval($this->_getParam('timeInterval')); Application_Model_Preference::SetCalendarTimeInterval($this->_getParam('timeInterval'));
} }
public function calculateDurationAction() { public function calculateDurationAction() {

View File

@ -68,68 +68,68 @@ class ShowbuilderController extends Zend_Controller_Action
$refer_sses = new Zend_Session_Namespace('referrer'); $refer_sses = new Zend_Session_Namespace('referrer');
if ($request->isPost()) { if ($request->isPost()) {
$form = new Application_Form_RegisterAirtime(); $form = new Application_Form_RegisterAirtime();
$values = $request->getPost(); $values = $request->getPost();
if ($values["Publicise"] != 1 && $form->isValid($values)) { if ($values["Publicise"] != 1 && $form->isValid($values)) {
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]); Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
if (isset($values["Privacy"])) { if (isset($values["Privacy"])) {
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]); Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
} }
// unset session // unset session
Zend_Session::namespaceUnset('referrer'); Zend_Session::namespaceUnset('referrer');
} }
else if ($values["Publicise"] == '1' && $form->isValid($values)) { else if ($values["Publicise"] == '1' && $form->isValid($values)) {
Application_Model_Preference::SetHeadTitle($values["stnName"], $this->view); Application_Model_Preference::SetHeadTitle($values["stnName"], $this->view);
Application_Model_Preference::SetPhone($values["Phone"]); Application_Model_Preference::SetPhone($values["Phone"]);
Application_Model_Preference::SetEmail($values["Email"]); Application_Model_Preference::SetEmail($values["Email"]);
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]); Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
Application_Model_Preference::SetPublicise($values["Publicise"]); Application_Model_Preference::SetPublicise($values["Publicise"]);
$form->Logo->receive(); $form->Logo->receive();
$imagePath = $form->Logo->getFileName(); $imagePath = $form->Logo->getFileName();
Application_Model_Preference::SetStationCountry($values["Country"]); Application_Model_Preference::SetStationCountry($values["Country"]);
Application_Model_Preference::SetStationCity($values["City"]); Application_Model_Preference::SetStationCity($values["City"]);
Application_Model_Preference::SetStationDescription($values["Description"]); Application_Model_Preference::SetStationDescription($values["Description"]);
Application_Model_Preference::SetStationLogo($imagePath); Application_Model_Preference::SetStationLogo($imagePath);
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]); Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
if (isset($values["Privacy"])){ if (isset($values["Privacy"])){
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]); Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
} }
// unset session // unset session
Zend_Session::namespaceUnset('referrer'); Zend_Session::namespaceUnset('referrer');
} }
else { else {
$logo = Application_Model_Preference::GetStationLogo(); $logo = Application_Model_Preference::GetStationLogo();
if ($logo) { if ($logo) {
$this->view->logoImg = $logo; $this->view->logoImg = $logo;
} }
$this->view->dialog = $form; $this->view->dialog = $form;
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/register.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/register.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
} }
} }
//popup if previous page was login //popup if previous page was login
if ($refer_sses->referrer == 'login' && Application_Model_Preference::ShouldShowPopUp() if ($refer_sses->referrer == 'login' && Application_Model_Preference::ShouldShowPopUp()
&& !Application_Model_Preference::GetSupportFeedback() && $user->isAdmin()){ && !Application_Model_Preference::GetSupportFeedback() && $user->isAdmin()){
$form = new Application_Form_RegisterAirtime(); $form = new Application_Form_RegisterAirtime();
$logo = Application_Model_Preference::GetStationLogo(); $logo = Application_Model_Preference::GetStationLogo();
if ($logo) { if ($logo) {
$this->view->logoImg = $logo; $this->view->logoImg = $logo;
} }
$this->view->dialog = $form; $this->view->dialog = $form;
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/register.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/register.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
} }
//determine whether to remove/hide/display the library. //determine whether to remove/hide/display the library.
$showLib = false; $showLib = false;
if (!$user->isGuest()) { if (!$user->isGuest()) {
$disableLib = false; $disableLib = false;
$data = Application_Model_Preference::getValue("nowplaying_screen", true); $data = Application_Model_Preference::getValue("nowplaying_screen", true);
if ($data != "") { if ($data != "") {
$settings = unserialize($data); $settings = unserialize($data);
@ -138,12 +138,12 @@ class ShowbuilderController extends Zend_Controller_Action
$showLib = true; $showLib = true;
} }
} }
} }
else { else {
$disableLib = true; $disableLib = true;
} }
$this->view->disableLib = $disableLib; $this->view->disableLib = $disableLib;
$this->view->showLib = $showLib; $this->view->showLib = $showLib;
//populate date range form for show builder. //populate date range form for show builder.
$now = time(); $now = time();

View File

@ -37,7 +37,7 @@ class UserController extends Zend_Controller_Action
if ($request->isPost()) { if ($request->isPost()) {
if ($form->isValid($request->getPost())) { 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){ 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>"; $this->view->successMessage = "<div class='errors'>Specific action is not allowed in demo version!</div>";
} }

View File

@ -69,10 +69,10 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
return $this->_roleName; return $this->_roleName;
} }
public function setRoleName($type) public function setRoleName($type)
{ {
$this->_roleName = $type; $this->_roleName = $type;
} }
/** /**
* Sets the error page * 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) 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()){ else if (!Zend_Auth::getInstance()->hasIdentity()){
if ($controller !== 'login') { if ($controller !== 'login') {
if ($request->isXmlHttpRequest()) { if ($request->isXmlHttpRequest()) {
$url = 'http://'.$request->getHttpHost().'/login'; $url = 'http://'.$request->getHttpHost().'/login';
$json = Zend_Json::encode(array('auth' => false, 'url' => $url)); $json = Zend_Json::encode(array('auth' => false, 'url' => $url));
// Prepare response // Prepare response
$this->getResponse() $this->getResponse()
->setHttpResponseCode(401) ->setHttpResponseCode(401)
->setBody($json) ->setBody($json)
->sendResponse(); ->sendResponse();
//redirectAndExit() cleans up, sends the headers and stops the script //redirectAndExit() cleans up, sends the headers and stops the script
Zend_Controller_Action_HelperBroker::getStaticHelper('redirector')->redirectAndExit(); Zend_Controller_Action_HelperBroker::getStaticHelper('redirector')->redirectAndExit();
} }
else { else {
$r = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector'); $r = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
$r->gotoSimpleAndExit('index', 'login', $request->getModuleName()); $r->gotoSimpleAndExit('index', 'login', $request->getModuleName());
} }
} }
} }
else { else {
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$this->setRoleName($userInfo->type); $this->setRoleName($userInfo->type);
Zend_View_Helper_Navigation_HelperAbstract::setDefaultAcl($this->_acl); 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') { if ($request->getModuleName() != 'default') {
$resourceName .= strtolower($request->getModuleName()) . ':'; $resourceName .= strtolower($request->getModuleName()) . ':';
} }
$resourceName .= $controller; $resourceName .= $controller;
/** Check if the controller/action can be accessed by the current user */ /** Check if the controller/action can be accessed by the current user */
if (!$this->getAcl()->isAllowed($this->_roleName, $resourceName, $request->getActionName())) { if (!$this->getAcl()->isAllowed($this->_roleName, $resourceName, $request->getActionName())) {
/** Redirect to access denied page */ /** Redirect to access denied page */
$this->denyAccess(); $this->denyAccess();
} }
} }
} }
/** /**