diff --git a/admin-dev/themes/default/template/controllers/import/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/import/helpers/view/view.tpl
index 3094c75e2..6e12aa6de 100644
--- a/admin-dev/themes/default/template/controllers/import/helpers/view/view.tpl
+++ b/admin-dev/themes/default/template/controllers/import/helpers/view/view.tpl
@@ -29,6 +29,7 @@
{block name="override_tpl"}
{l s='View your data'}
diff --git a/classes/ImageManager.php b/classes/ImageManager.php
index 9e3228cfa..02b31a077 100644
--- a/classes/ImageManager.php
+++ b/classes/ImageManager.php
@@ -114,7 +114,7 @@ class ImageManagerCore
* @param string $file_type
* @return boolean Operation result
*/
- public static function resize($src_file, $dst_file, $dst_width = null, $dst_height = null, $file_type = 'jpg')
+ public static function resize($src_file, $dst_file, $dst_width = null, $dst_height = null, $file_type = 'jpg', $force_type = false)
{
if (!file_exists($src_file))
return false;
@@ -124,7 +124,7 @@ class ImageManagerCore
// This allow for higher quality and for transparency. JPG source files will also benefit from a higher quality
// because JPG reencoding by GD, even with max quality setting, degrades the image.
if (Configuration::get('PS_IMAGE_QUALITY') == 'png_all'
- || (Configuration::get('PS_IMAGE_QUALITY') == 'png' && $type == IMAGETYPE_PNG))
+ || (Configuration::get('PS_IMAGE_QUALITY') == 'png' && $type == IMAGETYPE_PNG) && !$force_type)
$file_type = 'png';
if (!$src_width)
diff --git a/classes/Translate.php b/classes/Translate.php
index 5dcbee010..2436e9558 100644
--- a/classes/Translate.php
+++ b/classes/Translate.php
@@ -46,7 +46,7 @@ class TranslateCore
// @todo remove global keyword in translations files and use static
global $_LANGADM;
- if (!isset($modules_tabs))
+ if ($modules_tabs !== null)
$modules_tabs = Tab::getModuleTabList();
if ($_LANGADM == null)
diff --git a/controllers/admin/AdminThemesController.php b/controllers/admin/AdminThemesController.php
index 1cd53620c..3e7549534 100644
--- a/controllers/admin/AdminThemesController.php
+++ b/controllers/admin/AdminThemesController.php
@@ -528,12 +528,21 @@ class AdminThemesControllerCore extends AdminController
if (!$tmp_name || !move_uploaded_file($_FILES[$field_name]['tmp_name'], $tmp_name))
return false;
- $logo_name = $logo_prefix.'-'.(int)$id_shop.'.jpg';
- if (($id_shop == Configuration::get('PS_SHOP_DEFAULT') || $id_shop == 0))
- $logo_name = $logo_prefix.'.jpg';
+ $ext = ($field_name == 'PS_STORES_ICON') ? '.gif' : '.jpg';
+ $logo_name = $logo_prefix.'-'.(int)$id_shop.$ext;
+ if (Context::getContext()->shop->getContext() == Shop::CONTEXT_ALL || $id_shop == 0)
+ $logo_name = $logo_prefix.$ext;
- if (!@ImageManager::resize($tmp_name, _PS_IMG_DIR_.$logo_name))
- $this->errors[] = Tools::displayError('An error occurred during logo copy.');
+ if ($field_name == 'PS_STORES_ICON')
+ {
+ if (!@ImageManager::resize($tmp_name, _PS_IMG_DIR_.$logo_name, null, null, 'gif', true))
+ $this->errors[] = Tools::displayError('An error occurred during logo copy.');
+ }
+ else
+ {
+ if (!@ImageManager::resize($tmp_name, _PS_IMG_DIR_.$logo_name))
+ $this->errors[] = Tools::displayError('An error occurred during logo copy.');
+ }
Configuration::updateValue($field_name, $logo_name);
$this->fields_options['appearance']['fields'][$field_name]['thumb'] = _PS_IMG_.$logo_name.'?date='.time();
diff --git a/controllers/front/StoresController.php b/controllers/front/StoresController.php
index 1f9fe5607..e2fa3f0ef 100644
--- a/controllers/front/StoresController.php
+++ b/controllers/front/StoresController.php
@@ -249,7 +249,8 @@ class StoresControllerCore extends FrontController
'mediumSize' => Image::getSize('medium'),
'defaultLat' => (float)Configuration::get('PS_STORES_CENTER_LAT'),
'defaultLong' => (float)Configuration::get('PS_STORES_CENTER_LONG'),
- 'searchUrl' => $this->context->link->getPageLink('stores')
+ 'searchUrl' => $this->context->link->getPageLink('stores'),
+ 'logo_store' => Configuration::get('PS_STORES_ICON')
));
$this->setTemplate(_PS_THEME_DIR_.'stores.tpl');
diff --git a/themes/default/js/stores.js b/themes/default/js/stores.js
index d9af26daf..d1e5befcd 100644
--- a/themes/default/js/stores.js
+++ b/themes/default/js/stores.js
@@ -137,7 +137,7 @@ function searchLocationsNear(center)
function createMarker(latlng, name, address, other, id_store, has_store_picture)
{
var html = '
'+name+''+address+(has_store_picture == 1 ? '
+'-medium.jpg)
' : '')+other+'
'+translation_5+'<\/a>';
- var image = new google.maps.MarkerImage(img_ps_dir+'logo_stores.gif');
+ var image = new google.maps.MarkerImage(img_ps_dir+logo_store);
if (hasStoreIcon)
var marker = new google.maps.Marker({ map: map, icon: image, position: latlng });
else
diff --git a/themes/default/stores.tpl b/themes/default/stores.tpl
index 672499ded..ae1a907d8 100644
--- a/themes/default/stores.tpl
+++ b/themes/default/stores.tpl
@@ -69,6 +69,7 @@
var img_store_dir = '{$img_store_dir}';
var img_ps_dir = '{$img_ps_dir}';
var searchUrl = '{$searchUrl}';
+ var logo_store = '{$logo_store}';
//]]>