SAAS-712: UI Improvements
This commit is contained in:
parent
f6d5b34cca
commit
23bf866211
|
@ -38,7 +38,7 @@ $ccAcl->add(new Zend_Acl_Resource('library'))
|
||||||
->add(new Zend_Acl_Resource('billing'))
|
->add(new Zend_Acl_Resource('billing'))
|
||||||
->add(new Zend_Acl_Resource('thank-you'))
|
->add(new Zend_Acl_Resource('thank-you'))
|
||||||
->add(new Zend_Acl_Resource('provisioning'))
|
->add(new Zend_Acl_Resource('provisioning'))
|
||||||
->add(new Zend_Acl_Resource('embeddableplayer'));
|
->add(new Zend_Acl_Resource('player'));
|
||||||
|
|
||||||
/** Creating permissions */
|
/** Creating permissions */
|
||||||
$ccAcl->allow('G', 'index')
|
$ccAcl->allow('G', 'index')
|
||||||
|
@ -71,7 +71,7 @@ $ccAcl->allow('G', 'index')
|
||||||
->allow('A', 'user')
|
->allow('A', 'user')
|
||||||
->allow('A', 'systemstatus')
|
->allow('A', 'systemstatus')
|
||||||
->allow('A', 'preference')
|
->allow('A', 'preference')
|
||||||
->allow('A', 'embeddableplayer')
|
->allow('A', 'player')
|
||||||
->allow('S', 'thank-you')
|
->allow('S', 'thank-you')
|
||||||
->allow('S', 'billing');
|
->allow('S', 'billing');
|
||||||
|
|
||||||
|
|
|
@ -87,11 +87,10 @@ $pages = array(
|
||||||
'resource' => 'listenerstat'
|
'resource' => 'listenerstat'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'label' => _('Embeddable Player'),
|
'label' => _('Player'),
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'embeddableplayer',
|
'controller' => 'player',
|
||||||
'action' => 'index',
|
'action' => 'customize'
|
||||||
'resource' => 'embeddableplayer'
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,21 +1,20 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class EmbeddablePlayerController extends Zend_Controller_Action
|
class PlayerController extends Zend_Controller_Action
|
||||||
{
|
{
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function indexAction()
|
public function customizeAction()
|
||||||
{
|
{
|
||||||
$CC_CONFIG = Config::getConfig();
|
$CC_CONFIG = Config::getConfig();
|
||||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/embeddable-player-form.css?'.$CC_CONFIG['airtime_version']);
|
$this->view->headLink()->appendStylesheet($baseUrl.'css/player-form.css?'.$CC_CONFIG['airtime_version']);
|
||||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/embeddableplayer/mrp.js?'.$CC_CONFIG['airtime_version']);
|
$this->view->headScript()->appendFile($baseUrl.'js/airtime/player/player.js?'.$CC_CONFIG['airtime_version']);
|
||||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/embeddableplayer/embeddableplayer.js?'.$CC_CONFIG['airtime_version']);
|
|
||||||
|
|
||||||
$form = new Application_Form_EmbeddablePlayer();
|
$form = new Application_Form_Player();
|
||||||
|
|
||||||
$apiEnabled = Application_Model_Preference::GetAllow3rdPartyApi();
|
$apiEnabled = Application_Model_Preference::GetAllow3rdPartyApi();
|
||||||
$numEnabledStreams = $form->getElement('player_stream_url')->getAttrib('numberOfEnabledStreams');
|
$numEnabledStreams = $form->getElement('player_stream_url')->getAttrib('numberOfEnabledStreams');
|
||||||
|
@ -38,18 +37,19 @@ class EmbeddablePlayerController extends Zend_Controller_Action
|
||||||
* The view for this action contains all the inline javascript needed to
|
* The view for this action contains all the inline javascript needed to
|
||||||
* create the player.
|
* create the player.
|
||||||
*/
|
*/
|
||||||
public function embedCodeAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$this->view->layout()->disableLayout();
|
$this->view->layout()->disableLayout();
|
||||||
|
|
||||||
$CC_CONFIG = Config::getConfig();
|
$CC_CONFIG = Config::getConfig();
|
||||||
|
|
||||||
|
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
|
|
||||||
$this->view->css = Application_Common_HTTPHelper::getStationUrl() . "css/embeddable-player.css?".$CC_CONFIG['airtime_version'];
|
$this->view->css = Application_Common_HTTPHelper::getStationUrl() . "css/player.css?".$CC_CONFIG['airtime_version'];
|
||||||
$this->view->mrp_js = Application_Common_HTTPHelper::getStationUrl() . "js/airtime/embeddableplayer/mrp.js?".$CC_CONFIG['airtime_version'];
|
$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->jquery = Application_Common_HTTPHelper::getStationUrl() . "js/libs/jquery-1.10.2.js";
|
||||||
$this->view->muses_swf = Application_Common_HTTPHelper::getStationUrl() . "js/airtime/embeddableplayer/muses.swf";
|
$this->view->muses_swf = Application_Common_HTTPHelper::getStationUrl() . "js/airtime/player/muses.swf";
|
||||||
$this->view->metadata_api_url = Application_Common_HTTPHelper::getStationUrl() . "api/live-info";
|
$this->view->metadata_api_url = Application_Common_HTTPHelper::getStationUrl() . "api/live-info";
|
||||||
$this->view->station_name = addslashes(Application_Model_Preference::GetStationName());
|
$this->view->station_name = addslashes(Application_Model_Preference::GetStationName());
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
|
|
||||||
define("OPUS", "opus");
|
define("OPUS", "opus");
|
||||||
|
|
||||||
class Application_Form_EmbeddablePlayer extends Zend_Form_SubForm
|
class Application_Form_Player extends Zend_Form_SubForm
|
||||||
{
|
{
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$this->setDecorators(array(
|
$this->setDecorators(array(
|
||||||
array('ViewScript', array('viewScript' => 'form/embeddableplayer.phtml'))
|
array('ViewScript', array('viewScript' => 'form/player.phtml'))
|
||||||
));
|
));
|
||||||
|
|
||||||
/* We will use this option in the future
|
/* We will use this option in the future
|
||||||
|
@ -56,14 +56,14 @@ class Application_Form_EmbeddablePlayer extends Zend_Form_SubForm
|
||||||
}
|
}
|
||||||
|
|
||||||
$streamURL->setAttrib('numberOfEnabledStreams', sizeof($urlOptions)-$opusStreamCount);
|
$streamURL->setAttrib('numberOfEnabledStreams', sizeof($urlOptions)-$opusStreamCount);
|
||||||
$streamURL->setAttrib("disabled", "disabled");
|
$streamURL->removeDecorator('label');
|
||||||
$this->addElement($streamURL);
|
$this->addElement($streamURL);
|
||||||
|
|
||||||
$embedSrc = new Zend_Form_Element_Text('player_embed_src');
|
$embedSrc = new Zend_Form_Element_Text('player_embed_src');
|
||||||
$embedSrc->setAttrib("readonly", "readonly");
|
$embedSrc->setAttrib("readonly", "readonly");
|
||||||
$embedSrc->setAttrib("class", "embed-player-text-box");
|
$embedSrc->setAttrib("class", "embed-player-text-box");
|
||||||
$embedSrc->setValue('<iframe frameborder="0" width="280" height="230" src="'.Application_Common_HTTPHelper::getStationUrl().'embeddableplayer/embed-code?stream=auto"></iframe>');
|
$embedSrc->setLabel(_("Embeddable code:"));
|
||||||
$embedSrc->removeDecorator('label');
|
$embedSrc->setValue('<iframe frameborder="0" width="280" height="210" src="'.Application_Common_HTTPHelper::getStationUrl().'player?stream=auto"></iframe>');
|
||||||
$this->addElement($embedSrc);
|
$this->addElement($embedSrc);
|
||||||
|
|
||||||
$previewLabel = new Zend_Form_Element_Text('player_preview_label');
|
$previewLabel = new Zend_Form_Element_Text('player_preview_label');
|
|
@ -1,18 +1,27 @@
|
||||||
<fieldset class="padded">
|
<fieldset class="padded">
|
||||||
<dl class="zend_form">
|
<dl class="zend_form">
|
||||||
|
|
||||||
<?php echo $this->element->getElement('player_embed_src'); ?>
|
|
||||||
|
|
||||||
<?php echo $this->element->getElement('player_stream_mode'); ?>
|
|
||||||
|
|
||||||
<?php echo $this->element->getElement('player_stream_url'); ?>
|
|
||||||
|
|
||||||
<?php //echo $this->element->getElement('player_display_track_metadata'); ?>
|
|
||||||
|
|
||||||
<?php echo $this->element->getElement('player_preview_label')->renderLabel(); ?>
|
<?php echo $this->element->getElement('player_preview_label')->renderLabel(); ?>
|
||||||
|
|
||||||
<div style="clear:both"></div>
|
<div style="clear:both"></div>
|
||||||
<?php echo $this->element->getElement('player_embed_src')->getValue(); ?>
|
<div class="player-preview">
|
||||||
|
<?php echo $this->element->getElement('player_embed_src')->getValue(); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="player_instructions">
|
||||||
|
Customize the player by configuring the options below. Once you are happy with the player
|
||||||
|
copy the embeddable code below into your websites HTML.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php echo $this->element->getElement('player_stream_mode')->render(); ?>
|
||||||
|
|
||||||
|
<?php echo $this->element->getElement('player_stream_url'); ?>
|
||||||
|
|
||||||
|
<?php echo $this->element->getElement('player_embed_src')->render(); ?>
|
||||||
|
|
||||||
|
<?php //echo $this->element->getElement('player_display_track_metadata'); ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
|
@ -1,9 +1,9 @@
|
||||||
<div class="ui-widget ui-widget-content block-shadow simple-formblock embed-player-form clearfix padded-strong ">
|
<div class="ui-widget ui-widget-content block-shadow simple-formblock embed-player-form clearfix padded-strong ">
|
||||||
<h2 style="float:left"><?php echo _("Embeddable Player") ?></h2>
|
|
||||||
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
|
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
|
||||||
|
|
||||||
<form method="post" id="player_form" enctype="multipart/form-data">
|
<form method="post" id="player_form" enctype="multipart/form-data">
|
||||||
|
<h2 style="float:left"><?php echo _("Embeddable Player") ?></h2>
|
||||||
<div style="clear:both"></div>
|
<div style="clear:both"></div>
|
||||||
<?php echo $this->errorMsg; ?>
|
<?php echo $this->errorMsg; ?>
|
||||||
<?php echo $this->form; ?>
|
<?php echo $this->form; ?>
|
|
@ -1,16 +0,0 @@
|
||||||
.embed-player-text-box {
|
|
||||||
padding-right: 0px !important;
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
.embed-player-form {
|
|
||||||
width: 70%;
|
|
||||||
}
|
|
||||||
.embed-player-form dd {
|
|
||||||
width: 100% !important;
|
|
||||||
float: left;
|
|
||||||
margin: 0;
|
|
||||||
padding: 4px 0px 4px 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
.embed-player-text-box {
|
||||||
|
padding-right: 0px !important;
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
.embed-player-form {
|
||||||
|
width: 98%;
|
||||||
|
}
|
||||||
|
.embed-player-form dd {
|
||||||
|
width: 100% !important;
|
||||||
|
float: left;
|
||||||
|
margin: 0;
|
||||||
|
padding: 4px 0px 4px 0px;
|
||||||
|
}
|
||||||
|
.player-preview {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.player-preview iframe {
|
||||||
|
margin: 0 auto;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
#player_form {
|
||||||
|
width: 50%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
#player_instructions {
|
||||||
|
border-bottom: 1px solid;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #5b5b5b;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,12 +29,16 @@ function getStreamMode() {
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
$("#player_stream_url-element").hide();
|
||||||
|
|
||||||
$("#player_stream_mode-element").change(function() {
|
$("#player_stream_mode-element").change(function() {
|
||||||
var $streamMode = getStreamMode();
|
var $streamMode = getStreamMode();
|
||||||
|
|
||||||
if ($streamMode == "auto") {
|
if ($streamMode == "auto") {
|
||||||
$("#player_stream_url-element input[type='radio']").attr("disabled", "disabled");
|
$("#player_stream_url-element").hide();
|
||||||
|
|
||||||
} else if ($streamMode == "manual") {
|
} else if ($streamMode == "manual") {
|
||||||
$("#player_stream_url-element input[type='radio']").removeAttr("disabled");
|
$("#player_stream_url-element").show();
|
||||||
|
|
||||||
$("input[name=player_stream_url]").each(function(i, obj) {
|
$("input[name=player_stream_url]").each(function(i, obj) {
|
||||||
if ($(this).parent().text().toLowerCase().indexOf("opus") >= 0) {
|
if ($(this).parent().text().toLowerCase().indexOf("opus") >= 0) {
|
Loading…
Reference in New Issue