Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
commit
778302980b
4 files changed
+52
-32
No files matched your search
@@ -73,6 +73,7 @@ class Blockcustomerprivacy extends Module
|
|||||||
$message_trads[(int)$id_lang[1]] = $value;
|
$message_trads[(int)$id_lang[1]] = $value;
|
||||||
}
|
}
|
||||||
Configuration::updateValue('CUSTPRIV_MESSAGE', $message_trads, true);
|
Configuration::updateValue('CUSTPRIV_MESSAGE', $message_trads, true);
|
||||||
|
$this->_clearCache('blockcustomerprivacy.tpl');
|
||||||
$output = '<div class="conf confirm">'.$this->l('Configuration updated').'</div>';
|
$output = '<div class="conf confirm">'.$this->l('Configuration updated').'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,9 +188,9 @@ class Blockcustomerprivacy extends Module
|
|||||||
{
|
{
|
||||||
if (!$this->checkConfig())
|
if (!$this->checkConfig())
|
||||||
return;
|
return;
|
||||||
|
if (!$this->isCached('blockcustomerprivacy.tpl', $this->getCacheId()))
|
||||||
|
$this->smarty->assign('privacy_message', Configuration::get('CUSTPRIV_MESSAGE', $this->context->language->id));
|
||||||
|
|
||||||
$this->smarty->assign('privacy_message', Configuration::get('CUSTPRIV_MESSAGE', $this->context->language->id));
|
return $this->display(__FILE__, 'blockcustomerprivacy.tpl', $this->getCacheId());
|
||||||
|
|
||||||
return $this->display(__FILE__, 'blockcustomerprivacy.tpl');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,16 +80,23 @@ public function hookDisplayMobileHeader($params)
|
|||||||
|
|
||||||
public function hookRightColumn($params)
|
public function hookRightColumn($params)
|
||||||
{
|
{
|
||||||
$this->calculHookCommon($params);
|
if (!$this->isCached('blocksearch.tpl', $this->getCacheId()))
|
||||||
$this->smarty->assign('blocksearch_type', 'block');
|
{
|
||||||
return $this->display(__FILE__, 'blocksearch.tpl');
|
$this->calculHookCommon($params);
|
||||||
|
$this->smarty->assign('blocksearch_type', 'block');
|
||||||
|
}
|
||||||
|
return $this->display(__FILE__, 'blocksearch.tpl', $this->getCacheId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hookTop($params)
|
public function hookTop($params)
|
||||||
{
|
{
|
||||||
$this->calculHookCommon($params);
|
if (!$this->isCached('blocksearch-top.tpl', $this->getCacheId('blocksearch-top')))
|
||||||
$this->smarty->assign('blocksearch_type', 'top');
|
{
|
||||||
return $this->display(__FILE__, 'blocksearch-top.tpl');
|
$this->calculHookCommon($params);
|
||||||
|
$this->smarty->assign('blocksearch_type', 'top');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->display(__FILE__, 'blocksearch-top.tpl', $this->getCacheId('blocksearch-top'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -110,5 +117,11 @@ public function hookDisplayMobileHeader($params)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getCacheId($name = null)
|
||||||
|
{
|
||||||
|
$cache_id = parent::getCacheId($name);
|
||||||
|
return $cache_id.'_'.(int)Tools::usingSecureMode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,6 +61,7 @@ class blocksocial extends Module
|
|||||||
Configuration::updateValue('blocksocial_facebook', (($_POST['facebook_url'] != '') ? $_POST['facebook_url']: ''));
|
Configuration::updateValue('blocksocial_facebook', (($_POST['facebook_url'] != '') ? $_POST['facebook_url']: ''));
|
||||||
Configuration::updateValue('blocksocial_twitter', (($_POST['twitter_url'] != '') ? $_POST['twitter_url']: ''));
|
Configuration::updateValue('blocksocial_twitter', (($_POST['twitter_url'] != '') ? $_POST['twitter_url']: ''));
|
||||||
Configuration::updateValue('blocksocial_rss', (($_POST['rss_url'] != '') ? $_POST['rss_url']: ''));
|
Configuration::updateValue('blocksocial_rss', (($_POST['rss_url'] != '') ? $_POST['rss_url']: ''));
|
||||||
|
$this->_clearCache('blocksocial.tpl');
|
||||||
$output = '<div class="conf confirm">'.$this->l('Configuration updated').'</div>';
|
$output = '<div class="conf confirm">'.$this->l('Configuration updated').'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,14 +91,14 @@ class blocksocial extends Module
|
|||||||
|
|
||||||
public function hookDisplayFooter()
|
public function hookDisplayFooter()
|
||||||
{
|
{
|
||||||
global $smarty;
|
if (!$this->isCached('blocksocial.tpl', $this->getCacheId()))
|
||||||
|
$this->smarty->assign(array(
|
||||||
|
'facebook_url' => Configuration::get('blocksocial_facebook'),
|
||||||
|
'twitter_url' => Configuration::get('blocksocial_twitter'),
|
||||||
|
'rss_url' => Configuration::get('blocksocial_rss')
|
||||||
|
));
|
||||||
|
|
||||||
$smarty->assign(array(
|
return $this->display(__FILE__, 'blocksocial.tpl', $this->getCacheId());
|
||||||
'facebook_url' => Configuration::get('blocksocial_facebook'),
|
|
||||||
'twitter_url' => Configuration::get('blocksocial_twitter'),
|
|
||||||
'rss_url' => Configuration::get('blocksocial_rss')
|
|
||||||
));
|
|
||||||
return $this->display(__FILE__, 'blocksocial.tpl');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -214,7 +214,7 @@ class Editorial extends Module
|
|||||||
if (!$editorial) //if editorial ddo not exist for this shop => create a new example one
|
if (!$editorial) //if editorial ddo not exist for this shop => create a new example one
|
||||||
$this->createExampleEditorial($id_shop);
|
$this->createExampleEditorial($id_shop);
|
||||||
|
|
||||||
foreach($this->fields_form[0]['form']['input'] as $input) //fill all form fields
|
foreach ($this->fields_form[0]['form']['input'] as $input) //fill all form fields
|
||||||
if ($input['name'] != 'body_homepage_logo')
|
if ($input['name'] != 'body_homepage_logo')
|
||||||
$helper->fields_value[$input['name']] = $editorial->{$input['name']};
|
$helper->fields_value[$input['name']] = $editorial->{$input['name']};
|
||||||
|
|
||||||
@@ -239,6 +239,7 @@ class Editorial extends Module
|
|||||||
{
|
{
|
||||||
unlink(dirname(__FILE__).'/homepage_logo_'.(int)$id_shop.'.jpg');
|
unlink(dirname(__FILE__).'/homepage_logo_'.(int)$id_shop.'.jpg');
|
||||||
Configuration::updateValue('EDITORIAL_IMAGE_DISABLE', 1);
|
Configuration::updateValue('EDITORIAL_IMAGE_DISABLE', 1);
|
||||||
|
$this->_clearCache('editorial.tpl');
|
||||||
Tools::redirectAdmin('index.php?tab=AdminModules&configure='.$this->name.'&token='.Tools::getAdminToken('AdminModules'.(int)(Tab::getIdFromClassName('AdminModules')).(int)$this->context->employee->id));
|
Tools::redirectAdmin('index.php?tab=AdminModules&configure='.$this->name.'&token='.Tools::getAdminToken('AdminModules'.(int)(Tab::getIdFromClassName('AdminModules')).(int)$this->context->employee->id));
|
||||||
}
|
}
|
||||||
$this->_html .= $errors;
|
$this->_html .= $errors;
|
||||||
@@ -274,26 +275,30 @@ class Editorial extends Module
|
|||||||
Configuration::updateValue('EDITORIAL_IMAGE_HEIGHT', (int)round($height));
|
Configuration::updateValue('EDITORIAL_IMAGE_HEIGHT', (int)round($height));
|
||||||
Configuration::updateValue('EDITORIAL_IMAGE_DISABLE', 0);
|
Configuration::updateValue('EDITORIAL_IMAGE_DISABLE', 0);
|
||||||
}
|
}
|
||||||
|
$this->_clearCache('editorial.tpl');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hookDisplayHome($params)
|
public function hookDisplayHome($params)
|
||||||
{
|
{
|
||||||
$id_shop = (int)$this->context->shop->id;
|
if (!$this->isCached('editorial.tpl', $this->getCacheId()))
|
||||||
$editorial = EditorialClass::getByIdShop($id_shop);
|
{
|
||||||
$editorial = new EditorialClass((int)$editorial->id, $this->context->language->id);
|
$id_shop = (int)$this->context->shop->id;
|
||||||
if (!$editorial)
|
$editorial = EditorialClass::getByIdShop($id_shop);
|
||||||
return;
|
$editorial = new EditorialClass((int)$editorial->id, $this->context->language->id);
|
||||||
$this->smarty->assign(array(
|
if (!$editorial)
|
||||||
'editorial' => $editorial,
|
return;
|
||||||
'default_lang' => (int)$this->context->language->id,
|
$this->smarty->assign(array(
|
||||||
'image_width' => Configuration::get('EDITORIAL_IMAGE_WIDTH'),
|
'editorial' => $editorial,
|
||||||
'image_height' => Configuration::get('EDITORIAL_IMAGE_HEIGHT'),
|
'default_lang' => (int)$this->context->language->id,
|
||||||
'id_lang' => $this->context->language->id,
|
'image_width' => Configuration::get('EDITORIAL_IMAGE_WIDTH'),
|
||||||
'homepage_logo' => !Configuration::get('EDITORIAL_IMAGE_DISABLE') && file_exists('modules/editorial/homepage_logo_'.(int)$id_shop.'.jpg'),
|
'image_height' => Configuration::get('EDITORIAL_IMAGE_HEIGHT'),
|
||||||
'image_path' => $this->_path.'homepage_logo_'.(int)$id_shop.'.jpg'
|
'id_lang' => $this->context->language->id,
|
||||||
));
|
'homepage_logo' => !Configuration::get('EDITORIAL_IMAGE_DISABLE') && file_exists('modules/editorial/homepage_logo_'.(int)$id_shop.'.jpg'),
|
||||||
return $this->display(__FILE__, 'editorial.tpl');
|
'image_path' => $this->_path.'homepage_logo_'.(int)$id_shop.'.jpg'
|
||||||
|
));
|
||||||
|
}
|
||||||
|
return $this->display(__FILE__, 'editorial.tpl', $this->getCacheId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hookDisplayHeader()
|
public function hookDisplayHeader()
|
||||||
|
|||||||
Reference in new issue
Block a user