Changeset View
Changeset View
Standalone View
Standalone View
src/view/form/PHUIPagedFormView.php
| Show First 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | private function processForm($is_request, $source) { | ||||
| if ($this->pageExists($this->choosePage)) { | if ($this->pageExists($this->choosePage)) { | ||||
| $selected = $this->getPage($this->choosePage); | $selected = $this->getPage($this->choosePage); | ||||
| } else { | } else { | ||||
| $selected = $this->getPageByIndex(0); | $selected = $this->getPageByIndex(0); | ||||
| } | } | ||||
| $is_attempt_complete = false; | $is_attempt_complete = false; | ||||
| if ($this->prevPage) { | if ($this->prevPage) { | ||||
| $prev_index = $this->getPageIndex($selected->getKey()) - 1;; | $prev_index = $this->getPageIndex($selected->getKey()) - 1; | ||||
| $index = max(0, $prev_index); | $index = max(0, $prev_index); | ||||
| $selected = $this->getPageByIndex($index); | $selected = $this->getPageByIndex($index); | ||||
| } else if ($this->nextPage) { | } else if ($this->nextPage) { | ||||
| $next_index = $this->getPageIndex($selected->getKey()) + 1; | $next_index = $this->getPageIndex($selected->getKey()) + 1; | ||||
| if ($next_index > $this->getLastIndex()) { | if ($next_index > $this->getLastIndex()) { | ||||
| $is_attempt_complete = true; | $is_attempt_complete = true; | ||||
| } | } | ||||
| $index = min($this->getLastIndex(), $next_index); | $index = min($this->getLastIndex(), $next_index); | ||||
| ▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines | |||||