From 8ede60847b60ef7b859e6fcf485e17e7702aa022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 8 Jan 2013 10:34:57 +0100 Subject: [PATCH] [*] MO: Add smarty cache on blocksocial --- modules/blocksocial/blocksocial.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/blocksocial/blocksocial.php b/modules/blocksocial/blocksocial.php index f369d6605..18e30065b 100644 --- a/modules/blocksocial/blocksocial.php +++ b/modules/blocksocial/blocksocial.php @@ -19,7 +19,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @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 = '
'.$this->l('Configuration updated').'
'; } @@ -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()); } } ?>