Source for file SimpleWizard.class.php

Documentation is available at SimpleWizard.class.php

  1. <?php
  2.  
  3. /**
  4. * @since Jul 19, 2005
  5. * @package polyphony.wizard
  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: SimpleWizard.class.php,v 1.7 2007/09/19 14:04:50 adamfranco Exp $
  11. */
  12.  
  13. require_once(POLYPHONY."/main/library/Wizard/Wizard.abstract.php");
  14.  
  15. /**
  16. * The SimpleWizard is a {@link WizardClass} which contains children and a block of formatting text in which to include those children.
  17. *
  18. * @since Jul 19, 2005
  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: SimpleWizard.class.php,v 1.7 2007/09/19 14:04:50 adamfranco Exp $
  25. */
  26. class SimpleWizard extends Wizard {
  27. var $_text;
  28. /**
  29. * Returns a new SimpleWizard object with the text supplied.
  30. * @static
  31. * @param string $text
  32. * @access public
  33. * @return ref object
  34. */
  35. function withText ($text, $class = 'SimpleWizard') {
  36. $obj = new $class();
  37. $obj->_text = $text;
  38. return $obj;
  39. }
  40. /**
  41. * Returns a block of XHTML-valid code that contains markup for this specific
  42. * component.
  43. * @param string $fieldName The field name to use when outputting form data or
  44. * similar parameters/information.
  45. * @access public
  46. * @return string
  47. */
  48. function getMarkup ($fieldName) {
  49. $fromParent = parent::getMarkup($fieldName);
  50. // make sure that we add the form info to the markup
  51. $harmoni = Harmoni::instance();
  52. $urlObj =$harmoni->request->mkURL();
  53. $url = $urlObj->write();
  54. $formName = $this->getWizardFormName();
  55. $pre = "<form action='$url' method='post' name='$formName' id='$formName' enctype='multipart/form-data'>\n";
  56. $post = "\n</form>\n";
  57. // ignore the field name
  58. return $fromParent . $pre.Wizard::parseText($this->_text, $this->getChildren(), $this->getIdString()."_").$post;
  59. }
  60. }
  61.  
  62. ?>

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