// Finish removing the "id_theme in ImageType" code
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13265 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+4
-6
@@ -233,13 +233,12 @@ class ImageCore extends ObjectModel
|
|||||||
$new_path = $image_new->getPathForCreation();
|
$new_path = $image_new->getPathForCreation();
|
||||||
foreach ($images_types as $image_type)
|
foreach ($images_types as $image_type)
|
||||||
{
|
{
|
||||||
$theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
|
if (file_exists(_PS_PROD_IMG_DIR_.$image_old->getExistingImgPath().'-'.$image_type['name'].'.jpg'))
|
||||||
if (file_exists(_PS_PROD_IMG_DIR_.$image_old->getExistingImgPath().'-'.$image_type['name'].$theme.'.jpg'))
|
|
||||||
{
|
{
|
||||||
if (!Configuration::get('PS_LEGACY_IMAGES'))
|
if (!Configuration::get('PS_LEGACY_IMAGES'))
|
||||||
$image_new->createImgFolder();
|
$image_new->createImgFolder();
|
||||||
copy(_PS_PROD_IMG_DIR_.$image_old->getExistingImgPath().'-'.$image_type['name'].$theme.'.jpg',
|
copy(_PS_PROD_IMG_DIR_.$image_old->getExistingImgPath().'-'.$image_type['name'].'.jpg',
|
||||||
$new_path.'-'.$image_type['name'].$theme.'.jpg');
|
$new_path.'-'.$image_type['name'].'.jpg');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (file_exists(_PS_PROD_IMG_DIR_.$image_old->getExistingImgPath().'.jpg'))
|
if (file_exists(_PS_PROD_IMG_DIR_.$image_old->getExistingImgPath().'.jpg'))
|
||||||
@@ -398,8 +397,7 @@ class ImageCore extends ObjectModel
|
|||||||
$image_types = ImageType::getImagesTypes();
|
$image_types = ImageType::getImagesTypes();
|
||||||
foreach ($image_types as $image_type)
|
foreach ($image_types as $image_type)
|
||||||
{
|
{
|
||||||
$theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
|
$files_to_delete[] = $this->image_dir.$this->getExistingImgPath().'-'.$image_type['name'].'.'.$this->image_format;
|
||||||
$files_to_delete[] = $this->image_dir.$this->getExistingImgPath().'-'.$image_type['name'].$theme.'.'.$this->image_format;
|
|
||||||
}
|
}
|
||||||
// Delete watermark image
|
// Delete watermark image
|
||||||
$files_to_delete[] = $this->image_dir.$this->getExistingImgPath().'-watermark.'.$this->image_format;
|
$files_to_delete[] = $this->image_dir.$this->getExistingImgPath().'-watermark.'.$this->image_format;
|
||||||
|
|||||||
@@ -580,14 +580,14 @@ class AdminCategoriesControllerCore extends AdminController
|
|||||||
$images_types = ImageType::getImagesTypes('categories');
|
$images_types = ImageType::getImagesTypes('categories');
|
||||||
foreach ($images_types as $k => $image_type)
|
foreach ($images_types as $k => $image_type)
|
||||||
{
|
{
|
||||||
$theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
|
|
||||||
ImageManager::resize(
|
ImageManager::resize(
|
||||||
_PS_CAT_IMG_DIR_.$id_category.'.jpg',
|
_PS_CAT_IMG_DIR_.$id_category.'.jpg',
|
||||||
_PS_CAT_IMG_DIR_.$id_category.'-'.stripslashes($image_type['name']).$theme.'.jpg',
|
_PS_CAT_IMG_DIR_.$id_category.'-'.stripslashes($image_type['name']).'.jpg',
|
||||||
(int)$image_type['width'], (int)$image_type['height']
|
(int)$image_type['width'], (int)$image_type['height']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -772,8 +772,7 @@ class AdminImportControllerCore extends AdminController
|
|||||||
$images_types = ImageType::getImagesTypes($entity);
|
$images_types = ImageType::getImagesTypes($entity);
|
||||||
foreach ($images_types as $k => $image_type)
|
foreach ($images_types as $k => $image_type)
|
||||||
{
|
{
|
||||||
$theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
|
ImageManager::resize($tmpfile, $path.'-'.stripslashes($image_type['name']).'.jpg', $image_type['width'], $image_type['height']);
|
||||||
ImageManager::resize($tmpfile, $path.'-'.stripslashes($image_type['name']).$theme.'.jpg', $image_type['width'], $image_type['height']);
|
|
||||||
}
|
}
|
||||||
if (in_array($image_type['id_image_type'], $watermark_types))
|
if (in_array($image_type['id_image_type'], $watermark_types))
|
||||||
Hook::exec('actionWatermark', array('id_image' => $id_image, 'id_product' => $id_entity));
|
Hook::exec('actionWatermark', array('id_image' => $id_image, 'id_product' => $id_entity));
|
||||||
|
|||||||
@@ -432,12 +432,11 @@ class AdminLanguagesControllerCore extends AdminController
|
|||||||
$images_types = ImageType::getImagesTypes('products');
|
$images_types = ImageType::getImagesTypes('products');
|
||||||
foreach ($images_types as $k => $image_type)
|
foreach ($images_types as $k => $image_type)
|
||||||
{
|
{
|
||||||
$theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
|
if (!ImageManager::resize($tmp_name, _PS_IMG_DIR_.'p/'.$language.'-default-'.stripslashes($image_type['name']).'.jpg', $image_type['width'], $image_type['height']))
|
||||||
if (!ImageManager::resize($tmp_name, _PS_IMG_DIR_.'p/'.$language.'-default-'.stripslashes($image_type['name']).$theme.'.jpg', $image_type['width'], $image_type['height']))
|
|
||||||
$this->errors[] = Tools::displayError('An error occurred while resizing no-picture image to your product directory.');
|
$this->errors[] = Tools::displayError('An error occurred while resizing no-picture image to your product directory.');
|
||||||
if (!ImageManager::resize($tmp_name, _PS_IMG_DIR_.'c/'.$language.'-default-'.stripslashes($image_type['name']).$theme.'.jpg', $image_type['width'], $image_type['height']))
|
if (!ImageManager::resize($tmp_name, _PS_IMG_DIR_.'c/'.$language.'-default-'.stripslashes($image_type['name']).'.jpg', $image_type['width'], $image_type['height']))
|
||||||
$this->errors[] = Tools::displayError('An error occurred while resizing no-picture image to your category directory.');
|
$this->errors[] = Tools::displayError('An error occurred while resizing no-picture image to your category directory.');
|
||||||
if (!ImageManager::resize($tmp_name, _PS_IMG_DIR_.'m/'.$language.'-default-'.stripslashes($image_type['name']).$theme.'.jpg', $image_type['width'], $image_type['height']))
|
if (!ImageManager::resize($tmp_name, _PS_IMG_DIR_.'m/'.$language.'-default-'.stripslashes($image_type['name']).'.jpg', $image_type['width'], $image_type['height']))
|
||||||
$this->errors[] = Tools::displayError('An error occurred while resizing no-picture image to your manufacturer directory.');
|
$this->errors[] = Tools::displayError('An error occurred while resizing no-picture image to your manufacturer directory.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -685,10 +685,9 @@ class AdminManufacturersControllerCore extends AdminController
|
|||||||
$images_types = ImageType::getImagesTypes('manufacturers');
|
$images_types = ImageType::getImagesTypes('manufacturers');
|
||||||
foreach ($images_types as $k => $image_type)
|
foreach ($images_types as $k => $image_type)
|
||||||
{
|
{
|
||||||
$theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
|
|
||||||
ImageManager::resize(
|
ImageManager::resize(
|
||||||
_PS_MANU_IMG_DIR_.$id_manufacturer.'.jpg',
|
_PS_MANU_IMG_DIR_.$id_manufacturer.'.jpg',
|
||||||
_PS_MANU_IMG_DIR_.$id_manufacturer.'-'.stripslashes($image_type['name']).$theme.'.jpg',
|
_PS_MANU_IMG_DIR_.$id_manufacturer.'-'.stripslashes($image_type['name']).'.jpg',
|
||||||
(int)$image_type['width'],
|
(int)$image_type['width'],
|
||||||
(int)$image_type['height']
|
(int)$image_type['height']
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -647,7 +647,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
if (!empty($is_virtual))
|
if (!empty($is_virtual))
|
||||||
Product::updateIsVirtual($product->id);
|
Product::updateIsVirtual($product->id);
|
||||||
|
|
||||||
$this->redirect_after = self::$currentIndex.'&id_product='.$product->id.(Tools::getIsset('id_category') ? '&id_category='.(int)Tools::getValue('id_category') : '').'&add'.$this->table.'&conf=4&action=Combinations&token='.($token ? $token : $this->token);
|
//$this->redirect_after = self::$currentIndex.'&id_product='.$product->id.(Tools::getIsset('id_category') ? '&id_category='.(int)Tools::getValue('id_category') : '').'&add'.$this->table.'&conf=4&action=Combinations&token='.($token ? $token : $this->token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -997,6 +997,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
// And if still not set, use default
|
// And if still not set, use default
|
||||||
if (!$this->tab_display)
|
if (!$this->tab_display)
|
||||||
$this->tab_display = $this->default_tab;
|
$this->tab_display = $this->default_tab;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1359,8 +1360,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
$imagesTypes = ImageType::getImagesTypes('products');
|
$imagesTypes = ImageType::getImagesTypes('products');
|
||||||
foreach ($imagesTypes as $k => $image_type)
|
foreach ($imagesTypes as $k => $image_type)
|
||||||
{
|
{
|
||||||
$theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
|
if (!ImageManager::resize($tmpName, $new_path.'-'.stripslashes($image_type['name']).'.'.$image->image_format, $image_type['width'], $image_type['height'], $image->image_format))
|
||||||
if (!ImageManager::resize($tmpName, $new_path.'-'.stripslashes($image_type['name']).$theme.'.'.$image->image_format, $image_type['width'], $image_type['height'], $image->image_format))
|
|
||||||
$this->errors[] = Tools::displayError('An error occurred while copying image:').' '.stripslashes($image_type['name']);
|
$this->errors[] = Tools::displayError('An error occurred while copying image:').' '.stripslashes($image_type['name']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1481,7 +1481,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
$this->processWarehouses($token);
|
$this->processWarehouses($token);
|
||||||
$this->processFeatures($token);
|
$this->processFeatures($token);
|
||||||
$this->processProductAttribute($token);
|
$this->processProductAttribute($token);
|
||||||
|
//d($this->redirect_after);
|
||||||
if (!$this->updatePackItems($object))
|
if (!$this->updatePackItems($object))
|
||||||
$this->errors[] = Tools::displayError('An error occurred while adding products to the pack.');
|
$this->errors[] = Tools::displayError('An error occurred while adding products to the pack.');
|
||||||
elseif (!$object->updateCategories(Tools::getValue('categoryBox'), true))
|
elseif (!$object->updateCategories(Tools::getValue('categoryBox'), true))
|
||||||
|
|||||||
@@ -72,13 +72,13 @@ class AdminScenesControllerCore extends AdminController
|
|||||||
if ($obj->id && (isset($_FILES['image']) || isset($_FILES['thumb'])))
|
if ($obj->id && (isset($_FILES['image']) || isset($_FILES['thumb'])))
|
||||||
{
|
{
|
||||||
$images_types = ImageType::getImagesTypes('scenes');
|
$images_types = ImageType::getImagesTypes('scenes');
|
||||||
|
|
||||||
foreach ($images_types as $k => $image_type)
|
foreach ($images_types as $k => $image_type)
|
||||||
{
|
{
|
||||||
$theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
|
|
||||||
if ($image_type['name'] == 'large_scene' && isset($_FILES['image']))
|
if ($image_type['name'] == 'large_scene' && isset($_FILES['image']))
|
||||||
ImageManager::resize(
|
ImageManager::resize(
|
||||||
$_FILES['image']['tmp_name'],
|
$_FILES['image']['tmp_name'],
|
||||||
_PS_SCENE_IMG_DIR_.$obj->id.'-'.stripslashes($image_type['name']).$theme.'.jpg',
|
_PS_SCENE_IMG_DIR_.$obj->id.'-'.stripslashes($image_type['name']).'.jpg',
|
||||||
(int)$image_type['width'],
|
(int)$image_type['width'],
|
||||||
(int)$image_type['height']
|
(int)$image_type['height']
|
||||||
);
|
);
|
||||||
@@ -90,13 +90,14 @@ class AdminScenesControllerCore extends AdminController
|
|||||||
$tmp_name = $_FILES['image']['tmp_name'];
|
$tmp_name = $_FILES['image']['tmp_name'];
|
||||||
ImageManager::resize(
|
ImageManager::resize(
|
||||||
$tmp_name,
|
$tmp_name,
|
||||||
_PS_SCENE_THUMB_IMG_DIR_.$obj->id.'-'.stripslashes($image_type['name']).$theme.'.jpg',
|
_PS_SCENE_THUMB_IMG_DIR_.$obj->id.'-'.stripslashes($image_type['name']).'.jpg',
|
||||||
(int)$image_type['width'],
|
(int)$image_type['width'],
|
||||||
(int)$image_type['height']
|
(int)$image_type['height']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -375,9 +375,8 @@ class AdminStoresControllerCore extends AdminController
|
|||||||
$images_types = ImageType::getImagesTypes('stores');
|
$images_types = ImageType::getImagesTypes('stores');
|
||||||
foreach ($images_types as $k => $image_type)
|
foreach ($images_types as $k => $image_type)
|
||||||
{
|
{
|
||||||
$theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
|
|
||||||
ImageManager::resize(_PS_STORE_IMG_DIR_.$id_store.'.jpg',
|
ImageManager::resize(_PS_STORE_IMG_DIR_.$id_store.'.jpg',
|
||||||
_PS_STORE_IMG_DIR_.$id_store.'-'.stripslashes($image_type['name']).$theme.'.jpg',
|
_PS_STORE_IMG_DIR_.$id_store.'-'.stripslashes($image_type['name']).'.jpg',
|
||||||
(int)$image_type['width'], (int)$image_type['height']
|
(int)$image_type['width'], (int)$image_type['height']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user