Source for file WComponentCollection.class.php

Documentation is available at WComponentCollection.class.php

  1. <?php
  2. /**
  3. * @since 7/21/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: WComponentCollection.class.php,v 1.4 2007/09/19 14:04:51 adamfranco Exp $
  10. */
  11.  
  12. /**
  13. * This allows for a grouping of Components. It is a single component itself that
  14. * wraps other components to allow for the addition of multiple components where
  15. * a single one is expected.
  16. *
  17. * @since 7/21/06
  18. * @package polyphony.wizard
  19. *
  20. * @copyright Copyright &copy; 2005, Middlebury College
  21. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  22. *
  23. * @version $Id: WComponentCollection.class.php,v 1.4 2007/09/19 14:04:51 adamfranco Exp $
  24. */
  25. class WComponentCollection
  26. extends WizardComponentWithChildren
  27. {
  28. /**
  29. * Sets this step's content text. This text will be parsed with {@link Wizard::parseText()}
  30. * @param string $content;
  31. * @access public
  32. * @return void
  33. */
  34. function setContent ($content) {
  35. $this->_contentText = $content;
  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. return Wizard::parseText($this->_contentText, $this->getChildren(), $fieldName."_");
  47. }
  48. /**
  49. * Set the value of the child components
  50. *
  51. * @param array $value
  52. * @access public
  53. * @return void
  54. */
  55. function setValue ($value) {
  56. ArgumentValidator::validate($value, ArrayValidatorRule::getRule());
  57. $children =$this->getChildren();
  58. foreach (array_keys($children) as $key) {
  59. if (isset($value[$key]))
  60. $children[$key]->setValue($value[$key]);
  61. }
  62. }
  63. }
  64.  
  65. ?>

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