Source for file LogicStepWizard.class.php

Documentation is available at LogicStepWizard.class.php

  1. <?php
  2. /**
  3. * @since 5/31/06
  4. * @package polyphony.wizard
  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: LogicStepWizard.class.php,v 1.8 2007/09/19 14:04:50 adamfranco Exp $
  10. */
  11.  
  12. /**
  13. * A step wizard that allows for complexities beyond a linear path of steps
  14. *
  15. * @since 5/31/06
  16. * @package polyphony.wizard
  17. *
  18. * @copyright Copyright &copy; 2005, Middlebury College
  19. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  20. *
  21. * @version $Id: LogicStepWizard.class.php,v 1.8 2007/09/19 14:04:50 adamfranco Exp $
  22. */
  23. require_once(POLYPHONY."/main/library/Wizard/StepWizard.abstract.php");
  24. require_once(POLYPHONY."/main/library/Wizard/Components/WLogicStepContainer.class.php");
  25. require_once(POLYPHONY."/main/library/Wizard/Components/WSaveContinueButton.class.php");
  26. require_once(POLYPHONY."/main/library/Wizard/Components/WBackButton.class.php");
  27. require_once(POLYPHONY."/main/library/Wizard/Components/WForwardButton.class.php");
  28. require_once(POLYPHONY."/main/library/Wizard/Components/WLogicButton.class.php");
  29. require_once(POLYPHONY."/main/library/Wizard/Components/WCallbackButton.class.php");
  30. require_once(POLYPHONY."/main/library/Wizard/Components/WDynamicStep.class.php");
  31.  
  32.  
  33. class LogicStepWizard extends StepWizard {
  34. //var $_saveContinueButton;
  35. var $_backButton;
  36. var $_forwardButton;
  37.  
  38. /**
  39. * Constructor
  40. *
  41. * @return void
  42. * @access public
  43. * @since 5/31/06
  44. */
  45. function LogicStepWizard () {
  46. $this->_stepContainer = new WLogicStepContainer();
  47. $this->addComponent('_steps', $this->_stepContainer);
  48. //$this->_saveContinueButton = new WSaveContinueButton($this->_stepContainer);
  49. //$this->_nextButton = new WNextStepButton($this->_stepContainer);
  50. $this->_backButton = new WBackButton($this->_stepContainer);
  51. $this->_forwardButton = new WForwardButton($this->_stepContainer);
  52. $this->_cancelButton = new WCancelButton();
  53. $this->_saveButton = new WSaveButton();
  54.  
  55.  
  56. //$this->addComponent('_saveContinue', $this->_saveContinueButton);
  57. //$this->addComponent('_next', $this->_nextButton);
  58. $this->addComponent('_back', $this->_backButton);
  59. $this->addComponent('_forward', $this->_forwardButton);
  60. $this->addComponent('_cancel', $this->_cancelButton);
  61. $this->addComponent('_save', $this->_saveButton);
  62.  
  63. }
  64. /**
  65. * Returns a new LogicStepWizard with the layout defined as passed. The layout
  66. * may include any of the following tags:
  67. *
  68. * _saveContinue - a next button that saves changes
  69. * _cancelContinue - a next button that does not save changes
  70. * _steps - the place where the current step content will go
  71. * _cancel - the next step button
  72. * _save - the previous step button
  73. * @access public
  74. * @param string $text
  75. * @return ref object
  76. * @static
  77. */
  78. function withText ($text) {
  79. return parent::withText($text, 'LogicStepWizard');
  80. }
  81. /**
  82. * Set the required steps for this wizard
  83. *
  84. * @access public
  85. * @param array $arrayOfSteps
  86. * $return void
  87. */
  88. function setRequiredSteps($arrayOfSteps) {
  89. $this->_stepContainer->setRequiredSteps($arrayOfSteps);
  90. }
  91. /**
  92. * Get the step container for this wizard
  93. *
  94. * @access public
  95. * $return object WLogicStepContainer
  96. */
  97. function getStepContainer(){
  98. return $this->_stepContainer;
  99. }
  100.  
  101. function withDefaultLayout ($pre = '') {
  102. return parent::withText($pre .
  103. "<div>\n" .
  104. "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n" .
  105. "<tr>\n" .
  106. "<td align='left' width='33%'>\n" .
  107. "[[_back]]\n" .
  108. "[[_forward]]" .
  109. "</td>\n" .
  110. "<td align='center' width='34%'>\n" .
  111. "[[_save]]\n" .
  112. "[[_cancel]]" .
  113. "</td>\n" .
  114. "<td align='right' width='34%'>\n" .
  115. "&nbsp" .
  116. "</td>\n" .
  117. "</tr></table>" .
  118. "</div>\n" .
  119. "<hr/>\n" .
  120. "<div>\n" .
  121. "[[_steps]]" .
  122. "</div>\n", "LogicStepWizard");
  123. }
  124. }
  125.  
  126. ?>

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