Returns the menu for this project

@return \Docit\Core\Menus\Menu
198617
public function getDocumentsMenu()
    {

        $yaml  = $this->files->get(Path::join($this->path, $this->ref, 'menu.yml'));
        $array = Yaml::parse($yaml);
        $this->factory->getMenus()->forget('project_sidebar_menu');

        $menu = $this->resolveDocumentsMenu($array[ 'menu' ]);
        $menu->setView('docit::menus/project-sidebar');
        $this->runHook('project:documents-menu', [ $this, $menu ]);

        return $menu;
    }
351503
public function headerMenu()
    {
        if ($this->headerMenu === null) {
            $dashboardConfig = $this->dashboardConfig();

            if (isset($dashboardConfig['secondary_menu'])) {
                $this->headerMenu = $this->createHeaderMenu($dashboardConfig['secondary_menu']);
            } else {
                $this->headerMenu = $this->createHeaderMenu();
            }
        }

        return $this->headerMenu;
    }
236670
public function menuLanguages(): ?Menu
    {
        $menu = new Menu(I18N::translate('Language'), '#', 'menu-language');

        foreach (I18N::activeLocales() as $locale) {
            $language_tag = $locale->languageTag();
            $class        = 'menu-language-' . $language_tag . (WT_LOCALE === $language_tag ? ' active' : '');
            $menu->addSubmenu(new Menu($locale->endonym(), '#', $class, [
                'onclick'       => 'return false;',
                'data-language' => $language_tag,
            ]));
        }

        if (count($menu->getSubmenus()) > 1) {
            return $menu;
        }

        return null;
    }
384045
public function getProjectsRoot() {
    if (!isset($this->projectsRoot)) {
      $this->projectsRoot = new Dir($this->hostConfig->req('projects.root'));
    }
    
    return $this->projectsRoot;
  }
253417
public function index()
    {
        $this->vars['coreBuild'] = Parameter::get('system::core.build');
        $this->vars['projectId'] = Parameter::get('system::project.id');
        $this->vars['projectName'] = Parameter::get('system::project.name');
        $this->vars['projectOwner'] = Parameter::get('system::project.owner');
        $this->vars['pluginsActiveCount'] = PluginVersion::applyEnabled()->count();
        $this->vars['pluginsCount'] = PluginVersion::count();
        return $this->asExtension('ListController')->index();
    }
77549
public function getMenu()
    {
        $entities = $this->getManifest()->getEntities();
        $output = new ArrayList();
        $record = $this->getPage();
        $current = $this->getEntity();

        foreach ($entities as $entity) {
            $checkLang = $entity->getLanguage();
            $checkVers = $entity->getVersion();

            // only show entities with the same language or any entity that
            // isn't registered under any particular language (auto detected)
            if ($checkLang && $checkLang !== $this->getLanguage()) {
                continue;
            }

            if ($current && $checkVers) {
                if ($entity->getVersion() !== $current->getVersion()) {
                    continue;
                }
            }

            $mode = 'link';
            $children = new ArrayList();

            if ($entity->hasRecord($record) || $entity->getIsDefaultEntity()) {
                $mode = 'current';

                // add children
                $children = $this->getManifest()->getChildrenFor(
                    $entity->getPath(),
                    ($record) ? $record->getPath() : $entity->getPath()
                );
            } else {
                if ($current && $current->getKey() == $entity->getKey()) {
                    continue;
                }
            }

            $link = $entity->Link();

            $output->push(
                new ArrayData(
                    array(
                    'Title'         => $entity->getTitle(),
                    'Link'          => $link,
                    'LinkingMode'   => $mode,
                    'DefaultEntity' => $entity->getIsDefaultEntity(),
                    'Children'      => $children
                    )
                )
            );
        }

        return $output;
    }
633229
public function getCommands()
    {
        $name     = $this->getController()->getIdentifier()->name;
        $package  = $this->getIdentifier()->package;
        $manifest = JPATH_ADMINISTRATOR.'/components/com_'.$package.'/'.$package.'.xml';

        if(file_exists($manifest))
        {
            $xml = simplexml_load_file($manifest);

            if(isset($xml->administration->submenu))
            {
                foreach($xml->administration->submenu->children() as $menu)
                {
                    $view = (string)$menu['view'];

                    $this->addCommand((string)$menu, array(
                        'href'   => 'option=com_'.$package.'&view='.$view,
                        'active' => ($name == KStringInflector::singularize($view))
                    ));
                }
            }
        }

        return parent::getCommands();
    }
134497
public static function getProjectType()
    {
        $container = self::getContainer();
        $builder = CollectionBuilder::create($container, new ProjectTasks());

        return $container->get('projectXProject')
            ->setBuilder($builder);
    }
