Returns all the modules that has been created by Melis
@return array
779910
public function getMelisModules()
    {
        $modules = array();
        foreach($this->getAllModules() as $module) {
            if(strpos($module, 'Melis') !== false || strpos($module, 'melis') !== false) {
                $modules[] = $module;
            }
        }
        return $modules;
    }
379623
protected function get_module_names() {
        if ($this->_modnames !== null) {
            return $this->_modnames;
        }
        $this->_modnames = [];
        foreach ($this->cms as $cm) {
            $this->_modnames[$cm->modname] = $cm->modfullname;
        }
        return $this->_modnames;
    }
558583
public function getCoreModules($excludeModulesOnReturn = [])
    {
        $modules = [
            'melisdbdeploy' => 'MelisDbDeploy',
            'meliscomposerdeploy' => 'MelisComposerDeploy',
            'meliscore' => 'MelisCore',
            'melissites' => 'MelisSites',
            'melisassetmanager' => 'MelisAssetManager',
        ];

        if ($excludeModulesOnReturn) {
            foreach ($excludeModulesOnReturn as $exMod) {
                if (isset($modules[$exMod]) && $modules[$exMod]) {
                    unset($modules[$exMod]);
                }
            }
        }

        return $modules;
    }
590457
public static function getAvailableModules()
    {
        if (!self::$_initialized) {
            self::init();
        }

        $result = [];

        foreach (self::$_modules as $ns => $module) {
            $result[] = [
                'namespace' => $ns,
                'name' => $module->name(),
                'description' => $module->description(),
                'group' => $module->group(),
                'icon' => $module->icon()
            ];
        }

        return $result;
    }
328863
public function getModuleIds()
    {
        $aModuleIdsFromExtensions = $this->_getModuleIdsFromExtensions($this->getModulesWithExtendedClass());
        $aModuleIdsFromFiles = array_keys($this->getModuleConfigParametersByKey(static::MODULE_KEY_FILES));

        return array_unique(array_merge($aModuleIdsFromExtensions, $aModuleIdsFromFiles));
    }
631349
public static function getSrcModules()
    {
        $modules = [];
        foreach (new \DirectoryIterator(BASE_PATH . 'src') as $module) {
            if (!$module->isDir() || $module->isDot() || !self::_moduleValid($module->getPathname())) {
                continue;
            }
            $modules[] = $module->getPathname();
        }
        return $modules;
    }
1201502
public function getModulesConfig()
    {
        $result = [];
        foreach ($this->modules as $moduleName => $moduleConfig) {
            $className = $moduleConfig['className'];
            $module    = new $className;
            if (!$module instanceof AbstractModule) {
                $errMsg = sprintf('Class "%s" must be extended from %s', $className, AbstractModule::class);
                throw new Exception\RuntimeException($errMsg);
            }
            $config = $module->getConfig();
            $result = ArrayUtils::merge($result, $this->filterModuleConfig($config, $moduleName));
        }
        return $result;
    }
102622
protected function load_module_instances() {
        global $DB;

        $this->moduleinstances = [];
        $modulestoload = [];
        foreach ($this->events as $event) {
            if ($module = $event->get_course_module()) {
                $id = $module->get('instance');
                $name = $module->get('modname');

                $ids = isset($modulestoload[$name]) ? $modulestoload[$name] : [];
                $ids[$id] = true;
                $modulestoload[$name] = $ids;
            }
        }

        if (empty($modulestoload)) {
            return;
        }

        foreach ($modulestoload as $modulename => $ids) {
            list($idsql, $params) = $DB->get_in_or_equal(array_keys($ids));
            $sql = "SELECT * FROM {" . $modulename . "} WHERE id {$idsql}";
            $this->moduleinstances[$modulename] = $DB->get_records_sql($sql, $params);
        }
    }
