[*] MO: Add smarty cache on some modules

This commit is contained in:
Rémi Gaillard
2013-01-07 17:09:36 +01:00
parent 8bd07c5b87
commit e1664bbdfb
14 changed files with 136 additions and 95 deletions
+11 -7
View File
@@ -71,6 +71,7 @@ class BlockPaymentLogo extends Module
if (Validate::isUnsignedInt(Tools::getValue('id_cms')))
{
Configuration::updateValue('PS_PAYMENT_LOGO_CMS_ID', (int)(Tools::getValue('id_cms')));
$this->_clearCache('blockpaymentlogo.tpl');
$html .= $this->displayConfirmation($this->l('Settings are updated'));
}
@@ -110,14 +111,17 @@ class BlockPaymentLogo extends Module
if (Configuration::get('PS_CATALOG_MODE'))
return;
if (!$this->isCached('blockpaymentlogo.tpl', $this->getCacheId()))
{
if (!Configuration::get('PS_PAYMENT_LOGO_CMS_ID'))
return;
$cms = new CMS(Configuration::get('PS_PAYMENT_LOGO_CMS_ID'), $this->context->language->id);
if (!Validate::isLoadedObject($cms))
return;
$this->smarty->assign('cms_payement_logo', $cms);
}
if (!Configuration::get('PS_PAYMENT_LOGO_CMS_ID'))
return;
$cms = new CMS(Configuration::get('PS_PAYMENT_LOGO_CMS_ID'), $this->context->language->id);
if (!Validate::isLoadedObject($cms))
return;
$this->smarty->assign('cms_payement_logo', $cms);
return $this->display(__FILE__, 'blockpaymentlogo.tpl');
return $this->display(__FILE__, 'blockpaymentlogo.tpl', $this->getCacheId());
}
public function hookRightColumn($params)