From cff850ed51de6095c4742dc0230692e30e9e29ba Mon Sep 17 00:00:00 2001 From: rMalie Date: Wed, 9 Nov 2011 15:12:04 +0000 Subject: [PATCH] // 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 --- modules/blocksearch/blocksearch.php | 32 +++++++++++++---------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/modules/blocksearch/blocksearch.php b/modules/blocksearch/blocksearch.php index e208500f3..092c9da2d 100644 --- a/modules/blocksearch/blocksearch.php +++ b/modules/blocksearch/blocksearch.php @@ -1,6 +1,6 @@ need_instance = 0; parent::__construct(); - + $this->displayName = $this->l('Quick Search block'); $this->description = $this->l('Adds a block with a quick search field.'); } public function install() { - if (!parent::install() OR !$this->registerHook('top') - OR !$this->registerHook('leftColumn') - OR !$this->registerHook('rightColumn') - ) + if (!parent::install() || !$this->registerHook('top')) return false; return true; } @@ -62,36 +59,35 @@ class BlockSearch extends Module public function hookRightColumn($params) { - $this->_hookCommon($params); + $this->calculHookCommon($params); return $this->display(__FILE__, 'blocksearch.tpl'); } public function hookTop($params) { - $this->_hookCommon($params); + $this->calculHookCommon($params); return $this->display(__FILE__, 'blocksearch-top.tpl'); } /** * _hookAll has to be called in each hookXXX methods. This is made to avoid code duplication. - * - * @param mixed $params + * + * @param mixed $params * @return void */ - private function _hookCommon($params) + private function calculHookCommon($params) { $this->context->smarty->assign('ENT_QUOTES', ENT_QUOTES); $this->context->smarty->assign('search_ssl', Tools::usingSecureMode()); - - $ajaxSearch=(int)(Configuration::get('PS_SEARCH_AJAX')); - $this->context->smarty->assign('ajaxsearch', $ajaxSearch); - $instantSearch = (int)(Configuration::get('PS_INSTANT_SEARCH')); - $this->context->smarty->assign('instantsearch', $instantSearch); - if ($ajaxSearch) + $ajax_search = (int)Configuration::get('PS_SEARCH_AJAX'); + $this->context->smarty->assign('ajaxsearch', $ajax_search); + + $instant_search = (int)(Configuration::get('PS_INSTANT_SEARCH')); + $this->context->smarty->assign('instantsearch', $instant_search); + if ($ajax_search) $this->context->controller->addJqueryPlugin('autocomplete'); $this->context->controller->addCSS(_THEME_CSS_DIR_.'product_list.css'); $this->context->controller->addCSS(($this->_path).'blocksearch.css', 'all'); - return true; } }