|
|
@@ -79,14 +79,19 @@ class Zend_Form_Element_File extends Zend_Form_Element_Xhtml
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
- $decorators = $this->getDecorators();
|
|
|
- if (empty($decorators)) {
|
|
|
- $this->addDecorator('File')
|
|
|
- ->addDecorator('Errors')
|
|
|
- ->addDecorator('Description', array('tag' => 'p', 'class' => 'description'))
|
|
|
- ->addDecorator('HtmlTag', array('tag' => 'dd'))
|
|
|
- ->addDecorator('Label', array('tag' => 'dt'));
|
|
|
+ parent::loadDefaultDecorators();
|
|
|
+
|
|
|
+ // This element needs the File decorator and not the ViewHelper decorator
|
|
|
+ if (false !== $this->getDecorator('ViewHelper')) {
|
|
|
+ $this->removeDecorator('ViewHelper');
|
|
|
+ }
|
|
|
+ if (false === $this->getDecorator('File')) {
|
|
|
+ // Add File decorator to the beginning
|
|
|
+ $decorators = $this->getDecorators();
|
|
|
+ array_unshift($decorators, 'File');
|
|
|
+ $this->setDecorators($decorators);
|
|
|
}
|
|
|
+
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
@@ -168,6 +173,7 @@ class Zend_Form_Element_File extends Zend_Form_Element_Xhtml
|
|
|
*
|
|
|
* @param string|Zend_File_Transfer_Adapter_Abstract $adapter
|
|
|
* @return Zend_Form_Element_File
|
|
|
+ * @throws Zend_Form_Element_Exception
|
|
|
*/
|
|
|
public function setTransferAdapter($adapter)
|
|
|
{
|
|
|
@@ -341,7 +347,7 @@ class Zend_Form_Element_File extends Zend_Form_Element_Xhtml
|
|
|
/**
|
|
|
* Sets a filter for the class, erasing all previous set; proxy to adapter
|
|
|
*
|
|
|
- * @param string|array $filter Filter to set
|
|
|
+ * @param array $filters Filters to set
|
|
|
* @return Zend_Form_Element_File
|
|
|
*/
|
|
|
public function setFilters(array $filters)
|
|
|
@@ -856,6 +862,7 @@ class Zend_Form_Element_File extends Zend_Form_Element_Xhtml
|
|
|
*
|
|
|
* @param Zend_View_Interface $view
|
|
|
* @return string
|
|
|
+ * @throws Zend_Form_Element_Exception
|
|
|
*/
|
|
|
public function render(Zend_View_Interface $view = null)
|
|
|
{
|