Source for file SingleStepWizard.class.php

Documentation is available at SingleStepWizard.class.php

  1. <?php
  2. /**
  3. * @since 6/4/07
  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: SingleStepWizard.class.php,v 1.3 2007/09/19 14:04:50 adamfranco Exp $
  10. */
  11.  
  12. require_once(dirname(__FILE__)."/SimpleStepWizard.class.php");
  13.  
  14. /**
  15. * This is a single-step wizard. It operates just like the multiple-step wizard,
  16. * but doesn't have or allow more than one step.
  17. *
  18. * @since 6/4/07
  19. * @package polyphony.wizard
  20. *
  21. * @copyright Copyright &copy; 2005, Middlebury College
  22. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  23. *
  24. * @version $Id: SingleStepWizard.class.php,v 1.3 2007/09/19 14:04:50 adamfranco Exp $
  25. */
  26. class SingleStepWizard
  27. extends SimpleStepWizard
  28. {
  29. /**
  30. * Adds a new {@link WizardStep} to this wizard.
  31. * @param string $name A short id/name for this step.
  32. * @param ref object $step
  33. * @access public
  34. * @return ref object
  35. */
  36. function addStep ($name, $step) {
  37. if (count($this->getSteps())) {
  38. throwError(new Error("SingleStepWizards can only have one step. Cannot add '".$name."' step.", "Wizard"));
  39. }
  40. return parent::addStep($name, $step);
  41. }
  42. /**
  43. * Returns a new SimpleStepWizard with the default layout including all the buttons.
  44. * @param optional string $pre Some text to put before the layout text.
  45. * @access public
  46. * @return ref object
  47. * @static
  48. */
  49. function withDefaultLayout ($pre = '') {
  50. return parent::withText($pre .
  51. "<div>\n" .
  52. "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n" .
  53. "<tr>\n" .
  54. "<td align='left' width='50%'>\n" .
  55. "[[_cancel]]\n" .
  56. "</td>\n" .
  57. "<td align='right' width='50%'>\n" .
  58. "[[_save]]\n" .
  59. "</td></tr></table>" .
  60. "</div>\n" .
  61. "<hr/>\n" .
  62. "<div>\n" .
  63. "[[_steps]]" .
  64. "</div>\n", "SingleStepWizard");
  65. }
  66. }
  67.  
  68. ?>

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