Source for file WNextStepButton.class.php

Documentation is available at WNextStepButton.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: WNextStepButton.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 "Next" button to the wizard and throws the appropriate event.
  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: WNextStepButton.class.php,v 1.8 2007/09/19 14:04:51 adamfranco Exp $
  24. */
  25. class WNextStepButton
  26. extends WEventButton
  27. {
  28.  
  29. var $_stepContainer;
  30. /**
  31. * Constructor
  32. * @param ref object $stepContainer A {@link WizardStepContainer} object.
  33. * @access public
  34. * @return void
  35. */
  36. function WNextStepButton ($stepContainer, $label = null) {
  37. if(is_null($label)){
  38. $label = dgettext("polyphony", "Next");
  39. }
  40. $this->setLabel($label);
  41. $this->_stepContainer =$stepContainer;
  42. }
  43. /**
  44. * Tells the wizard component to update itself - this may include getting
  45. * form post data or validation - whatever this particular component wants to
  46. * do every pageload.
  47. * @param string $fieldName The field name to use when outputting form data or
  48. * similar parameters/information.
  49. * @access public
  50. * @return boolean - TRUE if everything is OK
  51. */
  52. function update ($fieldName) {
  53. parent::update($fieldName);
  54. if ($this->getAllValues()) {
  55. // advance the step!
  56. $this->_stepContainer->nextStep();
  57. }
  58. }
  59. /**
  60. * Answers true if this component will be enabled.
  61. * @access public
  62. * @return boolean
  63. */
  64. function isEnabled () {
  65. return $this->_stepContainer->hasNext();
  66. }
  67.  
  68. }
  69.  
  70. ?>

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