Source for file AutoLengthSC.class.php

Documentation is available at AutoLengthSC.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 AutoLengthSC represents CSS "top", "left", "right", "bottom",
  8. * "width", and "height" values. The allowed values are:
  9. * <ul style="font-family: monospace;">
  10. * <li> auto </li>
  11. * <li> [specific length] - a length value (%, px, in, etc.) </li>
  12. * </ul>
  13. * <br /><br />
  14. * The <code>StyleComponent</code> (SC) is the most basic of the three building pieces
  15. * of CSS styles. It combines a CSS property value with a ValidatorRule to ensure that
  16. * the value follows a certain format.<br /><br />
  17. *
  18. * @package harmoni.gui.scs
  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: AutoLengthSC.class.php,v 1.11 2007/09/04 20:25:22 adamfranco Exp $
  24. */
  25. class AutoLengthSC extends StyleComponent {
  26.  
  27. /**
  28. * The constructor.
  29. * @param string value The value to assign to this SC.
  30. * @access public
  31. ***/
  32. function AutoLengthSC($value) {
  33. $options = array("auto");
  34.  
  35. $errDescription = "Could not validate the AutoLength StyleComponent value \"%s\".
  36. Allowed values are: ".implode(", ", $options).", or a specific
  37. value (a length value, i.e. px, in, %, etc.).";
  38. $rule = CSSLengthValidatorRuleWithOptions::getRule($options);
  39. $displayName = "AutoLength";
  40. $description = "Specifies the values for CSS properties 'top', 'left', 'right',
  41. 'bottom', 'width', and 'height'. Allowed values are:
  42. ".implode(", ", $options).", or a specific value
  43. (a length value, i.e. px, in, %, etc.).";
  44. $this->StyleComponent($value, $rule, $options, false, $errDescription, $displayName, $description);
  45. }
  46. }
  47. ?>

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