// Update image when updated
This commit is contained in:
@@ -718,6 +718,11 @@ class AdminManufacturersControllerCore extends AdminController
|
||||
(int)$image_type['height']
|
||||
);
|
||||
}
|
||||
|
||||
$current_logo_file = _PS_TMP_IMG_DIR_.'manufacturer_mini_'.$id_manufacturer.'_'.$this->context->shop->id.'.jpg';
|
||||
|
||||
if ($res && file_exists($current_logo_file))
|
||||
unlink($current_logo_file);
|
||||
}
|
||||
|
||||
if (!$res)
|
||||
@@ -725,7 +730,7 @@ class AdminManufacturersControllerCore extends AdminController
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
protected function beforeDelete($object)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -539,4 +539,20 @@ class AdminStatusesControllerCore extends AdminController
|
||||
$this->initOrdersReturnsList();
|
||||
return parent::filterToField($key, $filter);
|
||||
}
|
||||
|
||||
protected function afterImageUpload()
|
||||
{
|
||||
parent::afterImageUpload();
|
||||
|
||||
if (($id_order_state = (int)Tools::getValue('id_order_state')) &&
|
||||
isset($_FILES) && count($_FILES) && file_exists(_PS_ORDER_STATE_IMG_DIR_.$id_order_state.'.gif'))
|
||||
{
|
||||
$current_file = _PS_TMP_IMG_DIR_.'order_state_mini_'.$id_order_state.'_'.$this->context->shop->id.'.gif';
|
||||
|
||||
if (file_exists($current_file))
|
||||
unlink($current_file);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,6 +354,11 @@ class AdminSuppliersControllerCore extends AdminController
|
||||
if (!ImageManager::resize($file, _PS_SUPP_IMG_DIR_.$id_supplier.'-'.stripslashes($image_type['name']).'.jpg', (int)$image_type['width'], (int)$image_type['height']))
|
||||
$return = false;
|
||||
}
|
||||
|
||||
$current_logo_file = _PS_TMP_IMG_DIR_.'supplier_mini_'.$id_supplier.'_'.$this->context->shop->id.'.jpg';
|
||||
|
||||
if (file_exists($current_logo_file))
|
||||
unlink($current_logo_file);
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user