1<?php 2// $Header: /cvsroot/html2ps/css.list-style-image.inc.php,v 1.6 2006/09/07 18:38:14 Konstantin Exp $ 3 4class CSSListStyleImage extends CSSSubFieldProperty { 5 /** 6 * CSS 2.1: default value for list-style-image is none 7 */ 8 function default_value() { 9 return new ListStyleImage(null, null); 10 } 11 12 function parse($value, &$pipeline) { 13 if ($value === 'inherit') { 14 return CSS_PROPERTY_INHERIT; 15 }; 16 17 global $g_config; 18 if (!$g_config['renderimages']) { 19 return CSSListStyleImage::default_value(); 20 }; 21 22 if (preg_match('/url\(([^)]+)\)/',$value, $matches)) { 23 $url = $matches[1]; 24 25 $full_url = $pipeline->guess_url(css_remove_value_quotes($url)); 26 return new ListStyleImage($full_url, 27 ImageFactory::get($full_url, $pipeline)); 28 }; 29 30 /** 31 * 'none' value and all unrecognized values 32 */ 33 return CSSListStyleImage::default_value(); 34 } 35 36 function get_property_code() { 37 return CSS_LIST_STYLE_IMAGE; 38 } 39 40 function get_property_name() { 41 return 'list-style-image'; 42 } 43} 44 45?>