- <?php
- /* vim: set number autoindent tabstop=2 shiftwidth=2 softtabstop=2: */
-
- /**
- * Clear 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: clear.php,v 1.1 2006/12/09 15:05:56 fabamb Exp $
- */
-
- require_once 'HTML/QuickForm/Action/Jump.php';
-
- /**
- * This class implements "clear" action that is to empty form's data insede the container
- *
- */
- class HTML_QuickForm_Wizard_clear extends HTML_QuickForm_Action_Jump
- {
- function ClearPage()
- {
- }
-
- function perform(&$page, $actionName)
- {
- $pageName = $page->getAttribute('id');
- $data =& $page->controller->container();
- $data['values'][$pageName] = array();
- $data['valid'][$pageName] = false;
-
- // generate the URL for the page 'display' event and redirect to it
- $current =& $page->controller->getPage($pageName);
- $action = $current->getAttribute('action');
- $url = $action . (false === strpos($action, '?')? '?': '&') .
- $current->getButtonName('display') . '=true' .
- ((!defined('SID') || '' == SID)? '': '&' . SID);
- print "<meta http-equiv='refresh' content='" . $this->pause . ";URL=$url'>";
- exit;
- }
- }
- ?>