From aab2a2d355810614d857b0004201fadb78684a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Hennes?= Date: Thu, 22 Jun 2023 08:54:41 +0200 Subject: [PATCH 1/2] Add documentation for hook actionListModules --- .../hooks/list-of-hooks/actionListModules.md | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 modules/concepts/hooks/list-of-hooks/actionListModules.md diff --git a/modules/concepts/hooks/list-of-hooks/actionListModules.md b/modules/concepts/hooks/list-of-hooks/actionListModules.md new file mode 100644 index 0000000000..27c1fec534 --- /dev/null +++ b/modules/concepts/hooks/list-of-hooks/actionListModules.md @@ -0,0 +1,36 @@ +--- +menuTitle: actionListModules +Title: actionListModules +hidden: true +hookTitle: Allows to add your own modules from remote source in modules list in the administration. +files: + - src/Core/Module/ModuleRepository.php +locations: + - back office +type: action +hookAliases: +hasExample: true +--- + +# Hook actionListModules {{< minver v="8.0" >}} + +## Information + +Hook locations: +- back office + +Hook type: action + +Located in: +- [src/Core/Module/ModuleRepository.php](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/Core/Module/ModuleRepository.php) + +## Call of the Hook in the origin file + +```php +$modulesFromHook = $this->hookManager->exec('actionListModules', [], null, true); +$modulesFromHook = array_values($modulesFromHook ?? []); +``` + +## Example implementation + +This hook has been implemented in our module [ps_distributionapiclient](https://github.com/PrestaShop/ps_distributionapiclient/tree/master) \ No newline at end of file From dacc3cd8befa65a6cf3dae7a7d6e7e80112e45da Mon Sep 17 00:00:00 2001 From: Krystian Podemski Date: Thu, 22 Jun 2023 20:02:26 +0200 Subject: [PATCH 2/2] Apply suggestions from code review --- modules/concepts/hooks/list-of-hooks/actionListModules.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/concepts/hooks/list-of-hooks/actionListModules.md b/modules/concepts/hooks/list-of-hooks/actionListModules.md index 27c1fec534..b93cb4e8eb 100644 --- a/modules/concepts/hooks/list-of-hooks/actionListModules.md +++ b/modules/concepts/hooks/list-of-hooks/actionListModules.md @@ -2,7 +2,7 @@ menuTitle: actionListModules Title: actionListModules hidden: true -hookTitle: Allows to add your own modules from remote source in modules list in the administration. +hookTitle: Allows you to add your own modules from a remote source in the modules list in the back office. files: - src/Core/Module/ModuleRepository.php locations: @@ -33,4 +33,4 @@ $modulesFromHook = array_values($modulesFromHook ?? []); ## Example implementation -This hook has been implemented in our module [ps_distributionapiclient](https://github.com/PrestaShop/ps_distributionapiclient/tree/master) \ No newline at end of file +This hook has been implemented in the native [ps_distributionapiclient](https://github.com/PrestaShop/ps_distributionapiclient/tree/master) module \ No newline at end of file