diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 4069fbbfe..dfcb2534d 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -209,6 +209,43 @@ class ApiController extends Zend_Controller_Action } } + public function onAirLightAction() + { + $this->view->layout()->disableLayout(); + $this->_helper->viewRenderer->setNoRender(true); + + $result = array(); + $result["on_air_light"] = false; + $result["on_air_light_expected_status"] = false; + $result["station_down"] = false; + + $range = Application_Model_Schedule::GetPlayOrderRange(); + + $isItemCurrentlyScheduled = !is_null($range["current"]) && count($range["currentShow"]) > 0 ? true : false; + + $isCurrentItemPlaying = $range["current"]["media_item_played"] ? true : false; + + if ($isItemCurrentlyScheduled || + Application_Model_Preference::GetSourceSwitchStatus("live_dj") == "on" || + Application_Model_Preference::GetSourceSwitchStatus("master_dj") == "on") + { + $result["on_air_light_expected_status"] = true; + } + + if (($isItemCurrentlyScheduled && $isCurrentItemPlaying) || + Application_Model_Preference::GetSourceSwitchStatus("live_dj") == "on" || + Application_Model_Preference::GetSourceSwitchStatus("master_dj") == "on") + { + $result["on_air_light"] = true; + } + + if ($result["on_air_light_expected_status"] != $result["on_air_light"]) { + $result["station_down"] = true; + } + + echo isset($_GET['callback']) ? $_GET['callback'].'('.json_encode($result).')' : json_encode($result); + } + /** * Retrieve the currently playing show as well as upcoming shows. * Number of shows returned and the time interval in which to diff --git a/airtime_mvc/public/js/fullcalendar/AIRTIME_DEV_README b/airtime_mvc/public/js/fullcalendar/AIRTIME_DEV_README index ffa4294a0..5b10a3157 100644 --- a/airtime_mvc/public/js/fullcalendar/AIRTIME_DEV_README +++ b/airtime_mvc/public/js/fullcalendar/AIRTIME_DEV_README @@ -3,14 +3,14 @@ in this file. Running a diff between the original fullcalendar.js and our modified one: -martin@Thinkpad-T410:~/workspace/airtime/airtime_mvc/public/js/fullcalendar$ diff -u fullcalendar_orig.js fullcalendar.js ---- fullcalendar_orig.js 2011-04-09 17:13:15.000000000 -0400 -+++ fullcalendar.js 2011-11-18 17:03:57.000000000 -0500 +denise@denise-desktop:~/airtime/airtime_mvc/public/js/fullcalendar$ diff -u fullcalendar_orig.js fullcalendar.js +--- fullcalendar_orig.js 2013-05-24 08:33:54.462735215 -0400 ++++ fullcalendar.js 2013-07-19 12:42:37.274284180 -0400 @@ -1,6 +1,6 @@ /** * @preserve -- * FullCalendar v1.5.1 -+ * FullCalendar v1.5.1-CUSTOM (Changes by Martin Konecny -added primitive support for timezones) +- * FullCalendar v1.5.3 ++ * FullCalendar v1.5.3-CUSTOM (Changes by Martin Konecny -added primitive support for timezones) * http://arshaw.com/fullcalendar/ * * Use fullcalendar.css for basic styling. @@ -23,7 +23,7 @@ martin@Thinkpad-T410:~/workspace/airtime/airtime_mvc/public/js/fullcalendar$ dif var events = []; var _dragElement; -@@ -2275,7 +2275,7 @@ +@@ -2277,7 +2277,7 @@ function updateCells(firstTime) { var dowDirty = firstTime || rowCnt == 1; // could the cells' day-of-weeks need updating? var month = t.start.getMonth(); @@ -32,7 +32,7 @@ martin@Thinkpad-T410:~/workspace/airtime/airtime_mvc/public/js/fullcalendar$ dif var cell; var date; var row; -@@ -3108,7 +3108,7 @@ +@@ -3110,7 +3110,7 @@ var headCell; var bodyCell; var date; @@ -41,9 +41,16 @@ martin@Thinkpad-T410:~/workspace/airtime/airtime_mvc/public/js/fullcalendar$ dif for (i=0; i