[*] MO: Add smarty cache on blocksearch

This commit is contained in:
Rémi Gaillard committed 2013-01-08 10:32:09 +01:00
1 parent e138fd239e
commit 6c99b48ebf
1 file changed
+15 -2
+15 -2
View File
@@ -79,17 +79,24 @@ public function hookDisplayMobileHeader($params)
} }
public function hookRightColumn($params) public function hookRightColumn($params)
{
if (!$this->isCached('blocksearch.tpl', $this->getCacheId()))
{ {
$this->calculHookCommon($params); $this->calculHookCommon($params);
$this->smarty->assign('blocksearch_type', 'block'); $this->smarty->assign('blocksearch_type', 'block');
return $this->display(__FILE__, 'blocksearch.tpl'); }
return $this->display(__FILE__, 'blocksearch.tpl', $this->getCacheId());
} }
public function hookTop($params) public function hookTop($params)
{
if (!$this->isCached('blocksearch-top.tpl', $this->getCacheId('blocksearch-top')))
{ {
$this->calculHookCommon($params); $this->calculHookCommon($params);
$this->smarty->assign('blocksearch_type', 'top'); $this->smarty->assign('blocksearch_type', 'top');
return $this->display(__FILE__, 'blocksearch-top.tpl'); }
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();
}
} }