[-] FO: Fix PSCFV-2766 logo store cannot be changed
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
{block name="override_tpl"}
|
||||
<script type="text/javascript">
|
||||
var errorEmpty = "{l s='Please name your matching configuration to save.'}"
|
||||
var token = '{$token}';
|
||||
</script>
|
||||
<div id="container-customer">
|
||||
<h2>{l s='View your data'}</h2>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -137,7 +137,7 @@ function searchLocationsNear(center)
|
||||
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 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
|
||||
|
||||
@@ -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}';
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user