public function perform(HTML_QuickForm2_Controller_Page $page, $name) { $valid = $page->storeValues(); // All pages are valid, process if ($page->getController()->isValid()) { return $page->handle('process'); // Current page is invalid, display it } elseif (!$valid) { return $page->handle('display'); // Some other page is invalid, redirect to it } else { return $page->getController()->getFirstInvalidPage()->handle('jump'); } }
public function perform(HTML_QuickForm2_Controller_Page $page, $name) { $valid = $page->storeValues(); // Wizard and page is invalid: don't go further if ($page->getController()->isWizard() && !$valid) { return $page->handle('display'); } // More pages? if (null !== ($next = $page->getController()->nextPage($page))) { return $next->handle('jump'); // Consider this a 'finish' button, if there is no explicit one } elseif ($page->getController()->isWizard()) { if ($page->getController()->isValid()) { return $page->handle('process'); } else { // redirect to the first invalid page return $page->getController()->getFirstInvalidPage()->handle('jump'); } } else { return $page->handle('display'); } }
public function handle($actionName) { if ($actionName == 'next') { $paysysId = $this->getController()->getParentController()->getRequest()->get('paysys_id'); if ($paysysId) { if ($ps = Am_Di::getInstance()->plugins_payment->loadGet($paysysId)) { $hideBricks = $ps->hideBricks(); $this->getController()->getSessionContainer()->storeOpaque('hideBricks', $hideBricks); } } } elseif ($actionName == 'display') { if (!empty($this->bricks)) { foreach ($this->bricks as $brick) { if ($brick->getId() == 'paysystem') { $this->getController()->getSessionContainer()->storeOpaque('hideBricks', array()); } } } } return parent::handle($actionName); }