Format code using php-cs-fixer

This commit is contained in:
jo 2021-10-11 16:10:47 +02:00
parent 43d7dc92cd
commit d52c6184b9
352 changed files with 17473 additions and 17041 deletions

View file

@ -2,13 +2,13 @@
class DashboardController extends Zend_Controller_Action
{
public function init()
{
$ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('switch-source', 'json')
->addActionContext('disconnect-source', 'json')
->initContext();
->addActionContext('disconnect-source', 'json')
->initContext()
;
}
public function indexAction()
@ -24,17 +24,17 @@ class DashboardController extends Zend_Controller_Action
$user = new Application_Model_User($userInfo->id);
$show = Application_Model_Show::getCurrentShow();
$show_id = isset($show[0]['id'])?$show[0]['id']:0;
$show_id = isset($show[0]['id']) ? $show[0]['id'] : 0;
$source_connected = Application_Model_Preference::GetSourceStatus($sourcename);
if ($user->canSchedule($show_id) && $source_connected) {
$data = array("sourcename"=>$sourcename);
Application_Model_RabbitMq::SendMessageToPypo("disconnect_source", $data);
$data = ['sourcename' => $sourcename];
Application_Model_RabbitMq::SendMessageToPypo('disconnect_source', $data);
} else {
if ($source_connected) {
$this->view->error = _("You don't have permission to disconnect source.");
} else {
$this->view->error = _("There is no source connected to this input.");
$this->view->error = _('There is no source connected to this input.');
}
}
}
@ -48,33 +48,36 @@ class DashboardController extends Zend_Controller_Action
$user = new Application_Model_User($userInfo->id);
$show = Application_Model_Show::getCurrentShow();
$show_id = isset($show[0]['id'])?$show[0]['id']:0;
$show_id = isset($show[0]['id']) ? $show[0]['id'] : 0;
$source_connected = Application_Model_Preference::GetSourceStatus($sourcename);
if ($user->canSchedule($show_id) && ($source_connected || $sourcename == 'scheduled_play' || $current_status == "on")) {
if ($user->canSchedule($show_id) && ($source_connected || $sourcename == 'scheduled_play' || $current_status == 'on')) {
$change_status_to = 'on';
$change_status_to = "on";
if (strtolower($current_status) == "on") {
$change_status_to = "off";
if (strtolower($current_status) == 'on') {
$change_status_to = 'off';
}
$data = array("sourcename"=>$sourcename, "status"=>$change_status_to);
Application_Model_RabbitMq::SendMessageToPypo("switch_source", $data);
if (strtolower($current_status) == "on") {
Application_Model_Preference::SetSourceSwitchStatus($sourcename, "off");
$this->view->status = "OFF";
$data = ['sourcename' => $sourcename, 'status' => $change_status_to];
Application_Model_RabbitMq::SendMessageToPypo('switch_source', $data);
if (strtolower($current_status) == 'on') {
Application_Model_Preference::SetSourceSwitchStatus($sourcename, 'off');
$this->view->status = 'OFF';
//Log table updates
Application_Model_LiveLog::SetEndTime($sourcename == 'scheduled_play'?'S':'L',
new DateTime("now", new DateTimeZone('UTC')));
Application_Model_LiveLog::SetEndTime(
$sourcename == 'scheduled_play' ? 'S' : 'L',
new DateTime('now', new DateTimeZone('UTC'))
);
} else {
Application_Model_Preference::SetSourceSwitchStatus($sourcename, "on");
$this->view->status = "ON";
Application_Model_Preference::SetSourceSwitchStatus($sourcename, 'on');
$this->view->status = 'ON';
//Log table updates
Application_Model_LiveLog::SetNewLogTime($sourcename == 'scheduled_play'?'S':'L',
new DateTime("now", new DateTimeZone('UTC')));
Application_Model_LiveLog::SetNewLogTime(
$sourcename == 'scheduled_play' ? 'S' : 'L',
new DateTime('now', new DateTimeZone('UTC'))
);
}
} else {
if ($source_connected) {
@ -83,7 +86,7 @@ class DashboardController extends Zend_Controller_Action
if ($sourcename == 'scheduled_play') {
$this->view->error = _("You don't have permission to disconnect source.");
} else {
$this->view->error = _("There is no source connected to this input.");
$this->view->error = _('There is no source connected to this input.');
}
}
}
@ -95,11 +98,11 @@ class DashboardController extends Zend_Controller_Action
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headLink()->appendStylesheet($baseUrl.'js/jplayer/skin/jplayer.blue.monday.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl . 'js/jplayer/skin/jplayer.blue.monday.css?' . $CC_CONFIG['airtime_version']);
$this->_helper->layout->setLayout('livestream');
$logo = Application_Model_Preference::GetStationLogo();
$this->view->logo = "data:image/png;base64,".$logo;
$this->view->logo = 'data:image/png;base64,' . $logo;
}
public function helpAction()
@ -124,7 +127,6 @@ class DashboardController extends Zend_Controller_Action
$headScript = $this->view->headScript();
AirtimeTableView::injectTableJavaScriptDependencies($headScript, $baseUrl, $CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl.'js/airtime/widgets/table-example.js?'.$CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/widgets/table-example.js?' . $CC_CONFIG['airtime_version']);
}
}