- <?php
- /* vim: set number autoindent tabstop=2 shiftwidth=2 softtabstop=2: */
-
- /**
- * Skip 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: skip.php,v 1.2 2007/03/14 16:41:38 fabamb Exp $
- */
-
- require_once 'HTML/QuickForm/Action/Next.php';
-
- /**
- * This class implements "skip" action that is to jump to next page without save form's data
- *
- */
- class HTML_QuickForm_Wizard_skip extends HTML_QuickForm_Action_Next
- {
- 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['valid'][$pageName] = true;
-
- // get next page from wizard
- $nextName = $page->controller->getNextName($pageName);
-
- // remove this page from stack
- $page->controller->getBackName($pageName);
-
- // sets valid all pages between actual and next one
- $keys = $page->controller->getPageNames();
- $start = array_search($pageName, $keys);
- $stop = array_search($nextName, $keys);
- for($i = $start+1; $i < $stop; $i++) {
- $key = $keys[$i];
- if (!is_array($data['values'][$keys[$i]])) {
- $data['values'][$keys[$i]] = array();
- }
- $data['valid'][$key] = true;
- }
-
- // jumps to the next page
- $next =& $page->controller->getPage($nextName);
- return $next->handle('jump');
- }
- }
- ?>