Source for file WDynamicStep.class.php

Documentation is available at WDynamicStep.class.php

  1. <?php
  2. /**
  3. * @package polyphony.wizard
  4. *
  5. * @copyright Copyright &copy; 2005, Middlebury College
  6. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  7. *
  8. * @version $Id: WDynamicStep.class.php,v 1.3 2007/09/19 14:04:51 adamfranco Exp $
  9. */
  10.  
  11. require_once(POLYPHONY."/main/library/Wizard/Components/WizardStep.class.php");
  12.  
  13. /**
  14. * The Wizard class provides a system for registering Wizard properties and
  15. * associating those properties with the appropriate form elements.
  16. *
  17. * @package polyphony.wizard
  18. *
  19. * @copyright Copyright &copy; 2005, Middlebury College
  20. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  21. *
  22. * @version $Id: WDynamicStep.class.php,v 1.3 2007/09/19 14:04:51 adamfranco Exp $
  23. * @author Gabe Schine
  24. */
  25. class WDynamicStep extends WizardStep {
  26. var $_callBack="";
  27.  
  28. /**
  29. * Sets the callback function of this dynamic wizard step
  30. * @param string $displayName
  31. * @return void
  32. */
  33. function setDynamicFunction($function) {
  34. $this->_callBack = $function;
  35. }
  36.  
  37. /**
  38. * Returns a block of XHTML-valid code that contains markup for this specific
  39. * component.
  40. * @param string $fieldName The field name to use when outputting form data or
  41. * similar parameters/information.
  42. * @access public
  43. * @return string
  44. */
  45. function getMarkup ($fieldName) {
  46. if($this->_callBack!=""){
  47. $code = '$this->_contentText = '.$this->_callBack.'($this);';
  48. eval($code);
  49. }
  50. return Wizard::parseText($this->_contentText, $this->getChildren(), $fieldName."_");
  51. }
  52. /**
  53. * Sets a {@link WizardComponent} to this component, and returns the newly added component.
  54. * This is actually the same as addComponent, but the name makes a little more sense.
  55. *
  56. * @param string $name The short-string name of the component - this is used for creating form input field names and storing data.
  57. * @param ref object $component A {@link WizardComponent} to add.
  58. * @access public
  59. * @return ref object
  60. */
  61. function setComponent ($name, $component) {
  62. return $this->addComponent($name,$component);
  63. }
  64. }
  65.  
  66. ?>

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