Form: Allow to set a progress label

refs #8369
This commit is contained in:
Johannes Meyer 2015-08-20 15:04:15 +02:00
parent 7da8ad4e44
commit 275b57cb69
1 changed files with 34 additions and 3 deletions

View File

@ -81,6 +81,13 @@ class Form extends Zend_Form
*/
protected $submitLabel;
/**
* Label to use for showing the user an activity indicator when submitting the form
*
* @var string
*/
protected $progressLabel;
/**
* The url to redirect to upon success
*
@ -263,6 +270,29 @@ class Form extends Zend_Form
return $this->submitLabel;
}
/**
* Set the label to use for showing the user an activity indicator when submitting the form
*
* @param string $label
*
* @return $this
*/
public function setProgressLabel($label)
{
$this->progressLabel = $label;
return $this;
}
/**
* Return the label to use for showing the user an activity indicator when submitting the form
*
* @return string
*/
public function getProgressLabel()
{
return $this->progressLabel;
}
/**
* Set the url to redirect to upon success
*
@ -738,9 +768,10 @@ class Form extends Zend_Form
'submit',
'btn_submit',
array(
'ignore' => true,
'label' => $submitLabel,
'decorators' => array(
'ignore' => true,
'label' => $submitLabel,
'data-progress-label' => $this->getProgressLabel(),
'decorators' => array(
'ViewHelper',
array('HtmlTag', array('tag' => 'div'))
)