Format code using php-cs-fixer
This commit is contained in:
parent
43d7dc92cd
commit
d52c6184b9
352 changed files with 17473 additions and 17041 deletions
|
@ -1,48 +1,48 @@
|
|||
<?php
|
||||
|
||||
define("OPUS", "opus");
|
||||
define('OPUS', 'opus');
|
||||
|
||||
class Application_Form_Player extends Zend_Form_SubForm
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/player.phtml'))
|
||||
));
|
||||
$this->setDecorators([
|
||||
['ViewScript', ['viewScript' => 'form/player.phtml']],
|
||||
]);
|
||||
|
||||
$title = new Zend_Form_Element_Text('player_title');
|
||||
$title->setValue(_('Now Playing'));
|
||||
$title->setLabel(_('Title:'));
|
||||
$title->setDecorators(array(
|
||||
$title->setDecorators([
|
||||
'ViewHelper',
|
||||
'Errors',
|
||||
'Label'
|
||||
));
|
||||
$title->addDecorator('Label', array('class' => 'player-title'));
|
||||
'Label',
|
||||
]);
|
||||
$title->addDecorator('Label', ['class' => 'player-title']);
|
||||
$this->addElement($title);
|
||||
|
||||
$streamMode = new Zend_Form_Element_Radio('player_stream_mode');
|
||||
$streamMode->setLabel(_('Select Stream:'));
|
||||
$streamMode->setMultiOptions(
|
||||
array(
|
||||
"auto" => _("Auto detect the most appropriate stream to use."),
|
||||
"manual" => _("Select a stream:")
|
||||
)
|
||||
[
|
||||
'auto' => _('Auto detect the most appropriate stream to use.'),
|
||||
'manual' => _('Select a stream:'),
|
||||
]
|
||||
);
|
||||
$streamMode->setValue("auto");
|
||||
$streamMode->setValue('auto');
|
||||
$this->addElement($streamMode);
|
||||
|
||||
$streamURL = new Zend_Form_Element_Radio('player_stream_url');
|
||||
$opusStreamCount = 0;
|
||||
$urlOptions = Array();
|
||||
foreach(Application_Model_StreamSetting::getEnabledStreamData() as $stream => $data) {
|
||||
$urlOptions[$stream] = strtoupper($data["codec"])." - ".$data["bitrate"]."kbps";
|
||||
if ($data["mobile"]) {
|
||||
$urlOptions[$stream] .= _(" - Mobile friendly");
|
||||
$urlOptions = [];
|
||||
foreach (Application_Model_StreamSetting::getEnabledStreamData() as $stream => $data) {
|
||||
$urlOptions[$stream] = strtoupper($data['codec']) . ' - ' . $data['bitrate'] . 'kbps';
|
||||
if ($data['mobile']) {
|
||||
$urlOptions[$stream] .= _(' - Mobile friendly');
|
||||
}
|
||||
if ($data["codec"] == OPUS) {
|
||||
$opusStreamCount += 1;
|
||||
$urlOptions[$stream] .= _(" - The player does not support Opus streams.");
|
||||
if ($data['codec'] == OPUS) {
|
||||
++$opusStreamCount;
|
||||
$urlOptions[$stream] .= _(' - The player does not support Opus streams.');
|
||||
}
|
||||
}
|
||||
$streamURL->setMultiOptions(
|
||||
|
@ -53,35 +53,35 @@ class Application_Form_Player extends Zend_Form_SubForm
|
|||
foreach ($urlOptions as $o => $v) {
|
||||
if (strpos(strtolower($v), OPUS) !== false) {
|
||||
continue;
|
||||
} else {
|
||||
$streamURL->setValue($o);
|
||||
break;
|
||||
}
|
||||
$streamURL->setValue($o);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$streamURL->setAttrib('numberOfEnabledStreams', sizeof($urlOptions)-$opusStreamCount);
|
||||
$streamURL->setAttrib('numberOfEnabledStreams', sizeof($urlOptions) - $opusStreamCount);
|
||||
$streamURL->removeDecorator('label');
|
||||
$this->addElement($streamURL);
|
||||
|
||||
$embedSrc = new Zend_Form_Element_Textarea('player_embed_src');
|
||||
$embedSrc->setAttrib("readonly", "readonly");
|
||||
$embedSrc->setAttrib("class", "embed-player-text-box");
|
||||
$embedSrc->setAttrib('readonly', 'readonly');
|
||||
$embedSrc->setAttrib('class', 'embed-player-text-box');
|
||||
$embedSrc->setAttrib('cols', '40')
|
||||
->setAttrib('rows', '4');
|
||||
$embedSrc->setLabel(_("Embeddable code:"));
|
||||
->setAttrib('rows', '4')
|
||||
;
|
||||
$embedSrc->setLabel(_('Embeddable code:'));
|
||||
$embedSrc->setDescription(_("Copy this code and paste it into your website's HTML to embed the player in your site."));
|
||||
$embedSrc->setValue('<iframe frameborder="0" width="280" height="216" src="'.Application_Common_HTTPHelper::getStationUrl().'embed/player?stream=auto&title=Now Playing"></iframe>');
|
||||
$embedSrc->setValue('<iframe frameborder="0" width="280" height="216" src="' . Application_Common_HTTPHelper::getStationUrl() . 'embed/player?stream=auto&title=Now Playing"></iframe>');
|
||||
$this->addElement($embedSrc);
|
||||
|
||||
$previewLabel = new Zend_Form_Element_Text('player_preview_label');
|
||||
$previewLabel->setLabel(_("Preview:"));
|
||||
$previewLabel->setDecorators(array(
|
||||
$previewLabel->setLabel(_('Preview:'));
|
||||
$previewLabel->setDecorators([
|
||||
'ViewHelper',
|
||||
'Errors',
|
||||
'Label'
|
||||
));
|
||||
$previewLabel->addDecorator('Label', array('class' => 'preview-label'));
|
||||
'Label',
|
||||
]);
|
||||
$previewLabel->addDecorator('Label', ['class' => 'preview-label']);
|
||||
$this->addElement($previewLabel);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue