minor code clean-up
This commit is contained in:
parent
1a9daa52dd
commit
9fe31a5923
|
@ -264,6 +264,7 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
|
|
||||||
// pulling this from the 2.5.x branch
|
// pulling this from the 2.5.x branch
|
||||||
if (!Application_Model_Preference::GetMasterDjConnectionUrlOverride()) {
|
if (!Application_Model_Preference::GetMasterDjConnectionUrlOverride()) {
|
||||||
|
$master_connection_url = "http://".$_SERVER['SERVER_NAME'].":".$values["master_source_port"].$values["master_source_mount"];
|
||||||
if (empty($values["master_source_port"]) || empty($values["master_source_port"])) {
|
if (empty($values["master_source_port"]) || empty($values["master_source_port"])) {
|
||||||
Application_Model_Preference::SetMasterDJSourceConnectionURL('N/A');
|
Application_Model_Preference::SetMasterDJSourceConnectionURL('N/A');
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -69,17 +69,21 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
||||||
->setValue(Application_Model_Preference::GetMasterDJSourceConnectionURL());
|
->setValue(Application_Model_Preference::GetMasterDJSourceConnectionURL());
|
||||||
$this->addElement($masterSourceHost);
|
$this->addElement($masterSourceHost);
|
||||||
|
|
||||||
|
|
||||||
//liquidsoap harbor.input port
|
//liquidsoap harbor.input port
|
||||||
$betweenValidator = Application_Form_Helper_ValidationTypes::overrideBetweenValidator(1024, 49151);
|
$betweenValidator = Application_Form_Helper_ValidationTypes::overrideBetweenValidator(1024, 49151);
|
||||||
|
|
||||||
$m_port = Application_Model_StreamSetting::getMasterLiveStreamPort();
|
$m_port = Application_Model_StreamSetting::getMasterLiveStreamPort();
|
||||||
|
|
||||||
$masterSourcePort = new Zend_Form_Element_Text('master_source_port');
|
$masterSourcePort = new Zend_Form_Element_Text('master_source_port');
|
||||||
$masterSourcePort->setLabel(_('Master Source Port:'))
|
$masterSourcePort->setLabel(_('Master Source Port:'))
|
||||||
->setValue($m_port)
|
->setValue($m_port)
|
||||||
->setValidators(array($betweenValidator))
|
|
||||||
->addValidator('regex', false, array('pattern'=>'/^[0-9]+$/', 'messages'=>array('regexNotMatch'=>_('Only numbers are allowed.'))));
|
->addValidator('regex', false, array('pattern'=>'/^[0-9]+$/', 'messages'=>array('regexNotMatch'=>_('Only numbers are allowed.'))));
|
||||||
|
|
||||||
$this->addElement($masterSourcePort);
|
$this->addElement($masterSourcePort);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$m_mount = Application_Model_StreamSetting::getMasterLiveStreamMountPoint();
|
$m_mount = Application_Model_StreamSetting::getMasterLiveStreamMountPoint();
|
||||||
$masterSourceMount = new Zend_Form_Element_Text('master_source_mount');
|
$masterSourceMount = new Zend_Form_Element_Text('master_source_mount');
|
||||||
$masterSourceMount->setLabel(_('Master Source Mount:'))
|
$masterSourceMount->setLabel(_('Master Source Mount:'))
|
||||||
|
@ -114,16 +118,6 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
array('regex', false, array('/^[^ &<>]+$/', 'messages' => _('Invalid character entered')))));
|
array('regex', false, array('/^[^ &<>]+$/', 'messages' => _('Invalid character entered')))));
|
||||||
$this->addElement($showSourceMount);
|
$this->addElement($showSourceMount);
|
||||||
|
|
||||||
// demo only code
|
|
||||||
if ($isDemo) {
|
|
||||||
$elements = $this->getElements();
|
|
||||||
foreach ($elements as $element) {
|
|
||||||
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
|
||||||
$element->setAttrib("disabled", "disabled");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateVariables()
|
public function updateVariables()
|
||||||
|
@ -139,12 +133,12 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
||||||
array('ViewScript',
|
array('ViewScript',
|
||||||
array(
|
array(
|
||||||
'viewScript' => 'form/preferences_livestream.phtml',
|
'viewScript' => 'form/preferences_livestream.phtml',
|
||||||
'master_source_host' => isset($masterSourceHost)?$masterSourceParams["host"]:"",
|
'master_source_host' => isset($masterSourceHost) ? Application_Model_Preference::GetMasterDJSourceConnectionURL() : "",
|
||||||
'master_source_port' => isset($masterSourcePort)?$masterSourceParams["port"]:"",
|
'master_source_port' => isset($masterSourcePort) ? Application_Model_StreamSetting::getMasterLiveStreamPort() : "",
|
||||||
'master_source_mount' => isset($masterSourceMount)?$masterSourceParams["path"]:"",
|
'master_source_mount' => isset($masterSourceMount) ? Application_Model_StreamSetting::getMasterLiveStreamMountPoint() : "",
|
||||||
'show_source_host' => isset($showSourceHost)?$showSourceParams["host"]:"",
|
'show_source_host' => isset($showSourceHost) ? Application_Model_Preference::GetLiveDJSourceConnectionURL() : "",
|
||||||
'show_source_port' => isset($showSourcePort)?$showSourceParams["port"]:"",
|
'show_source_port' => isset($showSourcePort) ? Application_Model_StreamSetting::getDjLiveStreamPort() : "",
|
||||||
'show_source_mount' => isset($showSourceMount)?$showSourceParams["path"]:"",
|
'show_source_mount' => isset($showSourceMount) ? Application_Model_StreamSetting::getDjLiveStreamMountPoint() : "",
|
||||||
'isDemo' => $isDemo,
|
'isDemo' => $isDemo,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -152,9 +146,11 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function isValid($data)
|
public function isValid($data)
|
||||||
{
|
{
|
||||||
return $isValid = parent::isValid($data);
|
$isValid = parent::isValid($data);
|
||||||
}
|
|
||||||
|
|
||||||
|
return $isValid;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue