QuickForm: support spaces and more on submit labels

This commit is contained in:
Thomas Gelf 2015-07-28 15:09:16 +02:00
parent 360a8f794d
commit 9e80a5242b
1 changed files with 5 additions and 2 deletions

View File

@ -77,6 +77,7 @@ abstract class QuickForm extends Zend_Form
{
if (false !== ($label = $this->getSubmitLabel())) {
$this->addElement('submit', $label);
$this->getElement($label)->setLabel($label);
}
}
@ -195,9 +196,11 @@ abstract class QuickForm extends Zend_Form
$label = $this->getSubmitLabel();
if ($label === false) {
$this->hasBeenSubmitted = $this->hasBeenSent();
} else {
$elementName = $this->getElement($label)->getName();
$this->hasBeenSubmitted = array_key_exists($elementName, $post)
&& $post[$elementName] === $label;
}
$this->hasBeenSubmitted = array_key_exists($label, $post) &&
$post[$label] === $label;
} else {
$this->hasBeenSubmitted === false;
}