// Improve multishop API

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13566 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2012-02-23 15:39:44 +00:00
parent ec8f05c3ca
commit b24dcffc9c
71 changed files with 377 additions and 425 deletions
+4 -4
View File
@@ -128,12 +128,12 @@ class Watermark extends Module
Configuration::updateValue('WATERMARK_X_ALIGN', Tools::getValue('xalign'));
Configuration::updateValue('WATERMARK_TRANSPARENCY', Tools::getValue('transparency'));
if (Context::getContext()->shop->getContextType() == Shop::CONTEXT_SHOP)
if (Shop::getContext() == Shop::CONTEXT_SHOP)
$str_shop = '-'.(int)$this->context->shop->id;
else
$str_shop = '';
//submited watermark
if (isset($_FILES['PS_WATERMARK']) AND !empty($_FILES['PS_WATERMARK']['tmp_name']))
if (isset($_FILES['PS_WATERMARK']) && !empty($_FILES['PS_WATERMARK']['tmp_name']))
{
/* Check watermark validity */
if ($error = ImageManager::validateUpload($_FILES['PS_WATERMARK']))
@@ -154,7 +154,7 @@ class Watermark extends Module
{
$imageTypes = ImageType::getImagesTypes('products');
$str_shop = '-'.(int)$this->context->shop->id;
if (Context::getContext()->shop->getContextType() != Shop::CONTEXT_SHOP || !Tools::file_exists_cache(dirname(__FILE__).'/watermark'.$str_shop.'.gif'))
if (Shop::getContext() != Shop::CONTEXT_SHOP || !Tools::file_exists_cache(dirname(__FILE__).'/watermark'.$str_shop.'.gif'))
$str_shop = '';
$this->_html .=
@@ -239,7 +239,7 @@ class Watermark extends Module
$file = _PS_PROD_IMG_DIR_.$image->getExistingImgPath().'-watermark.jpg';
$str_shop = '-'.(int)$this->context->shop->id;
if (Context::getContext()->shop->getContextType() != Shop::CONTEXT_SHOP || !Tools::file_exists_cache(dirname(__FILE__).'/watermark'.$str_shop.'.gif'))
if (Shop::getContext() != Shop::CONTEXT_SHOP || !Tools::file_exists_cache(dirname(__FILE__).'/watermark'.$str_shop.'.gif'))
$str_shop = '';
//first make a watermark image