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

Source for file back.php

Documentation is available at back.php

  1. <?php
  2. /* vim: set number autoindent tabstop=2 shiftwidth=2 softtabstop=2: */
  3.  
  4. /**
  5. * Back 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: back.php,v 1.1 2006/12/09 15:05:56 fabamb Exp $
  22. */
  23.  
  24. require_once 'HTML/QuickForm/Action/Back.php';
  25.  
  26. /**
  27. * This class implements "back" action that is to save form's data and go to previous page
  28. *
  29. */
  30. class HTML_QuickForm_Wizard_back extends HTML_QuickForm_Action_Back
  31. {
  32. function perform(&$page, $actionName)
  33. {
  34. // save the form values and validation status to the session
  35. $page->isFormBuilt() or $page->buildForm();
  36. $pageName = $page->getAttribute('id');
  37. $data =& $page->controller->container();
  38. $data['values'][$pageName] = $page->exportValues();
  39. if (!$page->controller->isModal()) {
  40. if (PEAR::isError($valid = $page->validate())) {
  41. return $valid;
  42. }
  43. $data['valid'][$pageName] = $valid;
  44. }
  45.  
  46. // gets back page from stack
  47. $backName = $page->controller->getBackName($pageName);
  48.  
  49. //
  50. $prev =& $page->controller->getPage($backName);
  51. $prev->handle('jump');
  52. }
  53. }
  54. ?>

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