Source for file WPreviousStepButton.class.php

Documentation is available at WPreviousStepButton.class.php

  1. <?php
  2. /**
  3. * @since Jul 20, 2005
  4. * @package polyphony.wizard.components
  5. *
  6. * @copyright Copyright &copy; 2005, Middlebury College
  7. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  8. *
  9. * @version $Id: WPreviousStepButton.class.php,v 1.8 2007/09/19 14:04:51 adamfranco Exp $
  10. */
  11.  
  12. require_once(POLYPHONY."/main/library/Wizard/Components/WEventButton.class.php");
  13.  
  14. /**
  15. * This adds a "Previous" button to the wizard.
  16. *
  17. * @since Jul 20, 2005
  18. * @package polyphony.wizard.components
  19. *
  20. * @copyright Copyright &copy; 2005, Middlebury College
  21. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  22. *
  23. * @version $Id: WPreviousStepButton.class.php,v 1.8 2007/09/19 14:04:51 adamfranco Exp $
  24. */
  25. class WPreviousStepButton extends WEventButton {
  26. var $_stepContainer;
  27.  
  28. /**
  29. * Constructor
  30. * @param ref object $stepContainer A {@link WizardStepContainer} object.
  31. * @access public
  32. * @return void
  33. */
  34. function WPreviousStepButton ($stepContainer) {
  35. $this->setLabel(_("Previous"));
  36. $this->_stepContainer =$stepContainer;
  37. }
  38.  
  39. /**
  40. * Tells the wizard component to update itself - this may include getting
  41. * form post data or validation - whatever this particular component wants to
  42. * do every pageload.
  43. * @param string $fieldName The field name to use when outputting form data or
  44. * similar parameters/information.
  45. * @access public
  46. * @return boolean - TRUE if everything is OK
  47. */
  48. function update ($fieldName) {
  49. parent::update($fieldName);
  50. if ($this->getAllValues()) {
  51. // advance the step!
  52. $this->_stepContainer->previousStep();
  53. }
  54. }
  55. /**
  56. * Answers true if this component will be enabled.
  57. * @access public
  58. * @return boolean
  59. */
  60. function isEnabled () {
  61. return $this->_stepContainer->hasPrevious();
  62. }
  63.  
  64. }
  65.  
  66. ?>

Documentation generated on Wed, 19 Sep 2007 10:28:13 -0400 by phpDocumentor 1.3.0RC3