SAAS-843: Create Embeddable Schedule Widget View

Replaced player controller with embeddablewidgets controller.
Replaced 'Player' page with 'Widgets' page.
Added schedule widget to the widgets page.
This commit is contained in:
drigato 2015-06-04 12:00:23 -04:00
parent 3593a13064
commit 6528a9b0a3
13 changed files with 232 additions and 33 deletions

View file

@ -24,7 +24,6 @@ class EmbedController extends Zend_Controller_Action
$request = $this->getRequest();
$this->view->mrp_js = Application_Common_HTTPHelper::getStationUrl() . "js/airtime/player/mrp.js?".$CC_CONFIG['airtime_version'];
$this->view->jquery = Application_Common_HTTPHelper::getStationUrl() . "js/libs/jquery-1.10.2.js";
$this->view->muses_swf = Application_Common_HTTPHelper::getStationUrl() . "js/airtime/player/muses.swf";
@ -83,7 +82,14 @@ class EmbedController extends Zend_Controller_Action
$CC_CONFIG = Config::getConfig();
$this->view->css = Application_Common_HTTPHelper::getStationUrl() . "/css/radio-page/weekly-schedule-widget.css?".$CC_CONFIG['airtime_version'];
$request = $this->getRequest();
$widgetStyle = $request->getParam('style');
if ($widgetStyle == "premium") {
$this->view->css = Application_Common_HTTPHelper::getStationUrl() . "/css/embed/weekly-schedule-widget.css?" . $CC_CONFIG['airtime_version'];
} else {
$this->view->css = Application_Common_HTTPHelper::getStationUrl() . "/css/embed/weekly-schedule-widget-basic.css?" . $CC_CONFIG['airtime_version'];
}
$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"));

View file

@ -1,13 +1,14 @@
<?php
class PlayerController extends Zend_Controller_Action
class EmbeddableWidgetsController extends Zend_Controller_Action
{
public function init()
{
}
public function customizeAction()
public function indexAction()
{
$CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir();
@ -20,12 +21,17 @@ class PlayerController extends Zend_Controller_Action
$numEnabledStreams = $form->getElement('player_stream_url')->getAttrib('numberOfEnabledStreams');
if ($numEnabledStreams > 0 && $apiEnabled) {
$this->view->form = $form;
$this->view->player_form = $form;
} else {
$this->view->errorMsg = "To configure and use the embeddable player you must:<br><br>
$this->view->player_error_msg = "To configure and use the embeddable player you must:<br><br>
1. Enable at least one MP3, AAC, or OGG stream under System -> Streams<br>
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:<br><br>
1. Enable the Public Airtime API under System -> Preferences";
}
}
}

View file

@ -13,7 +13,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()->appendStylesheet($baseUrl.'css/radio-page/weekly-schedule-widget.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');