Get the project modules

@return string
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;
    }
1068505
public function getAll()
    {
        if (!$this->loadRepositories()) {
            return Repository::STATUS_NO_REPOSITORIES;
        }

        $modules = $this->getModulesFromRepository();

        // Is a higher version of an already installed package available?
        foreach ($modules as $key => $module) {
            $version = $this->packageService->getVersion($module->name);

            if (!$version) {
                // Not installed at all.
                unset($modules[$key]);
            } elseif (version_compare($version, $module->version, '<')) {
                // Older version installed.
                $modules[$key]->hasUpdate = true;
                $modules[$key]->versionInstalled = $version;
            } else {
                $modules[$key]->hasUpdate = false;
                $modules[$key]->versionInstalled = $version;
            }
        }

        return $modules;
    }
840232
public function getThirdPartyModules()
    {
        $coreModulesByName = $this->getCoreModulesByName();

        $thirdPartyModules = $this->all()->reject(
            function ($module) use ($coreModulesByName) {
                return array_key_exists($module->getLowerName(), $coreModulesByName->toArray());
            });

        return $thirdPartyModules->all();
    }
860015
public function getProjects()
    {
        return Project::all()->map(function ($item) {
            $item['tests'] = $this->getProjectTests($item->id);

            $item['state'] = $this->getProjectState(collect($item['tests']));

            return $item;
        });
    }
504038
private function getProjectProperties()
    {
        $r = '';

        $projectOptions = (array)$this->xml->xpath('/draggy/project');
        $projectOptions = (array)$projectOptions[0];

        $this->checkMandatoryAttributes('Project', $projectOptions, ['language', 'description', 'orm', 'framework']);

        $r .= 'Draggy.prototype.setLanguage(\'' . $projectOptions['language'] . '\');' . PHP_EOL;
        $r .= 'Draggy.prototype.setDescription(\'' . str_replace('\'', '\\\'', $projectOptions['description']) . '\');' . PHP_EOL;
        $r .= 'Draggy.prototype.setORM(\'' . $projectOptions['orm'] . '\');' . PHP_EOL;
        $r .= 'Draggy.prototype.setFramework(\'' . $projectOptions['framework'] . '\');' . PHP_EOL;
        $r .= 'Draggy.prototype.updateConfiguration();' . PHP_EOL;

        return $r;
    }
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;
    }
1033415
public function getAll()
    {
        $result = $this->wsClient->invokeOperation('listtypes', [ ], 'GET');
        $modules = $result[ 'types' ];

        $result = array();
        foreach ($modules as $moduleName) {
            $result[ $moduleName ] = [ 'name' => $moduleName ];
        }
        return $result;
    }
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;
    }
92021
public function getModulesAsArray()
    {

        // initialize the array for the modules
        $modules = array();

        // iterate over the module nodes and sort them into an array
        /** @var \AppserverIo\Appserver\Core\Api\Node\ModuleNode $module */
        foreach ($this->getModules() as $module) {
            $modules[$module->getUuid()] = $module->getType();
        }

        // return the array
        return $modules;
    }
