Merge pull request #7344 from atm-florian/6.0_fixphotocateg
6.0 fixphotocateg
This commit is contained in:
commit
23c5b0366f
@ -1540,17 +1540,30 @@ class Categorie extends CommonObject
|
|||||||
dol_mkdir($dir);
|
dol_mkdir($dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists($dir))
|
if (file_exists($dir)) {
|
||||||
{
|
if (is_array($file['name']) && count($file['name']) > 0) {
|
||||||
$originImage = $dir . $file['name'];
|
for($i = 0; $i <= count($file['name']); $i ++) {
|
||||||
|
|
||||||
// Cree fichier en taille origine
|
$originImage = $dir . $file['name'][$i];
|
||||||
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
|
|
||||||
|
|
||||||
if (file_exists($originImage))
|
// Cree fichier en taille origine
|
||||||
{
|
dol_move_uploaded_file($file['tmp_name'][$i], $originImage, 1, 0, 0);
|
||||||
// Create thumbs
|
|
||||||
$this->addThumbs($originImage);
|
if (file_exists($originImage)) {
|
||||||
|
// Create thumbs
|
||||||
|
$this->addThumbs($originImage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$originImage = $dir . $file['name'];
|
||||||
|
|
||||||
|
// Cree fichier en taille origine
|
||||||
|
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
|
||||||
|
|
||||||
|
if (file_exists($originImage)) {
|
||||||
|
// Create thumbs
|
||||||
|
$this->addThumbs($originImage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user