Adding a convention to pull through the Next button text and the Previous button text.

This commit is contained in:
Jacob Roberts 2014-03-17 11:04:00 +13:00
parent 42b8971373
commit f0be619cde

View File

@ -335,17 +335,17 @@ abstract class MultiForm extends Form {
if($step->isFinalStep()) {
$actions->push(new FormAction('finish', $step->getSubmitText()));
} else {
$actions->push(new FormAction('next', $step->getNextText()));
$actions->push(new FormAction('next', $step::$next_button_text));
}
// If there is a previous step defined, add the back button
if($step->getPreviousStep() && $step->canGoBack()) {
// If there is a next step, insert the action before the next action
if($step->getNextStep()) {
$actions->insertBefore(new FormAction('prev', $step->getPrevText()), 'action_next');
$actions->insertBefore(new FormAction('prev', $step::$previous_button_text), 'action_next');
// Assume that this is the last step, insert the action before the finish action
} else {
$actions->insertBefore(new FormAction('prev', $step->getPrevText()), 'action_finish');
$actions->insertBefore(new FormAction('prev', $step::$previous_button_text), 'action_finish');
}
}