diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php index e72092f8f..49bbc9030 100644 --- a/airtime_mvc/application/Bootstrap.php +++ b/airtime_mvc/application/Bootstrap.php @@ -133,11 +133,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap $view->headLink()->appendStylesheet($baseUrl . 'css/redmond/jquery-ui-1.8.8.custom.css?' . $CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl . 'css/pro_dropdown_3.css?' . $CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl . 'css/qtip/jquery.qtip.min.css?' . $CC_CONFIG['airtime_version']); - - // Don't include style.css on the Radio Page because there are conflicting styles. - if ($_SERVER['REQUEST_URI'] != "/") { - $view->headLink()->appendStylesheet($baseUrl . 'css/styles.css?' . $CC_CONFIG['airtime_version']); - } + $view->headLink()->appendStylesheet($baseUrl . 'css/styles.css?' . $CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl . 'css/masterpanel.css?' . $CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl . 'css/tipsy/jquery.tipsy.css?' . $CC_CONFIG['airtime_version']); } diff --git a/airtime_mvc/application/common/WidgetHelper.php b/airtime_mvc/application/common/WidgetHelper.php index 38a673cfa..d49be8648 100644 --- a/airtime_mvc/application/common/WidgetHelper.php +++ b/airtime_mvc/application/common/WidgetHelper.php @@ -1,5 +1,7 @@ format("Y-m-d H:i:s"); $weekCounter = 0; while ($weekCounter < $maxNumOFWeeks) { - for ($i = 0; $i < 7; $i++) { + for ($dayOfWeekCounter = 0; $dayOfWeekCounter < DAYS_PER_WEEK; $dayOfWeekCounter++) { $dateParse = date_parse($weekStartDateTime->format("Y-m-d H:i:s")); + + $result[$weekCounter][$dayOfWeekCounter]["dayOfMonth"] = $dateParse["day"]; + $result[$weekCounter][$dayOfWeekCounter]["dayOfWeek"] = strtoupper(date("D", $weekStartDateTime->getTimestamp())); + //have to be in station timezone when adding 1 day for daylight savings. $weekStartDateTime->setTimezone(new DateTimeZone($timezone)); $weekStartDateTime->add(new DateInterval('P1D')); @@ -108,14 +113,13 @@ class WidgetHelper $endParseDate = date_parse($show['ends']); $show["show_end_hour"] = str_pad($endParseDate["hour"], 2, 0, STR_PAD_LEFT).":".str_pad($endParseDate["minute"],2, 0, STR_PAD_LEFT); } - $result[$weekCounter][$dow[$i]]["dayOfMonth"] = $dateParse["day"]; - $result[$weekCounter][$dow[$i]]["dayOfWeek"] = strtoupper(substr($dow[$i], 0, 3)); - $result[$weekCounter][$dow[$i]]["shows"] = $shows; + $result[$weekCounter][$dayOfWeekCounter]["shows"] = $shows; // XSS exploit prevention self::convertSpecialChars($result, array("name", "url")); // convert image paths to point to api endpoints self::findAndConvertPaths($result); + } $weekCounter += 1; } diff --git a/airtime_mvc/application/controllers/EmbedController.php b/airtime_mvc/application/controllers/EmbedController.php index 13a5b31f5..c160ad9e2 100644 --- a/airtime_mvc/application/controllers/EmbedController.php +++ b/airtime_mvc/application/controllers/EmbedController.php @@ -94,9 +94,10 @@ class EmbedController extends Zend_Controller_Action } $this->view->jquery = Application_Common_HTTPHelper::getStationUrl() . "widgets/js/jquery-1.6.1.min.js?".$CC_CONFIG['airtime_version']; - $result = WidgetHelper::getWeekInfoV2($this->getRequest()->getParam("timezone")); - $this->view->scheduleDataWeek1 = $result[0]; - $this->view->scheduleDataWeek2 = $result[1]; + $weeklyScheduleData = WidgetHelper::getWeekInfoV2($this->getRequest()->getParam("timezone")); + + // Return only the current week's schedule data. In the future we may use the next week's data. + $this->view->weeklyScheduleData = $weeklyScheduleData[0]; $currentDay = new DateTime("now", new DateTimeZone(Application_Model_Preference::GetTimezone())); //day of the month without leading zeros (1 to 31) diff --git a/airtime_mvc/application/controllers/EmbeddablewidgetsController.php b/airtime_mvc/application/controllers/EmbeddablewidgetsController.php index 93a143ef7..3d3285d0a 100644 --- a/airtime_mvc/application/controllers/EmbeddablewidgetsController.php +++ b/airtime_mvc/application/controllers/EmbeddablewidgetsController.php @@ -23,14 +23,14 @@ class EmbeddableWidgetsController extends Zend_Controller_Action if ($numEnabledStreams > 0 && $apiEnabled) { $this->view->player_form = $form; } else { - $this->view->player_error_msg = "To configure and use the embeddable player you must:

+ $this->view->player_error_msg = _("To configure and use the embeddable player you must:

1. Enable at least one MP3, AAC, or OGG stream under System -> Streams
- 2. Enable the Public Airtime API under System -> Preferences"; + 2. Enable the Public Airtime API under System -> Preferences"); } if (!$apiEnabled) { - $this->view->weekly_schedule_error_msg = "To use the embeddable weekly schedule you must:

- 1. Enable the Public Airtime API under System -> Preferences"; + $this->view->weekly_schedule_error_msg = _("To use the embeddable weekly schedule you must:

+ 1. Enable the Public Airtime API under System -> Preferences"); } } } diff --git a/airtime_mvc/application/controllers/IndexController.php b/airtime_mvc/application/controllers/IndexController.php index bee3eb8fb..5f3d03ecb 100644 --- a/airtime_mvc/application/controllers/IndexController.php +++ b/airtime_mvc/application/controllers/IndexController.php @@ -12,7 +12,7 @@ class IndexController extends Zend_Controller_Action { $CC_CONFIG = Config::getConfig(); $baseUrl = Application_Common_OsPath::getBaseDir(); - $this->view->headLink()->appendStylesheet($baseUrl.'css/radio-page/radio-page.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->setStylesheet($baseUrl.'css/radio-page/radio-page.css?'.$CC_CONFIG['airtime_version']); $this->view->headLink()->appendStylesheet($baseUrl.'css/embed/weekly-schedule-widget.css?'.$CC_CONFIG['airtime_version']); $this->_helper->layout->setLayout('radio-page'); diff --git a/airtime_mvc/application/views/scripts/embed/weekly-program.phtml b/airtime_mvc/application/views/scripts/embed/weekly-program.phtml index ed72e5926..1ec3e1f1c 100644 --- a/airtime_mvc/application/views/scripts/embed/weekly-program.phtml +++ b/airtime_mvc/application/views/scripts/embed/weekly-program.phtml @@ -27,7 +27,7 @@