From 9e36dda855fc6fb520889268b8b61544726b5ec6 Mon Sep 17 00:00:00 2001 From: Mike Cox Date: Mon, 18 Feb 2019 12:19:41 +0000 Subject: [PATCH] Add new features to API on air call which shows the status of the two streams and whether they are switched to live output --- .../application/controllers/ApiController.php | 23 +++++++++++++++++++ .../scripts/embeddablewidgets/schedule.phtml | 4 ++-- .../views/scripts/index/index.phtml | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index bee424f85..492bdceab 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -185,6 +185,10 @@ class ApiController extends Zend_Controller_Action $result["on_air_light"] = false; $result["on_air_light_expected_status"] = false; $result["station_down"] = false; + $result["master_stream"] = false; + $result["live_stream"] = false; + $result["master_stream_on_air"] = false; + $result["live_stream_on_air"] = false; $range = Application_Model_Schedule::GetPlayOrderRange(); @@ -210,6 +214,25 @@ class ApiController extends Zend_Controller_Action $result["station_down"] = true; } + $live_dj_stream = Application_Model_Preference::GetSourceStatus("live_dj"); + $master_dj_stream = Application_Model_Preference::GetSourceStatus("master_dj"); + $live_dj_on_air = Application_Model_Preference::GetSourceSwitchStatus("live_dj"); + $master_dj_on_air = Application_Model_Preference::GetSourceSwitchStatus("master_dj"); + + if($live_dj_stream == true){ + $result["live_stream"] = true; + if ($live_dj_on_air == "on") { + $result["live_stream_on_air"] = true; + } + } + + if($master_dj_stream == true){ + $result["master_stream"] = true; + if ($master_dj_on_air == "on") { + $result["master_stream_on_air"] = true; + } + } + $this->returnJsonOrJsonp($request, $result); } diff --git a/airtime_mvc/application/views/scripts/embeddablewidgets/schedule.phtml b/airtime_mvc/application/views/scripts/embeddablewidgets/schedule.phtml index 94538187c..ffbfacb48 100644 --- a/airtime_mvc/application/views/scripts/embeddablewidgets/schedule.phtml +++ b/airtime_mvc/application/views/scripts/embeddablewidgets/schedule.phtml @@ -13,12 +13,12 @@
weekly_schedule_error_msg)) echo "style=display:none"; ?>>
- +
-

Copy this code and paste it into your website's HTML to embed the weekly schedule in your site. diff --git a/airtime_mvc/application/views/scripts/index/index.phtml b/airtime_mvc/application/views/scripts/index/index.phtml index 6ae9d4fb7..9420368f9 100644 --- a/airtime_mvc/application/views/scripts/index/index.phtml +++ b/airtime_mvc/application/views/scripts/index/index.phtml @@ -34,7 +34,7 @@

- +