Get available menu

@return NULL|multitype:string
491691
public function getAvailableMenu()
    {
        $availableMenus = array();
        $menus = $this->getMenu();
        if (!$menus)
        {
            return (NULL);
        }
        foreach ($menus as $menu)
        {
            $availableMenus[] = $menu->getLabel();
        }
        return ($availableMenus);
    }
693080
public function getMenu()
    {
        return (new AdminMenuBuilder($this))
            ->nodeRoute('menu_node_filemanager', 'cloud_upload', 'admin/storage/index')
            ->node('menu_node_system', 'settings_applications')
                ->group('menu_group_access')
                    ->itemApi('menu_access_item_user', 'admin/user/index', 'person', 'api-admin-user')
                    ->itemApi('menu_access_item_apiuser', 'admin/api-user/index', 'device_hub', 'api-admin-apiuser')
                    ->itemApi('menu_access_item_group', 'admin/group/index', 'group', 'api-admin-group')
                ->group('menu_group_system')
                    ->itemApi('menu_system_item_config', 'admin/config/index', 'storage', 'api-admin-config')
                    ->itemApi('menu_system_item_language', 'admin/lang/index', 'language', 'api-admin-lang')
                    ->itemApi('menu_system_item_tags', 'admin/tag/index', 'view_list', 'api-admin-tag')
                    ->itemApi('menu_system_logger', 'admin/logger/index', 'notifications', 'api-admin-logger')
                    ->itemApi('Queue', 'admin/queue-log/index', 'schedule', 'api-admin-queuelog')
                ->group('menu_group_images')
                    ->itemApi('menu_images_item_effects', 'admin/effect/index', 'blur_circular', 'api-admin-effect')
                    ->itemApi('menu_images_item_filters', 'admin/filter/index', 'adjust', 'api-admin-filter')
                ->group('menu_group_contentproxy')
                    ->itemApi('menu_group_contentproxy_machines', 'admin/proxy-machine/index', 'devices', 'api-admin-proxymachine')
                    ->itemApi('menu_group_contentproxy_builds', 'admin/proxy-build/index', 'import_export', 'api-admin-proxybuild');
    }
828638
def get_menu(self, name):
        """"""
        if name not in self._menus:
            self._menus[name] = self.menuBar().addMenu(name)
        return self._menus[name]
1129732
public function menuThemes(): ?Menu
    {
        $themes = app(ModuleService::class)->findByInterface(ModuleThemeInterface::class, false, true);

        $current_theme = app(ModuleThemeInterface::class);

        if ($themes->count() > 1) {
            $submenus = $themes->map(static function (ModuleThemeInterface $theme) use ($current_theme): Menu {
                $active     = $theme->name() === $current_theme->name();
                $class      = 'menu-theme-' . $theme->name() . ($active ? ' active' : '');

                return new Menu($theme->title(), '#', $class, [
                    'onclick'    => 'return false;',
                    'data-theme' => $theme->name(),
                ]);
            });

            return new Menu(I18N::translate('Theme'), '#', 'menu-theme', [], $submenus->all());
        }

        return null;
    }
149457
public function getMenuList()
    {
        $result = $this->httpRaw(self::WECHAT_MENU_GET_URL . 'access_token=' . $this->getAccessToken());
        return isset($result['menu']['button']) ? $result['menu']['button'] : false;
    }
1170073
public function getAccountMenu()
    {
        $menu = ArrayList::create();
        
        $curr_action = $this->request->param("Action");

        $menu->add(
            ArrayData::create(
                array(
                "ID"    => 0,
                "Title" => _t('Users.PROFILESUMMARY', "Profile Summary"),
                "Link"  => $this->Link(),
                "LinkingMode" => (!$curr_action) ? "current" : "link"
                )
            )
        );

        $menu->add(
            ArrayData::create(
                array(
                "ID"    => 10,
                "Title" => _t('Users.EDITDETAILS', "Edit account details"),
                "Link"  => $this->Link("edit"),
                "LinkingMode" => ($curr_action == "edit") ? "current" : "link"
                )
            )
        );

        $menu->add(
            ArrayData::create(
                array(
                "ID"    => 30,
                "Title" => _t('Users.CHANGEPASSWORD', "Change password"),
                "Link"  => $this->Link("changepassword"),
                "LinkingMode" => ($curr_action == "changepassword") ? "current" : "link"
                )
            )
        );

        $this->extend("updateAccountMenu", $menu);

        return $menu->sort("ID", "ASC");
    }
6571
public function getMenu($name)
    {
        try {
            $menu = app('TypiCMS.menus')->first(function (Menu $menu) use ($name) {
                return $menu->name == $name;
            });
        } catch (Exception $e) {
            Log::info('No menu found with name “'.$name.'”');

            return;
        }

        return $menu;
    }
497434
function has_settings_menu() {
            return ( $this->_is_network_active && fs_is_network_admin() ) ?
                $this->_menu->has_network_menu() :
                $this->_menu->has_menu();
        }
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;
    }
1120551
public function getMenuContentType()
    {

        /** @var AbstractWorkflowStatus[] $list */
        $list = [];

        foreach ($this->menuContentTypeClass as $statusClass) {


            /** @var AbstractWorkflowStatus $status */
            $status = (new ObjectBuilder())->getObject($statusClass);

            // new code 27.4.2019
            $status->parentContentType = $this;

            $list[] = $status;

        }

        return $list;

    }
