Patrick POLBOS Posted February 18, 2018 Share Posted February 18, 2018 Bonsoir à tous, je galère depuis2 mois sur le code d'un module (Je me débrouille en CSS mais pour le reste c'est une autre histoire) J'ai isolé ce code qui permets d'afficher la liste de mes templates mais cette liste n'est pas trié par ordre alphabétique et je n'y parviens pas. Pourriez vous me guider, voici le code : // create template list for tinymce4 - Prestashop1.6 require_once(dirname(__FILE__) . '/../../config/config.inc.php'); $path = dirname(__FILE__)."/templates/"; $directory = dir($path); $list = '['; $separator = ''; while ($file = $directory->read()) { if (is_file( $path.$file ) ) { $name = explode(".",$file); if($name[1] == 'html') { $list .= $separator.'{title:"'.$name[0].'", url:"'._MODULE_DIR_.'extra_tab/templates/'.$file.'", description:"'.$name[0].'"}'; $separator = ','; } } } $directory->close(); $list .= ']'; echo $list; Merci d'avance et bonne soirée à tous Link to comment Share on other sites More sharing options...
Eolia Posted February 18, 2018 Share Posted February 18, 2018 (edited) - Code privé réservé aux acheteurs du module - Edited February 19, 2018 by Eolia (see edit history) Link to comment Share on other sites More sharing options...
Patrick POLBOS Posted February 19, 2018 Author Share Posted February 19, 2018 super, merci beaucoup et bonne journée Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now