Source for file WStyleCollection.class.php

Documentation is available at WStyleCollection.class.php

  1. <?php
  2. /**
  3. * @since 6/2/06
  4. * @package polyphony.wizard.components
  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: WStyleCollection.class.php,v 1.4 2007/09/19 14:04:51 adamfranco Exp $
  10. */
  11.  
  12. /**
  13. * a wizard representation for style collections
  14. *
  15. * @since 6/2/06
  16. * @package polyphony.wizard.components
  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: WStyleCollection.class.php,v 1.4 2007/09/19 14:04:51 adamfranco Exp $
  22. */
  23. class WStyleCollection extends WRepeatableComponentCollection {
  24. var $this->_addSP;
  25. var $this->_availableSPs;
  26. var $_SPs = array();
  27.  
  28. /**
  29. * constructor
  30. *
  31. * @param ref object StyleCollection $style
  32. * @return void
  33. * @access public
  34. * @since 6/2/06
  35. */
  36. function WStyleCollection ($style) {
  37. $gui = Services::getService("GUI");
  38. // grab the list of supported SPs
  39. $this->_supportedSPs = $gui->getSupportedSPs();
  40.  
  41. // grab the array of currently instantiated SPs
  42. $SPs =$style->getSPs();
  43. // make a list of SPs that can be added
  44. $this->_availableSPs = array_diff($this->_supportedSPs, array_keys($SPs));
  45. // initialize the array of SPs to the existant ones
  46. foreach (array_keys($SPs) as $key) {
  47. $this->_addSP($SPs[$key]);
  48. }
  49. }
  50. /**
  51. * sets the available SPs array
  52. *
  53. * @return void
  54. * @access public
  55. * @since 6/2/06
  56. */
  57. function updateAvailableSPs () {
  58. $this->_availableSPs = array_diff($this->_supportedSPs, array_keys($this->_collections));
  59. }
  60. /**
  61. * adds the wizard rep for the SP passed to the collection
  62. *
  63. * @param ref object StyleProperty
  64. * @return void
  65. * @access public
  66. * @since 6/2/06
  67. */
  68. function _addSP ($SP, $removable = 'true') {
  69. $this->_collections[get_class($SP)] = new WStyleProperty($SP);
  70. }
  71. }
  72.  
  73. ?>

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