CC-4090: Make code style PSR compliant
-removed all trailing whitespace in forms directory -replace all tabs with 4 spaces
This commit is contained in:
parent
d9cde230cd
commit
7ce4934cdc
25 changed files with 297 additions and 297 deletions
|
@ -2,33 +2,33 @@
|
|||
|
||||
class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
||||
{
|
||||
|
||||
|
||||
public function init()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1;
|
||||
$isStreamConfigable = Application_Model_Preference::GetEnableStreamConf() == "true";
|
||||
|
||||
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
$defaultFade = Application_Model_Preference::GetDefaultTransitionFade();
|
||||
if($defaultFade == ""){
|
||||
$defaultFade = '00.000000';
|
||||
}
|
||||
|
||||
|
||||
// automatic trasition on source disconnection
|
||||
$auto_transition = new Zend_Form_Element_Checkbox("auto_transition");
|
||||
$auto_transition->setLabel("Auto Switch Off")
|
||||
->setValue(Application_Model_Preference::GetAutoTransition())
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($auto_transition);
|
||||
|
||||
|
||||
// automatic switch on upon source connection
|
||||
$auto_switch = new Zend_Form_Element_Checkbox("auto_switch");
|
||||
$auto_switch->setLabel("Auto Switch On")
|
||||
->setValue(Application_Model_Preference::GetAutoSwitch())
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($auto_switch);
|
||||
|
||||
|
||||
// Default transition fade
|
||||
$transition_fade = new Zend_Form_Element_Text("transition_fade");
|
||||
$transition_fade->setLabel("Switch Transition Fade (s)")
|
||||
|
@ -38,7 +38,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
->setValue($defaultFade)
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($transition_fade);
|
||||
|
||||
|
||||
//Master username
|
||||
$master_username = new Zend_Form_Element_Text('master_username');
|
||||
$master_username->setAttrib('autocomplete', 'off')
|
||||
|
@ -48,7 +48,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
->setValue(Application_Model_Preference::GetLiveSteamMasterUsername())
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($master_username);
|
||||
|
||||
|
||||
//Master password
|
||||
if($isDemo){
|
||||
$master_password = new Zend_Form_Element_Text('master_password');
|
||||
|
@ -64,7 +64,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
->setFilters(array('StringTrim'))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($master_password);
|
||||
|
||||
|
||||
//Master source connection url
|
||||
$master_dj_connection_url = new Zend_Form_Element_Text('master_dj_connection_url');
|
||||
$master_dj_connection_url->setAttrib('readonly', true)
|
||||
|
@ -72,7 +72,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
->setValue(Application_Model_Preference::GetMasterDJSourceConnectionURL())
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($master_dj_connection_url);
|
||||
|
||||
|
||||
//Show source connection url
|
||||
$live_dj_connection_url = new Zend_Form_Element_Text('live_dj_connection_url');
|
||||
$live_dj_connection_url->setAttrib('readonly', true)
|
||||
|
@ -80,7 +80,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
->setValue(Application_Model_Preference::GetLiveDJSourceConnectionURL())
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($live_dj_connection_url);
|
||||
|
||||
|
||||
//liquidsoap harbor.input port
|
||||
if (!$isSaas) {
|
||||
$m_port = Application_Model_StreamSetting::getMasterLiveStreamPort();
|
||||
|
@ -91,7 +91,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
->addValidator('regex', false, array('pattern'=>'/^[0-9]+$/', 'messages'=>array('regexNotMatch'=>'Only numbers are allowed.')))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($master_dj_port);
|
||||
|
||||
|
||||
$m_mount = Application_Model_StreamSetting::getMasterLiveStreamMountPoint();
|
||||
$master_dj_mount = new Zend_Form_Element_Text('master_harbor_input_mount_point');
|
||||
$master_dj_mount->setLabel("Master Source Mount Point")
|
||||
|
@ -100,7 +100,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
array('regex', false, array('/^[^ &<>]+$/', 'messages' => 'Invalid character entered'))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($master_dj_mount);
|
||||
|
||||
|
||||
//liquidsoap harbor.input port
|
||||
$l_port = Application_Model_StreamSetting::getDjLiveStreamPort();
|
||||
$live_dj_port = new Zend_Form_Element_Text('dj_harbor_input_port');
|
||||
|
@ -110,7 +110,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
->addValidator('regex', false, array('pattern'=>'/^[0-9]+$/', 'messages'=>array('regexNotMatch'=>'Only numbers are allowed.')))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($live_dj_port);
|
||||
|
||||
|
||||
$l_mount = Application_Model_StreamSetting::getDjLiveStreamMountPoint();
|
||||
$live_dj_mount = new Zend_Form_Element_Text('dj_harbor_input_mount_point');
|
||||
$live_dj_mount->setLabel("Show Source Mount Point")
|
||||
|
@ -132,27 +132,27 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function updateVariables(){
|
||||
global $CC_CONFIG;
|
||||
|
||||
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
$isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1;
|
||||
$master_dj_connection_url = Application_Model_Preference::GetMasterDJSourceConnectionURL();
|
||||
$live_dj_connection_url = Application_Model_Preference::GetLiveDJSourceConnectionURL();
|
||||
|
||||
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/preferences_livestream.phtml', 'master_dj_connection_url'=>$master_dj_connection_url, 'live_dj_connection_url'=>$live_dj_connection_url, 'isSaas' => $isSaas, 'isDemo' => $isDemo))
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
public function isValid($data){
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
$isValid = parent::isValid($data);
|
||||
if (!$isSaas) {
|
||||
$master_harbor_input_port = $data['master_harbor_input_port'];
|
||||
$dj_harbor_input_port = $data['dj_harbor_input_port'];
|
||||
|
||||
|
||||
if($master_harbor_input_port == $dj_harbor_input_port && $master_harbor_input_port != ""){
|
||||
$element = $this->getElement("dj_harbor_input_port");
|
||||
$element->addError("You cannot use same port as Master DJ port.");
|
||||
|
@ -192,5 +192,5 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
}
|
||||
return $isValid;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue