Source for file WStepChangedListener.class.php

Documentation is available at WStepChangedListener.class.php

  1. <?php
  2.  
  3. /**
  4. * @since Jul 22, 2005
  5. * @package polyphony.wizard.components
  6. *
  7. * @copyright Copyright &copy; 2005, Middlebury College
  8. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  9. *
  10. * @version $Id: WStepChangedListener.class.php,v 1.4 2007/09/19 14:04:51 adamfranco Exp $
  11. */
  12.  
  13. require_once(POLYPHONY."/main/library/Wizard/Components/WizardEventListener.abstract.php");
  14.  
  15. /**
  16. * Supplies an event listener to a {@link Wizard} for update events, this will
  17. * pass the control back to the wizard if it would like it.
  18. *
  19. * @since Jul 22, 2005
  20. * @package polyphony.wizard.components
  21. *
  22. * @copyright Copyright &copy; 2005, Middlebury College
  23. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  24. *
  25. * @version $Id: WStepChangedListener.class.php,v 1.4 2007/09/19 14:04:51 adamfranco Exp $
  26. */
  27. class WStepChangedListener
  28. extends WizardEventListener
  29. /* implements EventListener */
  30. {
  31. var $_added = false;
  32. var $_callBackFunction;
  33. /**
  34. * constructor
  35. *
  36. * @param string $callBack the function to call when the event is called
  37. * @access public
  38. * @since 8/04/06
  39. */
  40. function WStepChangedListener ($callBack) {
  41. $this->_callBackFunction = $callBack;
  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. $this->_attemptAdding();
  54. }
  55. /**
  56. * Returns the values of wizard-components. Should return an array if children are involved,
  57. * otherwise a whatever type of object is expected.
  58. * @access public
  59. * @return mixed
  60. */
  61. function getAllValues () {
  62. return null;
  63. }
  64. /**
  65. * Handles an event triggered by an {@link EventTrigger}. The event type is passed in case this
  66. * particular EventListener is handling more than one type of event.
  67. * @param string $eventType
  68. * @param ref object $source The source object of the event.
  69. * @param array $context An array of contextual parameters - the content will be dependent on the thrown event.
  70. * @access public
  71. * @return void
  72. */
  73. function handleEvent ($eventType, $source, $context) {
  74. if ($eventType == 'edu.middlebury.polyphony.wizard.step_changed'){
  75. $action = $this->_callBackFunction.'($source, $context);';
  76. eval($action);
  77. }
  78. }
  79. }
  80. ?>

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