440581
public List<ModuleType<ApplicationDescriptor>> getAllModule()
   {
      List<ModuleType<ApplicationDescriptor>> list = new ArrayList<ModuleType<ApplicationDescriptor>>();
      List<Node> nodeList = model.get("module");
      for(Node node: nodeList)
      {
         ModuleType<ApplicationDescriptor>  type = new ModuleTypeImpl<ApplicationDescriptor>(this, "module", model, node);
         list.add(type);
      }
      return list;
   }
275561
public function getAdminModules()
    {
        $modules = [];
        
        foreach ($this->getModules() as $id => $obj) {
            if ($obj instanceof Module && $obj instanceof AdminModuleInterface) {
                $modules[$id] = $obj;
            }
        }
        
        return $modules;
    }
790611
public function modules()
    {
        $predefinedDirectories = ['core', 'components'];
        $return                = [];
        foreach ($predefinedDirectories as $predefinedDirectory) {
            $directoryPath = base_path("src/{$predefinedDirectory}");
            $directories   = $this->filesystem->directories($directoryPath);
            foreach ($directories as $directory) {
                $size  = 0;
                $files = $this->filesystem->allFiles($directory);
                foreach ($files as $file) {
                    $size += $file->getSize();
                }
                $return[$predefinedDirectory][] = [
                    'directory'   => $predefinedDirectory . DIRECTORY_SEPARATOR . last(explode(DIRECTORY_SEPARATOR, $directory)),
                    'files_count' => count($files),
                    'size'        => $this->humanFileSize($size, 'MB'),
                ];
            }
        }
        return $this->presenter->modules($return);
    }
1345998
public function getModulesPath()
    {
        $paths = array();
        foreach ($this->getLoadedModules(true) as $module) {
            $paths[$module->getName()] = $module->getPath();
        }

        return $paths;
    }
930858
protected function getModuleConfig(): array
    {
        $merged = [];
        $merger = $this->getMerger();
        foreach ($this->getModules() as $module) {
            if ($module instanceof ConditionProviderInterface && $module->isConditioned() === true) {
                continue;
            }

            if ($module instanceof ConfigProviderInterface) {
                $merged = $merger->merge(
                    $merged,
                    $module->getConfig()->load()
                );
            }
        }

        return $merged;
    }
151512
public function getContentModules()
    {
        return array_filter($this->getModules(), function (ModuleInterface $module) {
            return !($module instanceof AdministrationModuleInterface)
                && !($module instanceof SubmoduleInterface);
        });
    }
409504
public static function getModules()
    {
        return \Cache::remember('modules', 604800, function ()
        {
            $diskModules = Module::getModulesFromDisk();
            if ($diskModules)
                return self::checkModulesInDb($diskModules);
            else
                return [];
        });
    }
545467
private function getModules()
    {
        $modules = (array)$this->xml->xpath('/draggy/module');

        $r = '';

        foreach ($modules as $module) {
            $moduleAttributes = (array)$module;
            $moduleAttributes = (array)$moduleAttributes['@attributes'];

            $this->checkMandatoryAttributes('Modules', $moduleAttributes, ['name', 'left', 'top', 'width', 'height']);

            $moduleName = $moduleAttributes['name'];

            $r .= 'var o = new Container(\'' . str_replace('\\', '\\\\', $moduleName) . '\');' . PHP_EOL;
            $r .= 'o.moveTo(\'' . ( $moduleAttributes['left'] - 1 ) . 'px\',\'' . ( $moduleAttributes['top'] - 1 ) . 'px\',\'' . $moduleAttributes['width'] . 'px\',\'' . $moduleAttributes['height'] . 'px\')' . PHP_EOL;

            $this->modules[]                    = $moduleName;
            $this->insideClasses[$moduleName]   = [];
            $this->insideAbstracts[$moduleName] = [];
        }

        return $r;
    }
660416
public function modules()
    {
        $modules = new Collection;

        // Make meta module
        $modules->push(
            $this->makeMetaModuleInstance()
        );

        // Make model modules
        foreach ($this->repository->getAll() as $modelInformation) {
            $modules->push(
                $this->makeModuleInstance($modelInformation)
            );
        }

        return $modules;
    }