HTML_QuickForm_Wizard
[ class tree: HTML_QuickForm_Wizard ] [ index: HTML_QuickForm_Wizard ] [ all elements ]

Source for file clear.php

Documentation is available at clear.php

  1. <?php
  2. /* vim: set number autoindent tabstop=2 shiftwidth=2 softtabstop=2: */
  3.  
  4. /**
  5. * Clear action
  6. *
  7. * PHP versions 4 and 5
  8. *
  9. * LICENSE: This source file is subject to version 3.0 of the PHP license
  10. * that is available through the world-wide-web at the following URI:
  11. * http://www.php.net/license/3_0.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.
  14. *
  15. * @category HTML
  16. * @package HTML_QuickForm_Wizard
  17. * @author Fabio Ambrosanio <fabio@ambrosanio.com>
  18. * @license http://www.php.net/license/3_01.txt PHP
  19. * @version @package_version@
  20. *
  21. * $Id: clear.php,v 1.1 2006/12/09 15:05:56 fabamb Exp $
  22. */
  23.  
  24. require_once 'HTML/QuickForm/Action/Jump.php';
  25.  
  26. /**
  27. * This class implements "clear" action that is to empty form's data insede the container
  28. *
  29. */
  30. class HTML_QuickForm_Wizard_clear extends HTML_QuickForm_Action_Jump
  31. {
  32. function ClearPage()
  33. {
  34. }
  35.  
  36. function perform(&$page, $actionName)
  37. {
  38. $pageName = $page->getAttribute('id');
  39. $data =& $page->controller->container();
  40. $data['values'][$pageName] = array();
  41. $data['valid'][$pageName] = false;
  42.  
  43. // generate the URL for the page 'display' event and redirect to it
  44. $current =& $page->controller->getPage($pageName);
  45. $action = $current->getAttribute('action');
  46. $url = $action . (false === strpos($action, '?')? '?': '&') .
  47. $current->getButtonName('display') . '=true' .
  48. ((!defined('SID') || '' == SID)? '': '&' . SID);
  49. print "<meta http-equiv='refresh' content='" . $this->pause . ";URL=$url'>";
  50. exit;
  51. }
  52. }
  53. ?>

Documentation generated on Thu, 19 Apr 2007 08:13:25 +0200 by phpDocumentor 1.3.0RC3