Source for file RepeatSC.class.php

Documentation is available at RepeatSC.class.php

  1. <?php
  2.  
  3. require_once(HARMONI."GUIManager/StyleComponent.class.php");
  4. require_once(HARMONI."GUIManager/StyleComponents/LengthSC.class.php");
  5.  
  6. /**
  7. * The RepeatSC represents CSS "repeat" value. The allowed values are:
  8. * <ul style="font-family: monospace;">
  9. * <li> repeat </li>
  10. * <li> repeat-x </li>
  11. * <li> repeat-y </li>
  12. * <li> no-repeat </li>
  13. * </ul>
  14. * <br /><br />
  15. * The <code>StyleComponent</code> (SC) is the most basic of the three building pieces
  16. * of CSS styles. It combines a CSS property value with a ValidatorRule to ensure that
  17. * the value follows a certain format.<br /><br />
  18. *
  19. * @package harmoni.gui.scs
  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: RepeatSC.class.php,v 1.5 2006/08/15 20:44:58 sporktim Exp $
  25. */
  26. class RepeatSC extends StyleComponent {
  27.  
  28. /**
  29. * The constructor.
  30. * @param string value The value to assign to this SC.
  31. * @access public
  32. ***/
  33. function RepeatSC($value) {
  34. $options = array("repeat","repeat-x","repeat-y","no-repeat");
  35.  
  36. $errDescription = "Could not validate the Repeat StyleComponent value \"%s\".
  37. Allowed values are: ".implode(", ", $options).".";
  38. $displayName = "Repeat";
  39. $description = "Specifies the values for CSS property 'repeat'. Allowed values are:
  40. ".implode(", ", $options).".";
  41. $rule = RegexValidatorRule::getRuleByArray($options);
  42. $this->StyleComponent($value, $rule, $options, true, $errDescription, $displayName, $description);
  43. }
  44. }
  45. ?>

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