Added button to remove current show logo
This commit is contained in:
parent
d5f6e8a682
commit
c65fa8ce37
|
@ -50,18 +50,24 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
|
||||||
));
|
));
|
||||||
|
|
||||||
$logo = $this->getElement('show_logo_current');
|
$logo = $this->getElement('show_logo_current');
|
||||||
$logo->setDecorators(array(array('ViewScript', array(
|
$logo->setDecorators(array(
|
||||||
|
array('ViewScript', array(
|
||||||
'viewScript' => 'form/add-show-style.phtml',
|
'viewScript' => 'form/add-show-style.phtml',
|
||||||
'class' => 'big'
|
'class' => 'big'
|
||||||
))));
|
))
|
||||||
|
));
|
||||||
// Since we need to use a Zend_Form_Element_Image proto, disable it
|
// Since we need to use a Zend_Form_Element_Image proto, disable it
|
||||||
$logo->setAttrib('disabled','disabled');
|
$logo->setAttrib('disabled','disabled');
|
||||||
|
|
||||||
// Add show image input
|
// Button to remove the current logo
|
||||||
$fileCountValidator = Application_Form_Helper_ValidationTypes::overrideFileCountValidator(1);
|
$this->addElement('button', 'show_remove_logo', array(
|
||||||
$fileExtensionValidator = Application_Form_Helper_ValidationTypes::overrideFileExtensionValidator('jpg,png,gif');
|
'label' => '<span class="ui-button-text">' . _('Remove') . '</span>',
|
||||||
|
'class' => 'ui-button ui-state-default ui-button-text-only',
|
||||||
|
'escape' => false
|
||||||
|
));
|
||||||
|
|
||||||
$upload = new Zend_Form_Element_File('upload');
|
// Add show image input
|
||||||
|
$upload = new Zend_Form_Element_File('add_show_logo');
|
||||||
|
|
||||||
$upload->setLabel(_('Show Logo:'))
|
$upload->setLabel(_('Show Logo:'))
|
||||||
->setRequired(false)
|
->setRequired(false)
|
||||||
|
@ -70,10 +76,8 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
|
||||||
'class' => 'big',
|
'class' => 'big',
|
||||||
'placement' => false
|
'placement' => false
|
||||||
))))
|
))))
|
||||||
->addValidators(array(
|
->addValidator('Count', false, 1)
|
||||||
$fileCountValidator,
|
->addValidator('Extension', false, 'jpg,jpeg,png,gif')
|
||||||
$fileExtensionValidator
|
|
||||||
))
|
|
||||||
->addFilter('ImageSize');
|
->addFilter('ImageSize');
|
||||||
|
|
||||||
$this->addElement($upload);
|
$this->addElement($upload);
|
||||||
|
|
Loading…
Reference in New Issue