Returns a list of modules with admin sections.

@param array $modules input modules

@return array admin-enabled modules
501409
private function adminModules()
    {
        $return = [];

        foreach ($this->app[ 'config' ]->get('modules.all') as $module) {
            $controller = '\\app\\'.$module.'\\Controller';

            if (!class_exists($controller)) {
                continue;
            }

            if (property_exists($controller, 'scaffoldAdmin') ||
                property_exists($controller, 'hasAdminView')) {
                $moduleInfo = [
                    'name' => $module,
                    'title' => Inflector::get()->titleize($module), ];

                if (property_exists($controller, 'properties')) {
                    $moduleInfo = array_replace($moduleInfo, $controller::$properties);
                }

                $return[] = $moduleInfo;
            }
        }

        return $return;
    }
711181
protected function parseModuleSettings($moduleSettings)
    {
        $settings = [];

        if (is_array($moduleSettings)) {
            foreach ($moduleSettings as $setting) {
                $settings[] = $setting['name'];
            }
        }

        return $settings;
    }
507737
public static function getModule($module) {
        $info = null;
        if (isset (self::$modules [ $module ])) {
            return self::$modules [ $module ];
        }

        return $info;
    }
649604
def listModules(self):
        """"""
        modules = list(self.modules.items())
        modules.sort()
        return [module for name, module in modules]
1246385
private function getAdminMenuItems(): array
    {
        $menuItems = [];

        if ($this->permissionResolver->hasAccess('setup', 'system_info')) {
            $menuItems[self::ITEM_ADMIN__SYSTEMINFO] = $this->createMenuItem(
                self::ITEM_ADMIN__SYSTEMINFO,
                ['route' => 'ezplatform.systeminfo']
            );
        }

        if ($this->permissionResolver->hasAccess('section', 'view')) {
            $menuItems[self::ITEM_ADMIN__SECTIONS] = $this->createMenuItem(
                self::ITEM_ADMIN__SECTIONS,
                ['route' => 'ezplatform.section.list', 'extras' => [
                    'routes' => [
                        'update' => 'ezplatform.section.update',
                        'view' => 'ezplatform.section.view',
                        'create' => 'ezplatform.section.create',
                    ],
                ]]
            );
        }

        if ($this->permissionResolver->hasAccess('role', 'read')) {
            $menuItems[self::ITEM_ADMIN__ROLES] = $this->createMenuItem(
                self::ITEM_ADMIN__ROLES,
                ['route' => 'ezplatform.role.list', 'extras' => [
                    'routes' => [
                        'update' => 'ezplatform.role.update',
                        'view' => 'ezplatform.role.view',
                        'create' => 'ezplatform.role.create',
                        'policy_update' => 'ezplatform.policy.update',
                        'policy_list' => 'ezplatform.policy.list',
                        'policy_create' => 'ezplatform.policy.create',
                        'policy_create_with_limitation' => 'ezplatform.policy.create_with_limitation',
                    ],
                ]]
            );
        }
        if ($this->permissionResolver->hasAccess('setup', 'administrate')) {
            $menuItems[self::ITEM_ADMIN__LANGUAGES] = $this->createMenuItem(
                self::ITEM_ADMIN__LANGUAGES,
                ['route' => 'ezplatform.language.list', 'extras' => [
                    'routes' => [
                        'edit' => 'ezplatform.language.edit',
                        'view' => 'ezplatform.language.view',
                        'create' => 'ezplatform.language.create',
                    ],
                ]]
            );
        }

        $menuItems[self::ITEM_ADMIN__CONTENT_TYPES] = $this->createMenuItem(
            self::ITEM_ADMIN__CONTENT_TYPES,
            ['route' => 'ezplatform.content_type_group.list', 'extras' => [
                'routes' => [
                    'update' => 'ezplatform.content_type_group.update',
                    'view' => 'ezplatform.content_type_group.view',
                    'create' => 'ezplatform.content_type_group.create',
                    'content_type_add' => 'ezplatform.content_type.add',
                    'content_type_view' => 'ezplatform.content_type.view',
                    'content_type_edit' => 'ezplatform.content_type.edit',
                    'content_type_update' => 'ezplatform.content_type.update',
                ],
            ]]
        );

        $rootUsersId = $this->configResolver->getParameter('location_ids.users');
        $usersItem = $this->factory->createLocationMenuItem(
            self::ITEM_ADMIN__USERS,
            $rootUsersId,
            ['label' => self::ITEM_ADMIN__USERS]
        );

        if (null !== $usersItem) {
            $menuItems[$usersItem->getName()] = $usersItem;
        }

        if ($this->permissionResolver->hasAccess('state', 'administrate')) {
            $menuItems[self::ITEM_ADMIN__OBJECT_STATES] = $this->createMenuItem(
                self::ITEM_ADMIN__OBJECT_STATES,
                ['route' => 'ezplatform.object_state.groups.list', 'extras' => [
                    'routes' => [
                        'group_list' => 'ezplatform.object_state.groups.list',
                        'group_create' => 'ezplatform.object_state.group.add',
                        'group_edit' => 'ezplatform.object_state.group.update',
                        'group_view' => 'ezplatform.object_state.group.view',
                        'state_create' => 'ezplatform.object_state.state.add',
                        'state_view' => 'ezplatform.object_state.state.view',
                        'state_edit' => 'ezplatform.object_state.state.update',
                    ],
                ]]
            );
        }

        return $menuItems;
    }
