Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2013 PrestaShop SA␍
|
||||
* @copyright 2007-2013 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
@@ -73,6 +73,7 @@ class Blockcustomerprivacy extends Module
|
||||
$message_trads[(int)$id_lang[1]] = $value;
|
||||
}
|
||||
Configuration::updateValue('CUSTPRIV_MESSAGE', $message_trads, true);
|
||||
$this->_clearCache('blockcustomerprivacy.tpl');
|
||||
$output = '<div class="conf confirm">'.$this->l('Configuration updated').'</div>';
|
||||
}
|
||||
|
||||
@@ -187,9 +188,9 @@ class Blockcustomerprivacy extends Module
|
||||
{
|
||||
if (!$this->checkConfig())
|
||||
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');
|
||||
return $this->display(__FILE__, 'blockcustomerprivacy.tpl', $this->getCacheId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,16 +80,23 @@ public function hookDisplayMobileHeader($params)
|
||||
|
||||
public function hookRightColumn($params)
|
||||
{
|
||||
$this->calculHookCommon($params);
|
||||
$this->smarty->assign('blocksearch_type', 'block');
|
||||
return $this->display(__FILE__, 'blocksearch.tpl');
|
||||
if (!$this->isCached('blocksearch.tpl', $this->getCacheId()))
|
||||
{
|
||||
$this->calculHookCommon($params);
|
||||
$this->smarty->assign('blocksearch_type', 'block');
|
||||
}
|
||||
return $this->display(__FILE__, 'blocksearch.tpl', $this->getCacheId());
|
||||
}
|
||||
|
||||
public function hookTop($params)
|
||||
{
|
||||
$this->calculHookCommon($params);
|
||||
$this->smarty->assign('blocksearch_type', 'top');
|
||||
return $this->display(__FILE__, 'blocksearch-top.tpl');
|
||||
if (!$this->isCached('blocksearch-top.tpl', $this->getCacheId('blocksearch-top')))
|
||||
{
|
||||
$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;
|
||||
}
|
||||
|
||||
protected function getCacheId($name = null)
|
||||
{
|
||||
$cache_id = parent::getCacheId($name);
|
||||
return $cache_id.'_'.(int)Tools::usingSecureMode();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2013 PrestaShop SA␍
|
||||
* @copyright 2007-2013 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
@@ -61,6 +61,7 @@ class blocksocial extends Module
|
||||
Configuration::updateValue('blocksocial_facebook', (($_POST['facebook_url'] != '') ? $_POST['facebook_url']: ''));
|
||||
Configuration::updateValue('blocksocial_twitter', (($_POST['twitter_url'] != '') ? $_POST['twitter_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>';
|
||||
}
|
||||
|
||||
@@ -90,14 +91,14 @@ class blocksocial extends Module
|
||||
|
||||
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(
|
||||
'facebook_url' => Configuration::get('blocksocial_facebook'),
|
||||
'twitter_url' => Configuration::get('blocksocial_twitter'),
|
||||
'rss_url' => Configuration::get('blocksocial_rss')
|
||||
));
|
||||
return $this->display(__FILE__, 'blocksocial.tpl');
|
||||
return $this->display(__FILE__, 'blocksocial.tpl', $this->getCacheId());
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -214,7 +214,7 @@ class Editorial extends Module
|
||||
if (!$editorial) //if editorial ddo not exist for this shop => create a new example one
|
||||
$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')
|
||||
$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');
|
||||
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));
|
||||
}
|
||||
$this->_html .= $errors;
|
||||
@@ -274,26 +275,30 @@ class Editorial extends Module
|
||||
Configuration::updateValue('EDITORIAL_IMAGE_HEIGHT', (int)round($height));
|
||||
Configuration::updateValue('EDITORIAL_IMAGE_DISABLE', 0);
|
||||
}
|
||||
$this->_clearCache('editorial.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
public function hookDisplayHome($params)
|
||||
{
|
||||
$id_shop = (int)$this->context->shop->id;
|
||||
$editorial = EditorialClass::getByIdShop($id_shop);
|
||||
$editorial = new EditorialClass((int)$editorial->id, $this->context->language->id);
|
||||
if (!$editorial)
|
||||
return;
|
||||
$this->smarty->assign(array(
|
||||
'editorial' => $editorial,
|
||||
'default_lang' => (int)$this->context->language->id,
|
||||
'image_width' => Configuration::get('EDITORIAL_IMAGE_WIDTH'),
|
||||
'image_height' => Configuration::get('EDITORIAL_IMAGE_HEIGHT'),
|
||||
'id_lang' => $this->context->language->id,
|
||||
'homepage_logo' => !Configuration::get('EDITORIAL_IMAGE_DISABLE') && file_exists('modules/editorial/homepage_logo_'.(int)$id_shop.'.jpg'),
|
||||
'image_path' => $this->_path.'homepage_logo_'.(int)$id_shop.'.jpg'
|
||||
));
|
||||
return $this->display(__FILE__, 'editorial.tpl');
|
||||
if (!$this->isCached('editorial.tpl', $this->getCacheId()))
|
||||
{
|
||||
$id_shop = (int)$this->context->shop->id;
|
||||
$editorial = EditorialClass::getByIdShop($id_shop);
|
||||
$editorial = new EditorialClass((int)$editorial->id, $this->context->language->id);
|
||||
if (!$editorial)
|
||||
return;
|
||||
$this->smarty->assign(array(
|
||||
'editorial' => $editorial,
|
||||
'default_lang' => (int)$this->context->language->id,
|
||||
'image_width' => Configuration::get('EDITORIAL_IMAGE_WIDTH'),
|
||||
'image_height' => Configuration::get('EDITORIAL_IMAGE_HEIGHT'),
|
||||
'id_lang' => $this->context->language->id,
|
||||
'homepage_logo' => !Configuration::get('EDITORIAL_IMAGE_DISABLE') && file_exists('modules/editorial/homepage_logo_'.(int)$id_shop.'.jpg'),
|
||||
'image_path' => $this->_path.'homepage_logo_'.(int)$id_shop.'.jpg'
|
||||
));
|
||||
}
|
||||
return $this->display(__FILE__, 'editorial.tpl', $this->getCacheId());
|
||||
}
|
||||
|
||||
public function hookDisplayHeader()
|
||||
|
||||
Reference in New Issue
Block a user