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:
parent
3593a13064
commit
6528a9b0a3
13 changed files with 232 additions and 33 deletions
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
class EmbeddableWidgetsController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/player-form.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/player/player.js?'.$CC_CONFIG['airtime_version']);
|
||||
|
||||
$form = new Application_Form_Player();
|
||||
|
||||
$apiEnabled = Application_Model_Preference::GetAllow3rdPartyApi();
|
||||
$numEnabledStreams = $form->getElement('player_stream_url')->getAttrib('numberOfEnabledStreams');
|
||||
|
||||
if ($numEnabledStreams > 0 && $apiEnabled) {
|
||||
$this->view->player_form = $form;
|
||||
} else {
|
||||
$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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue