Il y a 18 heures, Asu34 a dit :
Ok mais je ne vais pas ré-écrire tout Phenix pour votre Windows...
Pour ce cas précis, il faut remplacer la fonction d'origine de AdminStatuses Controller.php par celle-ci:
protected function getTemplates()
{
$array = array();
foreach (Language::getLanguages(false) as $language) {
$iso_code = $language['iso_code'];
$directory = _PS_THEME_DIR_.'mails/'.$iso_code.'/*\.html';
if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$directory = _PS_THEME_DIR_.'mails\\'.$iso_code.'\\*.html';
}
$theme_paths = glob($directory);
$array[$iso_code][] = array(
'id' => '',
'name' => $this->l('Please select a template'),
'folder' => ''
);
foreach($theme_paths as $path) {
if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$template = str_replace(_PS_THEME_DIR_.'mails\\'.$iso_code.'\\', '', $path);
}
else {
$template = str_replace(_PS_THEME_DIR_.'mails/'.$iso_code.'/', '', $path);
}
$array[$iso_code][$template] = array(
'id' => substr($template, 0, -5),
'name' => substr($template, 0, -5),
'folder' => _THEME_DIR_.'mails/');
}
$directory = _PS_MAIL_DIR_.'mails/'.$iso_code.'/*\.html';
if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$directory = _PS_MAIL_DIR_.'mails\\'.$iso_code.'\\*.html';
}
$templates = glob($directory);
foreach($templates as $path) {
if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$template = str_replace(_PS_MAIL_DIR_.'mails\\'.$iso_code.'\\', '', $path);
}
else {
$template = str_replace(_PS_MAIL_DIR_.'mails/'.$iso_code.'/', '', $path);
}
if(!isset($array[$template]))
$array[$iso_code][$template] = array(
'id' => substr($template, 0, -5),
'name' => substr($template, 0, -5),
'folder' => _THEME_DIR_.'mails/');
}
}
return $array;
}
Parce que sous Linux, les séparateurs de fichiers c'est / et sous Windows c'est \