From f3e2346818c05ee8b97451096c12c1a7eac07452 Mon Sep 17 00:00:00 2001 From: Alexander Menk Date: Thu, 11 Dec 2014 20:19:40 +0300 Subject: [PATCH 1/2] Fix for file elements Fix for file elements --- Twitter/Bootstrap/Form/Horizontal.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Twitter/Bootstrap/Form/Horizontal.php b/Twitter/Bootstrap/Form/Horizontal.php index aa5c8e5..897e5d6 100755 --- a/Twitter/Bootstrap/Form/Horizontal.php +++ b/Twitter/Bootstrap/Form/Horizontal.php @@ -55,6 +55,8 @@ public function __construct($options = null) $class = $htmlTagDecorator->getOption('class'); $htmlTagDecorator->setOption('class', "col-" . $this->_getColType() . "-offset-" . $this->_getLabelColSize() . " $class"); $element->addDecorator($htmlTagDecorator); + } elseif($element instanceof Zend_Form_Element_File) { + $element->addDecorator('File'); } } From eea7b63862b1b2d60575b7c58edaac82036b1e7e Mon Sep 17 00:00:00 2001 From: Alexander Menk Date: Thu, 11 Dec 2014 20:40:39 +0300 Subject: [PATCH 2/2] Fix: Uploader field appeared doubled --- Twitter/Bootstrap/Form/Horizontal.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Twitter/Bootstrap/Form/Horizontal.php b/Twitter/Bootstrap/Form/Horizontal.php index 897e5d6..4667eab 100755 --- a/Twitter/Bootstrap/Form/Horizontal.php +++ b/Twitter/Bootstrap/Form/Horizontal.php @@ -56,7 +56,10 @@ public function __construct($options = null) $htmlTagDecorator->setOption('class', "col-" . $this->_getColType() . "-offset-" . $this->_getLabelColSize() . " $class"); $element->addDecorator($htmlTagDecorator); } elseif($element instanceof Zend_Form_Element_File) { - $element->addDecorator('File'); + $decorators = $element->getDecorators(); + array_unshift($decorators, 'File'); + unset($decorators['Zend_Form_Decorator_ViewHelper']); + $element->setDecorators($decorators); } }