SAAS-876 - better implementation of toggle between Airtime Pro/Custom streaming options

This commit is contained in:
Duncan Sommerville 2015-07-10 13:17:20 -04:00
parent 37ed35f5b2
commit c99165a8dd
3 changed files with 5 additions and 3 deletions

View File

@ -63,7 +63,7 @@ class Application_Form_StreamSetting extends Zend_Form
$custom = Application_Model_Preference::getUsingCustomStreamSettings(); $custom = Application_Model_Preference::getUsingCustomStreamSettings();
$customSettings = new Zend_Form_Element_Radio('customStreamSettings'); $customSettings = new Zend_Form_Element_Radio('customStreamSettings');
$customSettings->setLabel(_('Streaming Server:')); $customSettings->setLabel(_('Streaming Server:'));
$customSettings->setMultiOptions(array(_("Airtime Pro Streaming"), _("Custom / 3rd Party"))); $customSettings->setMultiOptions(array(_("Airtime Pro Streaming"), _("Custom / 3rd Party Streaming")));
$customSettings->setValue(!empty($custom) ? $custom : 0); $customSettings->setValue(!empty($custom) ? $custom : 0);
$this->addElement($customSettings); $this->addElement($customSettings);
} }

View File

@ -192,8 +192,10 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
{ {
$f_data = $data['s'.$this->prefix."_data"]; $f_data = $data['s'.$this->prefix."_data"];
$isValid = parent::isValid($f_data); $isValid = parent::isValid($f_data);
// XXX: A couple of ugly workarounds here, but I guess that's what you get when you
// combine an already-complex POST and GET into a single action...
if (Application_Model_Preference::getUsingCustomStreamSettings() && $f_data) { if (Application_Model_Preference::getUsingCustomStreamSettings() && $f_data) {
if ($f_data['enable'] == 1) { if ($f_data['enable'] == 1 && isset($f_data["host"])) {
if ($f_data['host'] == '') { if ($f_data['host'] == '') {
$element = $this->getElement("host"); $element = $this->getElement("host");
$element->addError(_("Server cannot be empty.")); $element->addError(_("Server cannot be empty."));

View File

@ -28,7 +28,7 @@ function rebuildStreamURL(ele){
}else{ }else{
streamurl = "http://"+host+":"+port+"/" streamurl = "http://"+host+":"+port+"/"
} }
div.find("#stream_url").text(streamurl) div.find("#stream_url").html('<a href="' + streamurl + '" target="_blank">' + streamurl + '</a>')
} }
function restrictOggBitrate(ele, on){ function restrictOggBitrate(ele, on){
var div = ele.closest("div") var div = ele.closest("div")