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,102 +4,103 @@ require_once 'customfilters/ImageSize.php';
|
|||
|
||||
class Application_Form_AddShowStyle extends Zend_Form_SubForm
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
// Add show background-color input
|
||||
$this->addElement('text', 'add_show_background_color', array(
|
||||
'label' => _('Background Colour:'),
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim')
|
||||
));
|
||||
// Add show background-color input
|
||||
$this->addElement('text', 'add_show_background_color', [
|
||||
'label' => _('Background Colour:'),
|
||||
'class' => 'input_text',
|
||||
'filters' => ['StringTrim'],
|
||||
]);
|
||||
|
||||
$bg = $this->getElement('add_show_background_color');
|
||||
|
||||
$bg->setDecorators(array(array('ViewScript', array(
|
||||
$bg->setDecorators([['ViewScript', [
|
||||
'viewScript' => 'form/add-show-style.phtml',
|
||||
'class' => 'big'
|
||||
))));
|
||||
'class' => 'big',
|
||||
]]]);
|
||||
|
||||
$stringLengthValidator = Application_Form_Helper_ValidationTypes::overrideStringLengthValidator(6, 6);
|
||||
$bg->setValidators(array(
|
||||
'Hex', $stringLengthValidator
|
||||
));
|
||||
$bg->setValidators([
|
||||
'Hex', $stringLengthValidator,
|
||||
]);
|
||||
|
||||
// Add show color input
|
||||
$this->addElement('text', 'add_show_color', array(
|
||||
'label' => _('Text Colour:'),
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim')
|
||||
));
|
||||
// Add show color input
|
||||
$this->addElement('text', 'add_show_color', [
|
||||
'label' => _('Text Colour:'),
|
||||
'class' => 'input_text',
|
||||
'filters' => ['StringTrim'],
|
||||
]);
|
||||
|
||||
$c = $this->getElement('add_show_color');
|
||||
|
||||
$c->setDecorators(array(array('ViewScript', array(
|
||||
$c->setDecorators([['ViewScript', [
|
||||
'viewScript' => 'form/add-show-style.phtml',
|
||||
'class' => 'big'
|
||||
))));
|
||||
'class' => 'big',
|
||||
]]]);
|
||||
|
||||
$c->setValidators([
|
||||
'Hex', $stringLengthValidator,
|
||||
]);
|
||||
|
||||
$c->setValidators(array(
|
||||
'Hex', $stringLengthValidator
|
||||
));
|
||||
|
||||
// Show the current logo
|
||||
$this->addElement('image', 'add_show_logo_current', array(
|
||||
'label' => _('Current Logo:'),
|
||||
));
|
||||
|
||||
$this->addElement('image', 'add_show_logo_current', [
|
||||
'label' => _('Current Logo:'),
|
||||
]);
|
||||
|
||||
$logo = $this->getElement('add_show_logo_current');
|
||||
$logo->setDecorators(array(
|
||||
array('ViewScript', array(
|
||||
'viewScript' => 'form/add-show-style.phtml',
|
||||
'class' => 'big'
|
||||
))
|
||||
));
|
||||
$logo->setDecorators([
|
||||
['ViewScript', [
|
||||
'viewScript' => 'form/add-show-style.phtml',
|
||||
'class' => 'big',
|
||||
]],
|
||||
]);
|
||||
// Since we need to use a Zend_Form_Element_Image proto, disable it
|
||||
$logo->setAttrib('disabled','disabled');
|
||||
|
||||
$logo->setAttrib('disabled', 'disabled');
|
||||
|
||||
// Button to remove the current logo
|
||||
$this->addElement('button', 'add_show_logo_current_remove', array(
|
||||
'label' => '<span class="ui-button-text">' . _('Remove') . '</span>',
|
||||
'class' => 'ui-button ui-state-default ui-button-text-only',
|
||||
'escape' => false
|
||||
));
|
||||
|
||||
$this->addElement('button', 'add_show_logo_current_remove', [
|
||||
'label' => '<span class="ui-button-text">' . _('Remove') . '</span>',
|
||||
'class' => 'ui-button ui-state-default ui-button-text-only',
|
||||
'escape' => false,
|
||||
]);
|
||||
|
||||
// Add show image input
|
||||
$upload = new Zend_Form_Element_File('add_show_logo');
|
||||
|
||||
|
||||
$upload->setLabel(_('Show Logo:'))
|
||||
->setRequired(false)
|
||||
->setDecorators(array('File', array('ViewScript', array(
|
||||
'viewScript' => 'form/add-show-style.phtml',
|
||||
'class' => 'big',
|
||||
'placement' => false
|
||||
))))
|
||||
->addValidator('Count', false, 1)
|
||||
->addValidator('Extension', false, 'jpg,jpeg,png,gif')
|
||||
->addFilter('ImageSize');
|
||||
->setRequired(false)
|
||||
->setDecorators(['File', ['ViewScript', [
|
||||
'viewScript' => 'form/add-show-style.phtml',
|
||||
'class' => 'big',
|
||||
'placement' => false,
|
||||
]]])
|
||||
->addValidator('Count', false, 1)
|
||||
->addValidator('Extension', false, 'jpg,jpeg,png,gif')
|
||||
->addFilter('ImageSize')
|
||||
;
|
||||
|
||||
$this->addElement($upload);
|
||||
|
||||
|
||||
// Add image preview
|
||||
$this->addElement('image', 'add_show_logo_preview', array(
|
||||
'label' => _('Logo Preview:'),
|
||||
));
|
||||
|
||||
$this->addElement('image', 'add_show_logo_preview', [
|
||||
'label' => _('Logo Preview:'),
|
||||
]);
|
||||
|
||||
$preview = $this->getElement('add_show_logo_preview');
|
||||
$preview->setDecorators(array(array('ViewScript', array(
|
||||
'viewScript' => 'form/add-show-style.phtml',
|
||||
'class' => 'big'
|
||||
))));
|
||||
$preview->setAttrib('disabled','disabled');
|
||||
$preview->setDecorators([['ViewScript', [
|
||||
'viewScript' => 'form/add-show-style.phtml',
|
||||
'class' => 'big',
|
||||
]]]);
|
||||
$preview->setAttrib('disabled', 'disabled');
|
||||
|
||||
$csrf_namespace = new Zend_Session_Namespace('csrf_namespace');
|
||||
$csrf_element = new Zend_Form_Element_Hidden('csrf');
|
||||
$csrf_element->setValue($csrf_namespace->authtoken)
|
||||
->setRequired('true')
|
||||
->removeDecorator('HtmlTag')
|
||||
->removeDecorator('Label');
|
||||
->removeDecorator('Label')
|
||||
;
|
||||
$this->addElement($csrf_element);
|
||||
}
|
||||
|
||||
|
@ -110,14 +111,14 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
|
|||
if ($element->getType() != 'Zend_Form_Element_Hidden'
|
||||
// We should still be able to remove the show logo
|
||||
&& $element->getName() != 'add_show_logo_current_remove') {
|
||||
$element->setAttrib('disabled','disabled');
|
||||
$element->setAttrib('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function hideShowLogo() {
|
||||
public function hideShowLogo()
|
||||
{
|
||||
$this->removeElement('add_show_logo');
|
||||
$this->removeElement('add_show_logo_preview');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue