From: <gem...@li...> - 2011-11-04 11:18:31
|
Revision: 181 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=181&view=rev Author: matijsdejong Date: 2011-11-04 11:18:25 +0000 (Fri, 04 Nov 2011) Log Message: ----------- Small fix in attributes used with a text area Modified Paths: -------------- trunk/library/classes/MUtil/Model/FormBridge.php Modified: trunk/library/classes/MUtil/Model/FormBridge.php =================================================================== --- trunk/library/classes/MUtil/Model/FormBridge.php 2011-11-04 09:59:31 UTC (rev 180) +++ trunk/library/classes/MUtil/Model/FormBridge.php 2011-11-04 11:18:25 UTC (rev 181) @@ -112,31 +112,6 @@ return $element; } - public static function applyFixedOptions($type, array &$options) - { - static $typeOptions; - - if (! $typeOptions) { - $typeOptions = Zend_Registry::get('MUtil_Model_FormBridge'); - } - - if (substr($type, 0, 3) == 'add') { - $type = strtolower(substr($type, 3)); - } - // MUtil_Echo::rs($type, $options); - - if (isset($typeOptions[$type])) { - foreach ($typeOptions[$type] as $key => $value) { - if (is_array($value) && isset($options[$key])) { - $options[$key] = $value + $options[$key]; - } else { - $options[$key] = $value; - } - } - } - // MUtil_Echo::rs('After', $options, $typeOptions); - } - protected function _applyValidators($name, Zend_Form_Element $element) { $validators = $this->model->get($name, 'validators'); @@ -656,6 +631,8 @@ self::DISPLAY_OPTIONS, self::TEXT_OPTIONS, self::TEXTAREA_OPTIONS); $stringlength = $this->_getStringLength($options); + // Remove as size and maxlength are not used for textarea's + unset($options['size'], $options['maxlength']); $element = new Zend_Form_Element_Textarea($name, $options); @@ -682,6 +659,31 @@ return $this; } + public static function applyFixedOptions($type, array &$options) + { + static $typeOptions; + + if (! $typeOptions) { + $typeOptions = Zend_Registry::get('MUtil_Model_FormBridge'); + } + + if (substr($type, 0, 3) == 'add') { + $type = strtolower(substr($type, 3)); + } + // MUtil_Echo::rs($type, $options); + + if (isset($typeOptions[$type])) { + foreach ($typeOptions[$type] as $key => $value) { + if (is_array($value) && isset($options[$key])) { + $options[$key] = $value + $options[$key]; + } else { + $options[$key] = $value; + } + } + } + // MUtil_Echo::rs('After', $options, $typeOptions); + } + /** * * @return Zend_Form This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |