From c99165a8dd76518b3ad4f64c72b64079cf83b4d0 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Fri, 10 Jul 2015 13:17:20 -0400 Subject: [PATCH] SAAS-876 - better implementation of toggle between Airtime Pro/Custom streaming options --- airtime_mvc/application/forms/StreamSetting.php | 2 +- airtime_mvc/application/forms/StreamSettingSubForm.php | 4 +++- airtime_mvc/public/js/airtime/preferences/streamsetting.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/forms/StreamSetting.php b/airtime_mvc/application/forms/StreamSetting.php index bbef95ca3..d7e785d18 100644 --- a/airtime_mvc/application/forms/StreamSetting.php +++ b/airtime_mvc/application/forms/StreamSetting.php @@ -63,7 +63,7 @@ class Application_Form_StreamSetting extends Zend_Form $custom = Application_Model_Preference::getUsingCustomStreamSettings(); $customSettings = new Zend_Form_Element_Radio('customStreamSettings'); $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); $this->addElement($customSettings); } diff --git a/airtime_mvc/application/forms/StreamSettingSubForm.php b/airtime_mvc/application/forms/StreamSettingSubForm.php index fe6c95d89..55ed201e8 100644 --- a/airtime_mvc/application/forms/StreamSettingSubForm.php +++ b/airtime_mvc/application/forms/StreamSettingSubForm.php @@ -192,8 +192,10 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm { $f_data = $data['s'.$this->prefix."_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 ($f_data['enable'] == 1) { + if ($f_data['enable'] == 1 && isset($f_data["host"])) { if ($f_data['host'] == '') { $element = $this->getElement("host"); $element->addError(_("Server cannot be empty.")); diff --git a/airtime_mvc/public/js/airtime/preferences/streamsetting.js b/airtime_mvc/public/js/airtime/preferences/streamsetting.js index 8c4cc9c14..2a18a4aaa 100644 --- a/airtime_mvc/public/js/airtime/preferences/streamsetting.js +++ b/airtime_mvc/public/js/airtime/preferences/streamsetting.js @@ -28,7 +28,7 @@ function rebuildStreamURL(ele){ }else{ streamurl = "http://"+host+":"+port+"/" } - div.find("#stream_url").text(streamurl) + div.find("#stream_url").html('' + streamurl + '') } function restrictOggBitrate(ele, on){ var div = ele.closest("div")