1202961
public function getModules()
    {
        if (!$this->_modules) {
        
            $translator = $this->application->getTranslator();
            $this->_modules = [
                'structure' => [
                	  'position'  => MENU_SITE,
                      'name' 	  => $translator->_('Структура и материалы'),
					  'iconCls'   => 'tree-folder-visible',
                      'class'     => 'Cetera.panel.Structure'
                ],			
                'materials' => [
                	  'position'  => MENU_SITE,
                      'name' 	  => $translator->_('Материалы'),
                	  'icon'      => 'images/math2.gif',
					  'iconCls'   => 'x-fa fa-file-text',
                      'class'     => 'Cetera.panel.MaterialsByCatalog'
                ]
            ];          
            
            if ($this->application->getUser() && $this->application->getUser()->allowAdmin()) {
        
                $this->_modules['widgets'] = array(
                	  'position' => MENU_SITE,
                      'name' 	 => $translator->_('Шаблоны виджетов'),
                	  'icon'     => 'images/widget_icon.png',
					  'iconCls'  => 'x-fa fa-file-code-o',
                	  'class'    => 'Cetera.widget.templates.Panel',
					  'ext6_compat'=> true
                );
		
                $this->_modules['widget_areas'] = array(
                	  'position' => MENU_SITE,
                      'name' 	 => $translator->_('Области'),
                	  'icon'     => 'images/widget_icon.png',
					  'iconCls'  => 'x-fa fa-cog',
                	  'class'    => 'Cetera.widget.Panel'
                ); 
                
                $this->_modules['menus'] = array(
                	  'position' => MENU_SITE,
                      'name' 	   => $translator->_('Меню'),
                	  'icon'     => 'images/icon_menu.png',
					  'iconCls'  => 'x-fa fa-bars',
                	  'class'    => 'Cetera.panel.Menu'
                );   

                $this->_modules['setup'] = array(
                			'position' => MENU_SERVICE,
                            'name' 	   => $translator->_('Настройки'),
                			'icon'     => 'images/setup_small.gif',
							'iconCls'  => 'x-fa fa-cogs',
                			'class'    => 'Cetera.panel.Setup'
                );				
            
                $this->_modules['types'] = array(
                			'position' => MENU_SERVICE,
                            'name' 	   => $translator->_('Типы материалов'),
                			'icon'     => 'images/setup_small.gif',
							'iconCls'  => 'x-fa fa-cogs',
                			'class'    => 'Cetera.panel.MaterialTypes'
                );
                
                $this->_modules['users'] = array(
                			'position' => MENU_SERVICE,
                            'name' 	   => $translator->_('Пользователи'),
                			'icon'     => 'images/user.gif',
							'iconCls'  => 'x-fa fa-user',
                			'class'    => 'Cetera.users.MainPanel'
                );
                
                $this->_modules['groups'] = array(
                	  'position' => MENU_SERVICE,
                      'name' 	   => $translator->_('Группы пользователей'),
                      'url'      => 'include/ui_groups.php',
                	  'icon'     => 'images/users.gif',
					  'iconCls'  => 'x-fa fa-users',
                	  'class'    => 'GroupsPanel'
                );
                
                $this->_modules['eventlog'] = array(
					'position' => MENU_SERVICE,
					'name' 	   => $translator->_('Журнал'),
					'icon'     => 'images/audit1.gif',
					'class'    => 'EventlogPanel',
					'iconCls'  => 'x-fa fa-file-text-o',
					'class'    => 'Cetera.eventlog.Panel',
                ); 
                
                $this->_modules['dbrepair'] = array(
					'position' => MENU_SERVICE,
					'name' 	   => $translator->_('Проверка и ремонт БД'),
					'icon'     => 'images/icon_repair.gif',
					'iconCls'  => 'x-fa fa-medkit',
					'class'    => 'Cetera.panel.Repair',
					'ext6_compat'=> true
                );
				
                $this->_modules['mail_templates'] = array(
					'position' => MENU_SERVICE,
					'name' 	   => $translator->_('Почтовые шаблоны'),
					'icon'     => 'images/mail.gif',
					'iconCls'  => 'x-fa fa-envelope',
					'class'    => 'Cetera.grid.MailTemplates',
                );				
                
                $this->_modules['plugins'] = array(
					'position' => MENU_SERVICE,
					'name' 	   => $translator->_('Плагины'),
					'icon'     => 'images/plugin.png',
					'class'    => 'Cetera.plugin.List',
					'iconCls'  => 'x-fa fa-plug'
                );
                
                $this->_modules['themes'] = array(
					'position' => MENU_SERVICE,
					'name' 	   => $translator->_('Темы'),
					'icon'     => 'images/16X16/gallery.gif',
					'iconCls'  => 'x-fa fa-picture-o',
					'class'    => 'Cetera.theme.List',
                );                
                 
            }           
        
        }
        
        return $this->_modules + $this->_user_modules;
    }
1311506
public function getModules()
    {
        $modules = array();

        $dir = $this->rootDir.'/../src/Terrific/Module/';

        $finder = new Finder();
        $finder->directories()->in($dir)->depth('== 0');

        foreach ($finder as $file) {
            $module = $file->getFilename();
            $modules[$module] = $this->getModuleByName($module, 'small');
        }

        sort($modules);

        return $modules;
    }
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;
		}
791672
public static function getDirectories() {
        Logger::info("Resolving dependencies for project");
        $packages = array();
        $root = dirname(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))));
        $composer = file_get_contents($root . DIRECTORY_SEPARATOR . 'composer.json');
        $composer = json_decode($composer, true);
        if (array_key_exists('require', $composer) && !empty($composer['require'])) {
            foreach ($composer['require'] as $requirement => $version) {
                $packages = array_merge(self::readFile($requirement), $packages);
            }
        } else {
            Logger::trace("Project has no dependencies");
        }
        foreach ($packages as $package) {
            Logger::debug("Project references package %s", $package);
        }
        Logger::info("%d dependencies found", count($packages));
        return $packages;
    }
773177
public function getMissingCoreModules()
    {
        $modules = array();

        foreach ($this->coreModules as $module) {
            if (!$this->isLoadedModule($module)) {
                array_push($modules, $module);
            }
        }

        return $modules;
    }
403599
public function getModulesMap()
    {
        if ($this->_modulesMap === null) {
            $this->_modulesMap = NavItemModule::find()->select(['module_name', 'id'])->indexBy('id')->asArray()->all();
        }
        
        return $this->_modulesMap;
    }
685036
public function getModule()
    {
        $method = ArrayHelper::getValue($this->parentWidget->settings, 'queryRole', 'all');
        $relationship = ArrayHelper::getValue($this->parentWidget->settings, 'relationship', false);
        if ($method === 'children') {
            return $relationship->child;
        } elseif ($method === 'parents') {
            return $relationship->parent;
        }

        return false;
    }
627149
public function getInstalls()
    {
        if (!$this->loadRepositories()) {
            return Repository::STATUS_NO_REPOSITORIES;
        }

        $modules = $this->getModulesFromRepository();

        // Is the package already installed? If yes, is a higher version available?
        foreach ($modules as $key => $module) {
            $version = $this->packageService->getVersion($module->name);
            // Not installed yet.
            if ($version) {
                // Older version installed.
                unset($modules[$key]);
            }
        }

        return $modules;
    }