module = 'xmlfeeds'; parent::__construct(); } public function init() { $this->context->smarty->assign([ 'tpl_dir' => _PS_MODULE_DIR_.'xmlfeeds/', 'feedTypeList' => $this->filterTypes(), 'contactUsUrl' => 'https://addons.prestashop.com/en/contact-us?id_product=5732', ]); echo $this->context->smarty->fetch(_PS_MODULE_DIR_.'xmlfeeds/views/templates/admin/page/searchFeedTypeApi.tpl'); } protected function filterTypes() { $FeedType = new FeedType(); $types = $FeedType->getAllTypes(); $search = Tools::strtolower(htmlspecialchars(Tools::getValue('s'), ENT_QUOTES)); if (empty($search)) { return $types; } foreach ($types as $k => $v) { $name = Tools::strtolower($v['name']); if (strpos($name, $search) === false) { unset($types[$k]); } } return $types; } } $typeSearch = new TypeSearch(); $typeSearch->init();