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

View File

@ -81,6 +81,13 @@ class Form extends Zend_Form
*/ */
protected $submitLabel; 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 * The url to redirect to upon success
* *
@ -263,6 +270,29 @@ class Form extends Zend_Form
return $this->submitLabel; 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 * Set the url to redirect to upon success
* *
@ -738,9 +768,10 @@ class Form extends Zend_Form
'submit', 'submit',
'btn_submit', 'btn_submit',
array( array(
'ignore' => true, 'ignore' => true,
'label' => $submitLabel, 'label' => $submitLabel,
'decorators' => array( 'data-progress-label' => $this->getProgressLabel(),
'decorators' => array(
'ViewHelper', 'ViewHelper',
array('HtmlTag', array('tag' => 'div')) array('HtmlTag', array('tag' => 'div'))
) )