819646
protected function _getOxcomAdminSearchModules()
    {
        $aData = [];
        $oModules = oxNew(\OxidEsales\Eshop\Core\Module\ModuleList::class);
        $aModules = $oModules->getModulePaths();
        foreach ($aModules as $sKey => $sValue) {
            $oModule = oxNew(\OxidEsales\Eshop\Core\Module\Module::class);
            $oModule->load($sKey);
            $sTitle = strip_tags($oModule->getTitle());
            if (strstr(strtolower($sTitle), strtolower($this->_sQueryName))) {
                $aData[] = ['name' => $sTitle . ' (' . ($oModule->isActive() ? Registry::getLang()->translateString("OXCOM_ADMINSEARCH_MODULE_ACTIVE") : Registry::getLang()->translateString("OXCOM_ADMINSEARCH_MODULE_INACTIVE")) . ')', 'oxid' => $sKey, 'type' => 'module'];
            }
        }

        return $aData;
    }
607624
public static function get($module) {
		if(self::$modules === array())
			self::initialize();

		if(!isset(self::$modules[$module]))
			return false;

		return self::$modules[$module];
	}
151512
public function getContentModules()
    {
        return array_filter($this->getModules(), function (ModuleInterface $module) {
            return !($module instanceof AdministrationModuleInterface)
                && !($module instanceof SubmoduleInterface);
        });
    }
14038
public function getModules(){
		$modules=array();
		$db=BFactory::getDBO();
		if(empty($db)){
			return $modules; //False?
			}
		$qr='SELECT * from `soft_modules_rules` where pageid='.$this->id;
		$q=$db->Query($qr);
		if(empty($q)){
			return $modules; //False?
			}
		while($l=$db->fetch($q)){
			$id=(int)$l['id'];
			$modules[$id]=new BSoftModule();
			$modules[$id]->group=$this;
			$modules[$id]->load($l);
			}
		return $modules;
		}
666769
public function getModules()
    {
        $arrModules = [];
        $objModules = $this->Database->execute("SELECT m.id, m.name, t.name AS theme FROM tl_module m LEFT JOIN tl_theme t ON m.pid=t.id ORDER BY t.name, m.name");

        while ($objModules->next())
        {
            $arrModules[$objModules->theme][$objModules->id] = $objModules->name . ' (ID ' . $objModules->id . ')';
        }

        return $arrModules;
    }
