// Filter search BO

This commit is contained in:
Damien Metzger
2013-11-04 16:51:30 +01:00
parent 0ddc0d9f9a
commit 695326bc4e
+11 -8
View File
@@ -197,14 +197,17 @@ class AdminSearchControllerCore extends AdminController
$this->_list['modules'][] = $module; $this->_list['modules'][] = $module;
} }
$vars = http_build_query(array( if (!is_numeric(trim($this->query)) && !Validate::isEmail($this->query))
'version' => _PS_VERSION_, {
'iso_lang' => Tools::strtolower(Context::getContext()->language->iso_code), $vars = http_build_query(array(
'iso_code' => Tools::strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))), 'version' => _PS_VERSION_,
'search_query' => $this->query 'iso_lang' => Tools::strtolower(Context::getContext()->language->iso_code),
)); 'iso_code' => Tools::strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))),
if (($json_content = Tools::file_get_contents('https://api.addons.prestashop.com/search.php?'.$vars)) != false) 'search_query' => $this->query
$this->_list['addons'] = Tools::jsonDecode($json_content, true); ));
if (($json_content = Tools::file_get_contents('https://api.addons.prestashop.com/search.php?'.$vars)) != false)
$this->_list['addons'] = Tools::jsonDecode($json_content, true);
}
} }
/** /**