Source for file WGUISelectList.class.php

Documentation is available at WGUISelectList.class.php

  1. <?php
  2. /**
  3. * @since 8/14/2006
  4. * @package polyphony.guiwizardcomponents
  5. *
  6. * @copyright Copyright &copy; 2006, Middlebury College
  7. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  8. *
  9. * @version $Id: WGUISelectList.class.php,v 1.3 2007/09/19 14:04:45 adamfranco Exp $
  10. */
  11.  
  12.  
  13.  
  14. /**
  15. * This class make a selectlist associated with a style property
  16. *
  17. * @since 8/14/2006
  18. * @package polyphony.guiwizardcomponents
  19. *
  20. * @copyright Copyright &copy; 2006, Middlebury College
  21. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  22. *
  23. * @version $Id: WGUISelectList.class.php,v 1.3 2007/09/19 14:04:45 adamfranco Exp $
  24. */
  25. class WGUISelectList
  26. extends WGUIComponent
  27. {
  28.  
  29. /**
  30. * Creates the component.
  31. *
  32. * styles can be an array indexed just as options is with styles as strings, can be set to a string to describe
  33. * the appropriate style property to automatically generate styles, or set to false to just leave them off.
  34. */
  35. function WGUISelectList($callBack, $collectionSelector, $styleProperty, $componentClass, $options, $styles = false){
  36. $input = new WSelectList();
  37. foreach ($options as $opt=>$name) {
  38. if($styles){
  39. if(is_array($styles)){
  40. $input->addOption($opt, $name, $styles[$opt]);
  41. }else{
  42. $input->addOption($opt, $name, $styles.": ".$opt.";");
  43. }
  44. }else{
  45. $input->addOption($opt, $name);
  46. }
  47. }
  48. $this->_wizardComponent =$input;
  49. $this->init($callBack, $collectionSelector, $styleProperty, $componentClass);
  50. }
  51. /**
  52. * copy the value of the Wizard component to the StyleComponent
  53. */
  54. function exportValue(){
  55. $styleComponent =$this->getStyleComponent();
  56. $val = $this->_wizardComponent->getAllValues();
  57. $styleComponent->setValue($val);
  58. }
  59. /**
  60. * Is $value a legitamate value for this wizard component?
  61. *
  62. * @param string $value the value to test
  63. * @return boolean if the value is legitimate
  64. */
  65. function isPossibleValue($value){
  66. return $this->_wizardComponent->isOption($value);
  67. }
  68. }
  69.  
  70. ?>

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