Wizard: Use a constant for the name and id of the progress element

refs #8369
This commit is contained in:
Johannes Meyer 2015-08-21 10:16:23 +02:00
parent 7dd3fc6c78
commit 7244906515
1 changed files with 10 additions and 5 deletions

View File

@ -38,6 +38,11 @@ class Wizard
*/
const BTN_PREV = 'btn_prev';
/**
* The name and id of the element for showing the user an activity indicator when advancing the wizard
*/
const PROGRESS_ELEMENT = 'wizard_progress';
/**
* This wizard's parent
*
@ -655,21 +660,21 @@ class Wizard
);
}
$page->setAttrib('data-progress-element', 'wizard-progress');
$page->setAttrib('data-progress-element', static::PROGRESS_ELEMENT);
$page->addElement(
'note',
'progress',
static::PROGRESS_ELEMENT,
array(
'order' => 99,
'order' => 99, // Ensures that it's shown on the right even if a sub-class adds another button
'decorators' => array(
'ViewHelper',
array('Spinner', array('id' => 'wizard-progress'))
array('Spinner', array('id' => static::PROGRESS_ELEMENT))
)
)
);
$page->addDisplayGroup(
array(static::BTN_PREV, static::BTN_NEXT, 'progress'),
array(static::BTN_PREV, static::BTN_NEXT, static::PROGRESS_ELEMENT),
'buttons',
array(
'decorators' => array(