|
|
@@ -1785,7 +1785,6 @@ class Zend_Form implements Iterator, Countable, Zend_Validate_Interface
|
|
|
if (isset($this->_elements[$element])) {
|
|
|
$add = $this->getElement($element);
|
|
|
if (null !== $add) {
|
|
|
- unset($this->_order[$element]);
|
|
|
$group[] = $add;
|
|
|
}
|
|
|
}
|
|
|
@@ -1798,12 +1797,17 @@ class Zend_Form implements Iterator, Countable, Zend_Validate_Interface
|
|
|
$name = (string) $name;
|
|
|
|
|
|
if (is_array($options)) {
|
|
|
+ $options['form'] = $this;
|
|
|
$options['elements'] = $group;
|
|
|
} elseif ($options instanceof Zend_Config) {
|
|
|
$options = $options->toArray();
|
|
|
+ $options['form'] = $this;
|
|
|
$options['elements'] = $group;
|
|
|
} else {
|
|
|
- $options = array('elements' => $group);
|
|
|
+ $options = array(
|
|
|
+ 'form' => $this,
|
|
|
+ 'elements' => $group,
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
if (isset($options['displayGroupClass'])) {
|
|
|
@@ -1850,6 +1854,7 @@ class Zend_Form implements Iterator, Countable, Zend_Validate_Interface
|
|
|
}
|
|
|
|
|
|
$this->_displayGroups[$name] = $group;
|
|
|
+ $group->setForm($this);
|
|
|
|
|
|
if (!empty($this->_displayGroupPrefixPaths)) {
|
|
|
$this->_displayGroups[$name]->addPrefixPaths($this->_displayGroupPrefixPaths);
|
|
|
@@ -3278,6 +3283,20 @@ class Zend_Form implements Iterator, Countable, Zend_Validate_Interface
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Remove an element from iteration
|
|
|
+ *
|
|
|
+ * @param string $name Element/group/form name
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function removeFromIteration($name)
|
|
|
+ {
|
|
|
+ if (array_key_exists($name, $this->_order)) {
|
|
|
+ unset($this->_order[$name]);
|
|
|
+ $this->_orderUpdated = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* Sort items according to their order
|
|
|
*
|
|
|
* @return void
|