463032
public static function getBackendMenu()
    {
        $model = new self();
        $menus = $model->find()->where(['is_display' => self::DISPLAY_YES, 'type' => self::BACKEND_TYPE])->orderBy("sort asc")->asArray()->all();
        $permissions = yii::$app->getAuthManager()->getPermissionsByUser(yii::$app->getUser()->getId());
        $permissions = array_keys($permissions);

        if( !in_array( yii::$app->getUser()->getId(), yii::$app->getBehavior('access')->superAdminUserIds ) ) {
            $newMenu = [];
            foreach ($menus as $menu) {
                $url = $menu['url'];
                if( strpos($url, '/') !== 0 ) $url = '/' . $url;
                $url = $url . ':GET';
                if (in_array($url, $permissions)) {
                    $menu = self::getAncectorsByMenuId($menu['id']) + [$menu];
                    $newMenu = array_merge($newMenu, $menu );
                }
            }

            $menus = [];
            foreach ($newMenu as $v){
                $menus[$v['id']] = $v;
            }
            ArrayHelper::multisort($menus, 'sort', SORT_ASC);
        }

        $lis = '';
        foreach ($menus as $menu) {
            if ($menu['parent_id'] != 0) {
                continue;
            }
            $subMenu = self::_getBackendSubMenu($menus, $menu['id'], '2');
            $menu['icon'] = $menu['icon'] ? $menu['icon'] : 'fa-desktop';
            $menu['url'] = self::generateUrl($menu);
            $arrow = '';
            $class = 'class="J_menuItem"';
            if ($subMenu != '') {
                $arrow = ' arrow';
                $class = '';
            }
            $menu_name = yii::t('cms-menu', $menu['name']);
            $lis .= <<<EOF
                    <li>
                        <a {$class} href="{$menu['url']}">
                            <i class="fa {$menu['icon']}"></i>
                            <span class="nav-label">{$menu_name}</span>
                            <span class="fa {$arrow}"></span>
                        </a>
                        $subMenu
                    </li>
EOF;
        }
        return $lis;
    }
496481
protected function _getMenuFiles()
    {
        $editionPathSelector = new EditionPathProvider(new EditionRootPathProvider(new EditionSelector()));
        $fullAdminDir = $editionPathSelector->getViewsDirectory() . 'admin' . DIRECTORY_SEPARATOR;
        $menuFile = $fullAdminDir . 'menu.xml';

        // including std file
        if (file_exists($menuFile)) {
            $filesToLoad[] = $menuFile;
        }

        // including custom file
        if (file_exists($fullAdminDir . 'user.xml')) {
            $filesToLoad[] = $fullAdminDir . 'user.xml';
        }

        // including module menu files
        $path = getShopBasePath();
        $modulelist = oxNew(\OxidEsales\Eshop\Core\Module\ModuleList::class);
        $activeModuleInfo = $modulelist->getActiveModuleInfo();
        if (is_array($activeModuleInfo)) {
            foreach ($activeModuleInfo as $modulePath) {
                $fullPath = $path . "modules/" . $modulePath;
                // missing file/folder?
                if (is_dir($fullPath)) {
                    // including menu file
                    $menuFile = $fullPath . "/menu.xml";
                    if (file_exists($menuFile) && is_readable($menuFile)) {
                        $filesToLoad[] = $menuFile;
                    }
                }
            }
        }

        return $filesToLoad;
    }
771388
public function toActiveBranchElement()
    {
        $request    = $this->_getOriginalRequest();
        $activePath = $this->_findPath($request);

        if (! $activePath) {
            return null;
        }

        $this->setBranchVisible($activePath);

        $activeItem = array_pop($activePath);

        if (! $activeItem instanceof \Gems_Menu_SubMenuItem) {
            return null;
        }
        // \MUtil_Echo::track($activeItem->get('label'));

        $parameterSources[] = $request;

        if ($this->_menuParameters) {
            $parameterSources[] = $this->_menuParameters;
        }

        $source = new \Gems_Menu_ParameterCollector($parameterSources);
        // self::$verbose = true;

        $nav = $this->_toNavigationArray($source);

        $ul = $this->renderFirst();

        foreach ($nav as $item => $sub) {
            if ($sub['label'] === $activeItem->get('label')) {

                if (isset($sub['pages'])) {
                    $this->renderItems($ul, $sub['pages'], true);
                }

                return $ul;
            }
        }

        return null;
    }
725845
public function getMenu()
    {
        $url = $this->apiUrl.'/cgi-bin/menu/get?access_token='.$this->getAccessToken();
        $result = $this->curl($url);
        return $this->get($result);
    }
581119
public function index()
    {
        $menusList = Menu::with(['children'])
            ->where('menu_type', '!=', 0)
            ->where('parent_id', null)
            ->orderBy('position')->get();

        return view('qa::menus.index', compact('menusList'));
    }
841471
public function getMenuPresence()
    {
        return [
            'id'               => 'models.' . $this->getRouteSlug(),
            'label'            => ucfirst($this->getInformation()->labelPlural(false)),
            'label_translated' => $this->getInformation()->labelPluralTranslationKey(),
            'type'             => MenuPresenceType::ACTION,
            'action'           => $this->routeHelper->getRouteNameForModelClass($this->class, true) . '.index',
            'parameters'       => [
                'home' => true,
            ],
            'permissions'      => [
                "models.{$this->getRouteSlug()}.*",
            ],
        ];
    }
318802
public static function getMenuList()
    {
        $menus = get_terms('nav_menu');

        if (! isset($menus) && empty($menus)) {
            return;
        }

        $menuList = array();

        foreach ($menus as $menu) {
            $menuList[] = $menu->name;
        }

        return $menus;
    }
265407
public function getMenu()
    {
        if ( null === $this->_menu &&
             ! empty( $this->menuId ) )
        {
            $this->_menu = $this->getMenuModel()
                                ->find( $this->menuId );
        }

        return $this->_menu;
    }
1346451
public function render() {
        return Menu::build($this->navigation, $this->menuElements, $this->currentArray, $this->getActiveClass(), $this->getStartLevel(), $this->getMaxLevels(), $this->caretElement, $this->dropdownLinkExtras);
    }