- <?php
- /* vim: set number autoindent tabstop=2 shiftwidth=2 softtabstop=2: */
-
- /**
- * Back action
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This source file is subject to version 3.0 of the PHP license
- * that is available through the world-wide-web at the following URI:
- * http://www.php.net/license/3_0.txt. If you did not receive a copy of
- * the PHP License and are unable to obtain it through the web, please
- * send a note to license@php.net so we can mail you a copy immediately.
- *
- * @category HTML
- * @package HTML_QuickForm_Wizard
- * @author Fabio Ambrosanio <fabio@ambrosanio.com>
- * @license http://www.php.net/license/3_01.txt PHP
- * @version @package_version@
- *
- * $Id: back.php,v 1.1 2006/12/09 15:05:56 fabamb Exp $
- */
-
- require_once 'HTML/QuickForm/Action/Back.php';
-
- /**
- * This class implements "back" action that is to save form's data and go to previous page
- *
- */
- class HTML_QuickForm_Wizard_back extends HTML_QuickForm_Action_Back
- {
- function perform(&$page, $actionName)
- {
- // save the form values and validation status to the session
- $page->isFormBuilt() or $page->buildForm();
- $pageName = $page->getAttribute('id');
- $data =& $page->controller->container();
- $data['values'][$pageName] = $page->exportValues();
- if (!$page->controller->isModal()) {
- if (PEAR::isError($valid = $page->validate())) {
- return $valid;
- }
- $data['valid'][$pageName] = $valid;
- }
-
- // gets back page from stack
- $backName = $page->controller->getBackName($pageName);
-
- //
- $prev =& $page->controller->getPage($backName);
- $prev->handle('jump');
- }
- }
- ?>