public static function tableau_reglages_GD() { $jpeg = (version_compare(PHP_VERSION,5.3,'<')) ? 'JPG' : 'JPEG' ; $tab_objets = array( 'GD Version' => 'Version', // 'FreeType Support' => 'Support FreeType', // Requis pour imagettftext() $jpeg.' Support' => 'Support JPEG', 'PNG Support' => 'Support PNG', 'GIF Read Support' => 'Support GIF', // "GIF Create Support" non testé car on n'écrit que des jpg (photos) et des png (étiquettes) de toutes façons. ); $tab_gd_options = gd_info(); // http://fr.php.net/manual/fr/function.gd-info.php $tab_tr = array(); foreach($tab_objets as $nom_objet => $nom_affichage) { if($nom_objet=='GD Version') { $search_version = preg_match( '/[0-9.]+/' , $tab_gd_options[$nom_objet] , $tab_match); $gd_version = ($search_version) ? $tab_match[0] : '' ; $img = ($nom_objet=='GD Version') ? '<img alt="" src="./_img/bulle_aide.png" width="16" height="16" title="La fonction imagecreatetruecolor() requiert la bibliothèque GD version 2.0.1 ou supérieure, 2.0.28 ou supérieure étant recommandée." /> ' : '' ; if(version_compare($gd_version,'2.0.28','>=')) $td = InfoServeur::cellule_coloree_centree($tab_gd_options[$nom_objet],'vert'); else if(version_compare($gd_version,'2.0.1' ,'>=')) $td = InfoServeur::cellule_coloree_centree($tab_gd_options[$nom_objet],'jaune'); else $td = InfoServeur::cellule_coloree_centree($tab_gd_options[$nom_objet],'rouge'); } else { $img = '' ; $td = ($tab_gd_options[$nom_objet]) ? InfoServeur::cellule_coloree_centree('ON','vert') : InfoServeur::cellule_coloree_centree('OFF','rouge') ; } $tab_tr[] = '<tr><td>'.$img.$nom_affichage.'</td>'.$td.'</tr>'; } return'<table class="p"><thead><tr><th colspan="2">Bibliothèque GD</th></tr></thead><tbody>'.implode('',$tab_tr).'</tbody></table>'; }