_skipUrl; } public function setSkipUrl($skipUrl) { $this->_skipUrl = $skipUrl; return $this; } protected function addStepButtons(array $options = []) { $options = array_merge([ 'previous' => (bool) $this->getCancelUrl(), 'skip' => (bool) $this->getSkipUrl(), 'next' => true, ], $options); $this->addElement('submit', 'btnPrevious', [ 'label' => 'Prev Step', 'class' => 'btn btn-dark', 'helper' => 'formInputButton', 'decorators' => [ 'ViewHelper', ['HtmlTag', 'options' => [ 'tag' => 'div', 'class' => 'btn-prev' . ($options['previous'] ? '' : ' hidden'), ]], ], ]); $this->addElement('submit', 'btnSkip', [ 'label' => 'Skip Step', 'class' => 'btn btn-dark', 'helper' => 'formInputButton', 'decorators' => [ 'ViewHelper', ['HtmlTag', 'options' => [ 'tag' => 'div', 'class' => 'btn-skip' . ($options['skip'] ? '' : ' hidden'), ]], ], ]); if ($options['skip']) { $this->getElement('btnSkip')->setAttrib( 'onclick', "window.location.href = '" . htmlspecialchars($this->getSkipUrl()) . "';" ); } if ($options['previous']) { $this->getElement('btnPrevious')->setAttrib( 'onclick', "window.location.href = '" . htmlspecialchars($this->getCancelUrl()) . "';" ); } $this->addElement('submit', 'btnNext', [ 'label' => 'Next Step', 'decorators' => [ 'ViewHelper', ['HtmlTag', 'options' => ['tag' => 'div', 'class' => 'btn-next']], ], 'class' => 'btn btn-primary', ]); /** @var \Qs_Form_Decorator_HtmlTag $viewHelper */ if (($viewHelper = $this->getElement('btnPrevious')->getDecorator('HtmlTag')) && ($infoHtml = $this->getBottomInfoHtml()) ) { $infoHtml = Qs_String::fill($infoHtml, [ 'ip' => Qs_Request::getClientIP(), 'date' => date('m/d/Y'), ]); $viewHelper->setHtmlAfterElement($infoHtml); } $this->addDisplayGroup(['btnPrevious', 'btnSkip', 'btnNext'], 'submitGroup', [ 'decorators' => [ 'FormElements', ['DtDdWrapper', 'options' => ['ddAttribs' => ['class' => 'prev-next-buttons']]] ], ]); return $this; } public function getCancelUrl() { return $this->_cancelUrl; } public function getBottomInfoHtml() { return $this->_bottomInfoHtml; } public function setBottomInfoHtml($bottomInfoHtml) { $this->_bottomInfoHtml = $bottomInfoHtml; return $this; } }