443356
public function findModules()
    {
        $dirs    = $this->getOption('module_dirs');
        $modules = array();
    
        foreach($dirs as $dir){
            $iterator = new DirectoryIterator($dir);
    
            foreach ($iterator as $file) {
                if (($file->isDir() && substr($file->getBasename(), 0, 1) !== '.') 
                    || ($file->isFile() && $file->getExtension() == 'phar')) {
                    
                    $modules[$file->getRealPath()] = strtolower($file->getBasename());
                }
            }
        }
    
        return $modules;
    }
33598
public static function modules($status = 'installed') {
        switch ($status) {
            case 'uninstalled':
                $modules = array_filter(self::$modules, function (Module $m) {
                    return !$m->installed;
                });
                break;
            case 'installed':
                $modules = array_filter(self::$modules, function (Module $m) {
                    return $m->installed;
                });
                break;
            case 'enabled':
                $modules = array_filter(self::$modules, function (Module $m) {
                    return $m->enabled;
                });
                break;
            case 'disabled':
                $modules = array_filter(self::$modules, function (Module $m) {
                    return !$m->enabled && $m->installed;
                });
                break;
            case 'upgradable':
                $modules = array_filter(self::$modules, function (Module $m) {
                    return $m->upgradable && $m->installed;
                });
                break;
            default:
                $modules = self::$modules;
                break;
        }

        return $modules;
    }
358600
protected function runModuleChecks(string $module) : array
    {
        $result = [
            'errors' => [],
            'warnings' => [],
        ];

        if (!in_array($module, $this->modules)) {
            $result['errors'][] = "$module is not a known module";

            return $result;
        }

        $checks = Check::getList($module);

        if (empty($checks)) {
            $result['warnings'][] = "No checks configured for module [$module]";

            return $result;
        }

        foreach ($checks as $check => $options) {
            $this->out(" - Running $check ... ", 0);

            try {
                $check = Check::getInstance((string)$check);
                $checkResult = $check->run($module, $options);
            } catch (InvalidArgumentException $e) {
                $result['errors'][] = $e->getMessage();
                $this->printCheckStatus(1);
                continue;
            }

            $result['errors'] = array_merge($result['errors'], $check->getErrors());
            $result['warnings'] = array_merge($result['warnings'], $check->getWarnings());

            $this->printCheckStatus($checkResult);
        }

        return $result;
    }
194096
public static function getModuleNames(Args $args, ModuleList $modules)
    {
        // Display all modules if "all" is set
        if ($args->isOptionSet('all')) {
            return $modules->getModuleNames();
        }

        $moduleNames = array();

        if ($args->isOptionSet('root')) {
            $moduleNames[] = $modules->getRootModuleName();
        }

        foreach ($args->getOption('module') as $moduleName) {
            $moduleNames[] = $moduleName;
        }

        return $moduleNames ?: $modules->getModuleNames();
    }
990235
protected function getModuleCommands($module)
    {
        $prefix = $module instanceof Application ? '' : $module->getUniqueId() . '/';

        $commands = [];
        foreach (array_keys($module->controllerMap) as $id) {
            $commands[] = $prefix . $id;
        }

        $controllerPath = $module->getControllerPath();
        if (is_dir($controllerPath)) {
            $files = scandir($controllerPath);
            foreach ($files as $file) {
                if (!empty($file) && substr_compare($file, 'Controller.php', -14, 14) === 0) {
                    $controllerClass = $module->controllerNamespace . '\\' . substr(basename($file), 0, -4);
                    if ($this->validateControllerClass($controllerClass)) {
                        $commands[] = $prefix . Inflector::camel2id(substr(basename($file), 0, -14));
                    }
                }
            }
        }

        return $commands;
    }
319320
public function getAllModules()
    {
        $modules = array_map(function ($value) {
            return $this->loadModule($value);
        }, $this->registry->getMap());

        return array_filter($modules, function ($module) {
            return !is_null($module);
        });
    }
1086026
protected function get_module_names() {
        if ($this->_modnames !== null) {
            return $this->_modnames;
        }
        $this->_modnames = [];
        foreach ($this->modules as $module) {
            $this->_modnames[$module->name] = $module->formattedname;
        }
        return $this->_modnames;
    }