Ticket #591: image.diff
| File image.diff, 1.3 kB (added by Lipki, 6 months ago) |
|---|
-
function.image.php
old new 34 34 * sopacity :uint 35 35 * scolor #000000 :string 36 36 * background #000000 :string 37 * notexists :boolean [true|false|alternate uri] 37 38 * 38 39 * gif -> image/gif 39 40 * jpeg -> image/jpeg … … 64 65 $params['background'] = '#ffffff'; 65 66 } 66 67 68 // if not exists 69 $origine_src = JELIX_APP_WWW_PATH.$src; 70 if( empty($params['notexists']) ) $params['notexists'] = false; 71 if( !is_file( $origine_src ) && $params['notexists'] && is_string ( $params['notexists'] ) ) 72 $src = $params['notexists']; 73 67 74 // Name of the file cache 68 75 $chaine = $src; 69 76 foreach($params as $key => $value) … … 103 110 $att['src'] = $cache_www; 104 111 105 112 // Tag image 106 echo '<img'; 107 foreach( $att as $key => $val ) 108 if( !empty($val) ) 109 echo ' '.$key.'="'.$val.'"'; 110 echo '/>'; 113 if( $params['notexists'] !== true || is_file( $origine_src ) ) { 114 echo '<img'; 115 foreach( $att as $key => $val ) 116 if( !empty($val) ) 117 echo ' '.$key.'="'.$val.'"'; 118 echo '/>'; 119 } 111 120 112 }121 } 113 122 114 123 function jtpl_function_html_image_inCache($src, $cachename, $array) { 115 124