11741
protected function menu()
    {

        $this->Benchmark->start('getMenu');
        try {
            $menu = $this->CMSNavItemService->getMenu();
        } catch (Exception $e) {
            return '';
        }
        $this->Benchmark->end('getMenu');

        $this->Benchmark->start('buildMenu');
        $dom_id    = $this->getParameter('id');
        $dom_class = $this->getParameter('class');

        $this->matchedCurrentURI = false;

        $root_options = array();
        if (!empty($dom_id))
            $root_options[] = "id='{$dom_id}'";
        if (!empty($dom_class))
            $root_options[] = "class='{$dom_class}'";

        $family_tree = "<ul " . join(' ', $root_options). ">\n";

        $this->requestURI = ltrim($this->Request->getAdjustedRequestURI(), '/');

        foreach ( $menu as $parent ) {
            $family_tree .= $this->_buildMenuTree($parent, "parent", "<span>%s</span>", true);
        }

        $family_tree .= "</ul>\n";
        $this->Benchmark->end('buildMenu');

        return $family_tree;
    }
1207893
protected function getMenu(): Menu
	{
		$parent = $this->parent;
		if ($parent instanceof Menu) {
			return $parent;
		} elseif ($parent instanceof Item) {
			return $parent->getMenu();
		}
		throw new InvalidStateException();
	}
322515
public function getMenu()
    {
        $this->buildMenu();
        $this->applyEdits();
        $this->applyRemoves();
        $this->applyRenames();
        $this->applyOrdering();
        return $this->menu;
    }
729630
public static function getMenu()
    {
        return (new \Mmi\Navigation\NavigationConfigElement)
            ->setLabel('menu.system.container')
            ->setIcon('fa-cogs')
            ->setUri('#')
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.attribute.container')
                ->setIcon('fa-book')
                ->setUri('#')
                ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.attribute.index')
                    ->setIcon('fa-table')
                    ->setModule('cmsAdmin')
                    ->setController('attribute'))
                ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.attribute.edit')
                    ->setIcon('fa-plus')
                    ->setModule('cmsAdmin')
                    ->setController('attribute')
                    ->setAction('edit')))
            //szablony
            ->addChild(
                (new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.categoryType.container')
                    ->setIcon('fa-clone')
                    ->setUri('#')
                    ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                        ->setLabel('menu.categoryType.index')
                        ->setIcon('fa-table')
                        ->setModule('cmsAdmin')
                        ->setController('categoryType'))
                    ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                        ->setLabel('menu.categoryType.edit')
                        ->setIcon('fa-plus')
                        ->setModule('cmsAdmin')
                        ->setController('categoryType')
                        ->setAction('edit'))
            )
            //widgety
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.categoryWidget.container')
                ->setIcon('fa-bars')
                ->setUri('#')
                ->addChild(
                    (new \Mmi\Navigation\NavigationConfigElement)
                        ->setLabel('menu.categoryWidget.index')
                        ->setIcon('fa-table')
                        ->setModule('cmsAdmin')
                        ->setController('categoryWidget')
                )
                ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.categoryWidget.edit')
                    ->setIcon('fa-plus')
                    ->setModule('cmsAdmin')
                    ->setController('categoryWidget')
                    ->setAction('edit')))
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.tag.container')
                ->setIcon('fa-tags')
                ->setUri('#')
                ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.tag.index')
                    ->setIcon('fa-table')
                    ->setModule('cmsAdmin')
                    ->setController('tag'))
                ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.tagRelation.index')
                    ->setIcon('fa-tag')
                    ->setModule('cmsAdmin')
                    ->setController('tagRelation'))
                ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.tagRelation.edit')
                    ->setIcon('fa-plus')
                    ->setModule('cmsAdmin')
                    ->setController('tag')
                    ->setAction('edit')))
            ->addChild(
                (new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.cron.container')
                    ->setIcon('fa-calendar')
                    ->setUri('#')
                    ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                        ->setLabel('menu.cron.index')
                        ->setIcon('fa-table')
                        ->setModule('cmsAdmin')
                        ->setController('cron'))
                    ->addChild(
                        (new \Mmi\Navigation\NavigationConfigElement)
                            ->setLabel('menu.cron.edit')
                            ->setIcon('fa-plus')
                            ->setModule('cmsAdmin')
                            ->setController('cron')
                            ->setAction('edit')
                    )
            )
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.file.index')
                ->setIcon('fa-file')
                ->setModule('cmsAdmin')
                ->setController('file'))
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.connector.index')
                ->setIcon('fa-cloud-download')
                ->setModule('cmsAdmin')
                ->setController('connector')
                ->addChild(
                    (new \Mmi\Navigation\NavigationConfigElement)
                        ->setLabel('menu.connector.files')
                        ->setModule('cmsAdmin')
                        ->setController('connector')
                        ->setAction('files')
                        ->setDisabled()
                ))
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.config')
                ->setIcon('fa-list')
                ->setModule('cmsAdmin')
                ->setController('config'))
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.cache')
                ->setModule('cmsAdmin')
                ->setIcon('fa-trash')
                ->setController('cache'));
    }
772641
function get_top_level_menu_capability() {
            global $menu;

            $top_level_menu_slug = $this->get_top_level_menu_slug();

            foreach ( $menu as $menu_info ) {
                /**
                 * The second element in the menu info array is the capability/role that has access to the menu and the
                 * third element is the menu slug.
                 */
                if ( $menu_info[2] === $top_level_menu_slug ) {
                    return $menu_info[1];
                }
            }

            return 'read';
        }
327602
public function getAdminMenus()
    {
        if ($this->_adminMenus === null) {
            $this->setAdminMenus(array_merge($this->defaultAdminMenus(), $this->adminMenus()));
        }
        return $this->_adminMenus;
    }
297244
public function getMenu()
    {
        if (!$this->menu) {

            foreach ($this->getAllMenus() as $menu) {
                $menu->configureAdminMenu($this);
            }
        }

        return parent::getMenu();
    }