Format code using php-cs-fixer
This commit is contained in:
parent
43d7dc92cd
commit
d52c6184b9
352 changed files with 17473 additions and 17041 deletions
|
@ -4,41 +4,44 @@ require_once 'customvalidators/ConditionalNotEmpty.php';
|
|||
|
||||
class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
$cb_airtime_auth = new Zend_Form_Element_Checkbox("cb_airtime_auth");
|
||||
$cb_airtime_auth->setLabel(sprintf(_("Use %s Authentication:"), PRODUCT_NAME))
|
||||
->setChecked(true)
|
||||
->setRequired(false);
|
||||
$cb_airtime_auth = new Zend_Form_Element_Checkbox('cb_airtime_auth');
|
||||
$cb_airtime_auth->setLabel(sprintf(_('Use %s Authentication:'), PRODUCT_NAME))
|
||||
->setChecked(true)
|
||||
->setRequired(false)
|
||||
;
|
||||
$this->addElement($cb_airtime_auth);
|
||||
|
||||
$cb_custom_auth = new Zend_Form_Element_Checkbox("cb_custom_auth");
|
||||
$cb_custom_auth ->setLabel(_("Use Custom Authentication:"))
|
||||
->setRequired(false);
|
||||
$cb_custom_auth = new Zend_Form_Element_Checkbox('cb_custom_auth');
|
||||
$cb_custom_auth->setLabel(_('Use Custom Authentication:'))
|
||||
->setRequired(false)
|
||||
;
|
||||
$this->addElement($cb_custom_auth);
|
||||
|
||||
//custom username
|
||||
$custom_username = new Zend_Form_Element_Text('custom_username');
|
||||
$custom_username->setAttrib('class', 'input_text')
|
||||
->setAttrib('autocomplete', 'off')
|
||||
->setAllowEmpty(true)
|
||||
->setLabel(_('Custom Username'))
|
||||
->setFilters(array('StringTrim'))
|
||||
->setValidators(array(
|
||||
new ConditionalNotEmpty(array("cb_custom_auth"=>"1"))));
|
||||
->setAttrib('autocomplete', 'off')
|
||||
->setAllowEmpty(true)
|
||||
->setLabel(_('Custom Username'))
|
||||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new ConditionalNotEmpty(['cb_custom_auth' => '1']), ])
|
||||
;
|
||||
$this->addElement($custom_username);
|
||||
|
||||
//custom password
|
||||
$custom_password = new Zend_Form_Element_Password('custom_password');
|
||||
$custom_password->setAttrib('class', 'input_text')
|
||||
->setAttrib('autocomplete', 'off')
|
||||
->setAttrib('renderPassword','true')
|
||||
->setAllowEmpty(true)
|
||||
->setLabel(_('Custom Password'))
|
||||
->setFilters(array('StringTrim'))
|
||||
->setValidators(array(
|
||||
new ConditionalNotEmpty(array("cb_custom_auth"=>"1"))));
|
||||
->setAttrib('autocomplete', 'off')
|
||||
->setAttrib('renderPassword', 'true')
|
||||
->setAllowEmpty(true)
|
||||
->setLabel(_('Custom Password'))
|
||||
->setFilters(['StringTrim'])
|
||||
->setValidators([
|
||||
new ConditionalNotEmpty(['cb_custom_auth' => '1']), ])
|
||||
;
|
||||
$this->addElement($custom_password);
|
||||
|
||||
$showSourceParams = parse_url(Application_Model_Preference::GetLiveDJSourceConnectionURL());
|
||||
|
@ -47,25 +50,29 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
|||
$showSourceHost = new Zend_Form_Element_Text('show_source_host');
|
||||
$showSourceHost->setAttrib('readonly', true)
|
||||
->setLabel(_('Host:'))
|
||||
->setValue(isset($showSourceParams["host"])?$showSourceParams["host"]:"");
|
||||
->setValue(isset($showSourceParams['host']) ? $showSourceParams['host'] : '')
|
||||
;
|
||||
$this->addElement($showSourceHost);
|
||||
|
||||
$showSourcePort = new Zend_Form_Element_Text('show_source_port');
|
||||
$showSourcePort->setAttrib('readonly', true)
|
||||
->setLabel(_('Port:'))
|
||||
->setValue(isset($showSourceParams["port"])?$showSourceParams["port"]:"");
|
||||
->setValue(isset($showSourceParams['port']) ? $showSourceParams['port'] : '')
|
||||
;
|
||||
$this->addElement($showSourcePort);
|
||||
|
||||
$showSourceMount = new Zend_Form_Element_Text('show_source_mount');
|
||||
$showSourceMount->setAttrib('readonly', true)
|
||||
->setLabel(_('Mount:'))
|
||||
->setValue(isset($showSourceParams["path"])?$showSourceParams["path"]:"");
|
||||
->setValue(isset($showSourceParams['path']) ? $showSourceParams['path'] : '')
|
||||
;
|
||||
$this->addElement($showSourceMount);
|
||||
|
||||
$this->setDecorators(
|
||||
array(
|
||||
array('ViewScript', array('viewScript' => 'form/add-show-live-stream.phtml'))
|
||||
));
|
||||
[
|
||||
['ViewScript', ['viewScript' => 'form/add-show-live-stream.phtml']],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function isValid($data)
|
||||
|
@ -74,13 +81,13 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
|||
|
||||
if ($data['cb_custom_auth'] == 1) {
|
||||
if (trim($data['custom_username']) == '') {
|
||||
$element = $this->getElement("custom_username");
|
||||
$element->addError(_("Username field cannot be empty."));
|
||||
$element = $this->getElement('custom_username');
|
||||
$element->addError(_('Username field cannot be empty.'));
|
||||
$isValid = false;
|
||||
}
|
||||
if (trim($data['custom_password']) == '') {
|
||||
$element = $this->getElement("custom_password");
|
||||
$element->addError(_("Password field cannot be empty."));
|
||||
$element = $this->getElement('custom_password');
|
||||
$element->addError(_('Password field cannot be empty.'));
|
||||
$isValid = false;
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +100,7 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
|||
$elements = $this->getElements();
|
||||
foreach ($elements as $element) {
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
||||
$element->setAttrib('disabled','disabled');
|
||||
$element->setAttrib('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue