1<?php 2// $Header: /cvsroot/html2ps/css.text-align.inc.php,v 1.10 2006/09/07 18:38:14 Konstantin Exp $ 3 4define('TA_LEFT',0); 5define('TA_RIGHT',1); 6define('TA_CENTER',2); 7define('TA_JUSTIFY',3); 8 9class CSSTextAlign extends CSSPropertyStringSet { 10 function CSSTextAlign() { 11 $this->CSSPropertyStringSet(true, 12 true, 13 array('inherit' => CSS_PROPERTY_INHERIT, 14 'left' => TA_LEFT, 15 'right' => TA_RIGHT, 16 'center' => TA_CENTER, 17 'middle' => TA_CENTER, 18 'justify' => TA_JUSTIFY)); 19 } 20 21 function default_value() { return TA_LEFT; } 22 23 function value2pdf($value) { 24 switch ($value) { 25 case TA_LEFT: 26 return "ta_left"; 27 case TA_RIGHT: 28 return "ta_right"; 29 case TA_CENTER: 30 return "ta_center"; 31 case TA_JUSTIFY: 32 return "ta_justify"; 33 default: 34 return "ta_left"; 35 } 36 } 37 38 function get_property_code() { 39 return CSS_TEXT_ALIGN; 40 } 41 42 function get_property_name() { 43 return 'text-align'; 44 } 45} 46 47CSS::register_css_property(new CSSTextAlign); 48 49?>