Source for file VerticalAlignSC.class.php

Documentation is available at VerticalAlignSC.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 VerticalAlignSC represents CSS vertical-align values. The allowed values are:
  8. * <ul style="font-family: monospace;">
  9. * <li> baseline </li>
  10. * <li> middle </li>
  11. * <li> top </li>
  12. * <li> bottom </li>
  13. * <li> text-top </li>
  14. * <li> text-bottom </li>
  15. * <li> super </li>
  16. * <li> sub </li>
  17. * <li> [specific value] - a length value (%, px, in, etc.) </li>
  18. * </ul>
  19. * <br /><br />
  20. * The <code>StyleComponent</code> (SC) is the most basic of the three building pieces
  21. * of CSS styles. It combines a CSS property value with a ValidatorRule to ensure that
  22. * the value follows a certain format.<br /><br />
  23. *
  24. * @package harmoni.gui.scs
  25. *
  26. * @copyright Copyright &copy; 2005, Middlebury College
  27. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  28. *
  29. * @version $Id: VerticalAlignSC.class.php,v 1.10 2007/09/04 20:25:23 adamfranco Exp $
  30. */
  31. class VerticalAlignSC extends StyleComponent {
  32.  
  33. /**
  34. * The constructor.
  35. * @param string value The value to assign to this SC.
  36. * @access public
  37. ***/
  38. function VerticalAlignSC($value) {
  39. $options = array("baseline","middle","top","bottom","text-top","text-bottom",
  40. "super","sub");
  41.  
  42. $errDescription = "Could not validate the vertical-align StyleComponent value \"%s\".
  43. Allowed values are: ".implode(", ", $options).", or a specific
  44. value (a length value, i.e. px, in, %, etc.).";
  45. $rule = CSSLengthValidatorRuleWithOptions::getRule($options);
  46. $displayName = "Vertical Alignment";
  47. $description = "Specifies the vertical-align value. Allowed values are:
  48. ".implode(", ", $options).", or a distance value
  49. (a length value, i.e. px, in, %, etc.).";
  50. $this->StyleComponent($value, $rule, $options, false, $errDescription, $displayName, $description);
  51. }
  52. }
  53.  
  54. ?>

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