// Normalize blocksearch + remove left / right hook during install

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9993 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie committed 2011-11-09 15:12:04 +00:00
1 parent 047efe3e72
commit cff850ed51
1 file changed
+9 -13
+9 -13
View File
@@ -46,10 +46,7 @@ class BlockSearch extends Module
public function install() public function install()
{ {
if (!parent::install() OR !$this->registerHook('top') if (!parent::install() || !$this->registerHook('top'))
OR !$this->registerHook('leftColumn')
OR !$this->registerHook('rightColumn')
)
return false; return false;
return true; return true;
} }
@@ -62,13 +59,13 @@ class BlockSearch extends Module
public function hookRightColumn($params) public function hookRightColumn($params)
{ {
$this->_hookCommon($params); $this->calculHookCommon($params);
return $this->display(__FILE__, 'blocksearch.tpl'); return $this->display(__FILE__, 'blocksearch.tpl');
} }
public function hookTop($params) public function hookTop($params)
{ {
$this->_hookCommon($params); $this->calculHookCommon($params);
return $this->display(__FILE__, 'blocksearch-top.tpl'); return $this->display(__FILE__, 'blocksearch-top.tpl');
} }
@@ -78,20 +75,19 @@ class BlockSearch extends Module
* @param mixed $params * @param mixed $params
* @return void * @return void
*/ */
private function _hookCommon($params) private function calculHookCommon($params)
{ {
$this->context->smarty->assign('ENT_QUOTES', ENT_QUOTES); $this->context->smarty->assign('ENT_QUOTES', ENT_QUOTES);
$this->context->smarty->assign('search_ssl', Tools::usingSecureMode()); $this->context->smarty->assign('search_ssl', Tools::usingSecureMode());
$ajaxSearch=(int)(Configuration::get('PS_SEARCH_AJAX')); $ajax_search = (int)Configuration::get('PS_SEARCH_AJAX');
$this->context->smarty->assign('ajaxsearch', $ajaxSearch); $this->context->smarty->assign('ajaxsearch', $ajax_search);
$instantSearch = (int)(Configuration::get('PS_INSTANT_SEARCH')); $instant_search = (int)(Configuration::get('PS_INSTANT_SEARCH'));
$this->context->smarty->assign('instantsearch', $instantSearch); $this->context->smarty->assign('instantsearch', $instant_search);
if ($ajaxSearch) if ($ajax_search)
$this->context->controller->addJqueryPlugin('autocomplete'); $this->context->controller->addJqueryPlugin('autocomplete');
$this->context->controller->addCSS(_THEME_CSS_DIR_.'product_list.css'); $this->context->controller->addCSS(_THEME_CSS_DIR_.'product_list.css');
$this->context->controller->addCSS(($this->_path).'blocksearch.css', 'all'); $this->context->controller->addCSS(($this->_path).'blocksearch.css', 'all');
return true;
} }
} }