2 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
5 * This action allows to go to a specific page of a multipage form.
9 * LICENSE: This source file is subject to version 3.01 of the PHP license
10 * that is available through the world-wide-web at the following URI:
11 * http://www.php.net/license/3_01.txt If you did not receive a copy of
12 * the PHP License and are unable to obtain it through the web, please
13 * send a note to license@php.net so we can mail you a copy immediately.
16 * @package HTML_QuickForm_Controller
17 * @author Alexey Borzov <avb@php.net>
18 * @copyright 2003-2007 The PHP Group
19 * @license http://www.php.net/license/3_01.txt PHP License 3.01
20 * @version CVS: $Id: Direct.php,v 1.4 2007/05/18 09:34:18 avb Exp $
21 * @link http://pear.php.net/package/HTML_QuickForm_Controller
25 * Class representing an action to perform on HTTP request.
27 require_once 'HTML/QuickForm/Action.php';
30 * This action allows to go to a specific page of a multipage form.
32 * Please note that the name for this action in addAction() should NOT be
33 * 'direct', but the name of the page you wish to go to.
36 * @package HTML_QuickForm_Controller
37 * @author Alexey Borzov <avb@php.net>
38 * @version Release: 1.0.9
40 class HTML_QuickForm_Action_Direct
extends HTML_QuickForm_Action
42 function perform(&$page, $actionName)
44 // save the form values and validation status to the session
45 $page->isFormBuilt() or $page->buildForm();
46 $pageName = $page->getAttribute('id');
47 $data =& $page->controller
->container();
48 $data['values'][$pageName] = $page->exportValues();
49 if (PEAR
::isError($valid = $page->validate())) {
52 $data['valid'][$pageName] = $valid;
54 $target =& $page->controller
->getPage($actionName);
55 if (PEAR
::isError($target)) {
58 return $target->handle('jump');