diff --git a/admin-dev/themes/default/template/controllers/search/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/search/helpers/view/view.tpl
index 31c1f0935..3917e511a 100644
--- a/admin-dev/themes/default/template/controllers/search/helpers/view/view.tpl
+++ b/admin-dev/themes/default/template/controllers/search/helpers/view/view.tpl
@@ -40,7 +40,7 @@ $(function() {
{else}
{l s='Features matching your query'} : {$query}
- {foreach $features key=key item=feature }
+ {foreach $features key=key item=feature}
{foreach $feature key=k item=val name=feature_list}
| {if $smarty.foreach.feature_list.first}{$key}{/if} |
@@ -54,13 +54,29 @@ $(function() {
{/if}
{/if}
+{if isset($modules)}
+ {if !$modules}
+ {l s='No modules matching your query'} : {$query}
+ {else}
+ {l s='Modules matching your query'} : {$query}
+
+
+ {/if}
+{/if}
{if isset($categories)}
{if !$categories}
{l s='No categories matching your query'} : {$query}
{else}
{l s='Categories matching your query'} : {$query}
- {foreach $categories key=key item=category }
+ {foreach $categories key=key item=category}
| {$category} |
diff --git a/admin-dev/themes/default/template/header.tpl b/admin-dev/themes/default/template/header.tpl
index 8f9a8c34d..a4bd6b25d 100644
--- a/admin-dev/themes/default/template/header.tpl
+++ b/admin-dev/themes/default/template/header.tpl
@@ -168,6 +168,7 @@
+
diff --git a/controllers/admin/AdminSearchController.php b/controllers/admin/AdminSearchController.php
index bdaa0afed..dc3a1b2a0 100644
--- a/controllers/admin/AdminSearchController.php
+++ b/controllers/admin/AdminSearchController.php
@@ -132,6 +132,17 @@ class AdminSearchControllerCore extends AdminController
}
/* IP */
// 6 - but it is included in the customer block
+
+ /* Module search */
+ if (!$searchType || $searchType == 7)
+ {
+ /* Handle module name */
+ if ($searchType == 7 && Validate::isModuleName($this->query) AND ($module = Module::getInstanceByName($this->query)) && Validate::isLoadedObject($module))
+ Tools::redirectAdmin('index.php?tab=AdminModules&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name).'&token='.Tools::getAdminTokenLite('AdminModules'));
+
+ /* Normal catalog search */
+ $this->searchModule();
+ }
}
$this->display = 'view';
}
@@ -168,6 +179,18 @@ class AdminSearchControllerCore extends AdminController
{
$this->_list['customers'] = Customer::searchByName($this->query);
}
+
+ public function searchModule()
+ {
+ $this->_list['modules'] = array();
+ $all_modules = Module::getModulesOnDisk(true, true, Context::getContext()->employee->id);
+ foreach ($all_modules as $module)
+ if (stripos($module->name, $this->query) || stripos($module->displayName, $this->query) || stripos($module->description, $this->query))
+ {
+ $module->linkto = 'index.php?tab=AdminModules&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name).'&token='.Tools::getAdminTokenLite('AdminModules');
+ $this->_list['modules'][] = $module;
+ }
+ }
/**
* Search a feature in all store
@@ -360,6 +383,10 @@ class AdminSearchControllerCore extends AdminController
$view = $helper->generateList($this->_list['orders'], $this->fields_list['orders']);
$this->tpl_view_vars['orders'] = $view;
}
+
+ if (isset($this->_list['modules']))
+ $this->tpl_view_vars['modules'] = $this->_list['modules'];
+
return parent::renderView();
}
}