[*] MO: Add smarty cache on blocksearch

This commit is contained in:
Rémi Gaillard
2013-01-08 10:32:09 +01:00
parent e138fd239e
commit 6c99b48ebf
+19 -6
View File
@@ -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();
}
} }