[*] MO: Add smarty cache on blocksearch
This commit is contained in:
@@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user