[-] FO: Fix PSCFV-2766 logo store cannot be changed
This commit is contained in:
1 parent
cc441b4c1b
commit
34e2979295
7 files changed
+22
-10
No files matched your search
@@ -29,6 +29,7 @@
|
|||||||
{block name="override_tpl"}
|
{block name="override_tpl"}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var errorEmpty = "{l s='Please name your matching configuration to save.'}"
|
var errorEmpty = "{l s='Please name your matching configuration to save.'}"
|
||||||
|
var token = '{$token}';
|
||||||
</script>
|
</script>
|
||||||
<div id="container-customer">
|
<div id="container-customer">
|
||||||
<h2>{l s='View your data'}</h2>
|
<h2>{l s='View your data'}</h2>
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ class ImageManagerCore
|
|||||||
* @param string $file_type
|
* @param string $file_type
|
||||||
* @return boolean Operation result
|
* @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))
|
if (!file_exists($src_file))
|
||||||
return false;
|
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
|
// 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.
|
// because JPG reencoding by GD, even with max quality setting, degrades the image.
|
||||||
if (Configuration::get('PS_IMAGE_QUALITY') == 'png_all'
|
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';
|
$file_type = 'png';
|
||||||
|
|
||||||
if (!$src_width)
|
if (!$src_width)
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class TranslateCore
|
|||||||
// @todo remove global keyword in translations files and use static
|
// @todo remove global keyword in translations files and use static
|
||||||
global $_LANGADM;
|
global $_LANGADM;
|
||||||
|
|
||||||
if (!isset($modules_tabs))
|
if ($modules_tabs !== null)
|
||||||
$modules_tabs = Tab::getModuleTabList();
|
$modules_tabs = Tab::getModuleTabList();
|
||||||
|
|
||||||
if ($_LANGADM == null)
|
if ($_LANGADM == null)
|
||||||
|
|||||||
@@ -528,12 +528,21 @@ class AdminThemesControllerCore extends AdminController
|
|||||||
if (!$tmp_name || !move_uploaded_file($_FILES[$field_name]['tmp_name'], $tmp_name))
|
if (!$tmp_name || !move_uploaded_file($_FILES[$field_name]['tmp_name'], $tmp_name))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$logo_name = $logo_prefix.'-'.(int)$id_shop.'.jpg';
|
$ext = ($field_name == 'PS_STORES_ICON') ? '.gif' : '.jpg';
|
||||||
if (($id_shop == Configuration::get('PS_SHOP_DEFAULT') || $id_shop == 0))
|
$logo_name = $logo_prefix.'-'.(int)$id_shop.$ext;
|
||||||
$logo_name = $logo_prefix.'.jpg';
|
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))
|
if ($field_name == 'PS_STORES_ICON')
|
||||||
$this->errors[] = Tools::displayError('An error occurred during logo copy.');
|
{
|
||||||
|
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);
|
Configuration::updateValue($field_name, $logo_name);
|
||||||
$this->fields_options['appearance']['fields'][$field_name]['thumb'] = _PS_IMG_.$logo_name.'?date='.time();
|
$this->fields_options['appearance']['fields'][$field_name]['thumb'] = _PS_IMG_.$logo_name.'?date='.time();
|
||||||
|
|||||||
@@ -249,7 +249,8 @@ class StoresControllerCore extends FrontController
|
|||||||
'mediumSize' => Image::getSize('medium'),
|
'mediumSize' => Image::getSize('medium'),
|
||||||
'defaultLat' => (float)Configuration::get('PS_STORES_CENTER_LAT'),
|
'defaultLat' => (float)Configuration::get('PS_STORES_CENTER_LAT'),
|
||||||
'defaultLong' => (float)Configuration::get('PS_STORES_CENTER_LONG'),
|
'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');
|
$this->setTemplate(_PS_THEME_DIR_.'stores.tpl');
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ function searchLocationsNear(center)
|
|||||||
function createMarker(latlng, name, address, other, id_store, has_store_picture)
|
function createMarker(latlng, name, address, other, id_store, has_store_picture)
|
||||||
{
|
{
|
||||||
var html = '<b>'+name+'</b><br/>'+address+(has_store_picture == 1 ? '<br /><br /><img src="'+img_store_dir+parseInt(id_store)+'-medium.jpg" alt="" />' : '')+other+'<br /><a href="http://maps.google.com/maps?saddr=&daddr='+latlng+'" target="_blank">'+translation_5+'<\/a>';
|
var html = '<b>'+name+'</b><br/>'+address+(has_store_picture == 1 ? '<br /><br /><img src="'+img_store_dir+parseInt(id_store)+'-medium.jpg" alt="" />' : '')+other+'<br /><a href="http://maps.google.com/maps?saddr=&daddr='+latlng+'" target="_blank">'+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)
|
if (hasStoreIcon)
|
||||||
var marker = new google.maps.Marker({ map: map, icon: image, position: latlng });
|
var marker = new google.maps.Marker({ map: map, icon: image, position: latlng });
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -69,6 +69,7 @@
|
|||||||
var img_store_dir = '{$img_store_dir}';
|
var img_store_dir = '{$img_store_dir}';
|
||||||
var img_ps_dir = '{$img_ps_dir}';
|
var img_ps_dir = '{$img_ps_dir}';
|
||||||
var searchUrl = '{$searchUrl}';
|
var searchUrl = '{$searchUrl}';
|
||||||
|
var logo_store = '{$logo_store}';
|
||||||
//]]>
|
//]]>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user