mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-09-02 08:09:19 +08:00
Add getModules to App Metadata Provider
This commit is contained in:
parent
d002fc77bf
commit
39f9b93711
1 changed files with 38 additions and 0 deletions
|
@ -694,4 +694,42 @@ class AppMetadataProvider implements AppMetadataProviderInterface
|
|||
|
||||
return $metadata;
|
||||
}
|
||||
|
||||
protected function getModules($moduleName = ''): array
|
||||
{
|
||||
$moduleList = $this->moduleRegistryHandler->getModuleList();
|
||||
|
||||
$allModules = [];
|
||||
foreach ($moduleList as $key => $module) {
|
||||
$allModules[] = strtolower($module);
|
||||
}
|
||||
|
||||
$toExclude = [
|
||||
'login' => true,
|
||||
'Login' => true,
|
||||
'home' => true,
|
||||
'calendar' => true,
|
||||
];
|
||||
|
||||
$modules = ['saved-search'];
|
||||
|
||||
if (!in_array($moduleName, $allModules, true)) {
|
||||
$allModules[] = $moduleName;
|
||||
}
|
||||
|
||||
foreach ($allModules as $module) {
|
||||
if (empty($module)) {
|
||||
continue;
|
||||
}
|
||||
$isToExclude = $toExclude[$module] ?? false;
|
||||
if ($isToExclude) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$modules[] = $module;
|
||||
|
||||
}
|
||||
|
||||
return $modules;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue