/** * Call this instead of manually creating your actions * * You can easily rename actions by calling $actions->fieldByName('action_doNext')->setTitle('...') * * @param bool $doSet * @return FieldList */ protected function definePrevNextActions($doSet = false) { $actions = new FieldList(); $prevClass = 'FormAction'; // do not validate if used in conjonction with zenvalidator if (class_exists('FormActionNoValidation')) { $prevClass = 'FormActionNoValidation'; } $prev = null; if (self::classNameNumber() > 1) { $actions->push($prev = new $prevClass('doPrev', _t('FormExtra.doPrev', 'Previous'))); $prev->addExtraClass('step-prev'); $prev->setUseButtonTag(true); } $label = _t('FormExtra.doNext', 'Next'); $actions->push($next = new FormAction('doNext', $label)); $next->setUseButtonTag(true); $next->addExtraClass('step-next'); if (!$prev) { $next->addExtraClass('step-next-single'); } if (self::isLastStep()) { $next->setTitle(_t('FormExtra.doFinish', 'Finish')); $next->addExtraClass('step-last'); } $this->addExtraClass('form-steps'); if (!$doSet) { $this->setActions($actions); $actions->setForm($this); } return $actions; }