Get available menu.
@return array
772957
public function getMenus()
    {
        if ($this->_normalizeMenus === null) {
            $mid = '/' . $this->getUniqueId() . '/';
            // resolve core menus
            $this->_normalizeMenus = [];

            $config = components\Configs::instance();
            $conditions = [
                'user' => $config->db && $config->db->schema->getTableSchema($config->userTable),
                'assignment' => ($userClass = Yii::$app->getUser()->identityClass) && is_subclass_of($userClass, 'yii\db\BaseActiveRecord'),
                'menu' => $config->db && $config->db->schema->getTableSchema($config->menuTable),
            ];
            foreach ($this->_coreItems as $id => $lable) {
                if (!isset($conditions[$id]) || $conditions[$id]) {
                    $this->_normalizeMenus[$id] = ['label' => Yii::t('rbac-admin', $lable), 'url' => [$mid . $id]];
                }
            }
            foreach (array_keys($this->controllerMap) as $id) {
                $this->_normalizeMenus[$id] = ['label' => Yii::t('rbac-admin', Inflector::humanize($id)), 'url' => [$mid . $id]];
            }

            // user configure menus
            foreach ($this->_menus as $id => $value) {
                if (empty($value)) {
                    unset($this->_normalizeMenus[$id]);
                    continue;
                }
                if (is_string($value)) {
                    $value = ['label' => $value];
                }
                $this->_normalizeMenus[$id] = isset($this->_normalizeMenus[$id]) ? array_merge($this->_normalizeMenus[$id], $value)
                : $value;
                if (!isset($this->_normalizeMenus[$id]['url'])) {
                    $this->_normalizeMenus[$id]['url'] = [$mid . $id];
                }
            }
        }
        return $this->_normalizeMenus;
    }
986513
public function getMenu() { 
        $wt_tree = Globals::getTree();
        $menu = null;
        if(ModuleManager::getInstance()->isOperational($this->getName())) {
            
            $root_url = 'module.php?mod=' . $this->getName() . '&ged=' . $wt_tree->getNameUrl() . '&';
            $sosa_stat_menu = new Menu(I18N::translate('Sosa Statistics'), $root_url . 'mod_action=SosaStats', 'menu-maj-sosa-stats');
            
            $menu = clone $sosa_stat_menu;
            $menu->setClass('menu-maj-sosa');
            
            $submenus = array_filter(array(
                new Menu(I18N::translate('Sosa Ancestors'), $root_url . 'mod_action=SosaList', 'menu-maj-sosa-list', array('rel' => 'nofollow')),
                new Menu(I18N::translate('Missing Ancestors'), $root_url . 'mod_action=SosaList@missing', 'menu-maj-sosa-missing', array('rel' => 'nofollow')),
                $sosa_stat_menu                
            ));
            

            if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_GEODISP_NAME)
                && $ga_list = Module::getModuleByName(Constants::MODULE_MAJ_GEODISP_NAME)->getProvider()->getGeoAnalysisList()
                )
            {
                if(count($ga_list) > 0) {
                    $submenus[] = new Menu(I18N::translate('Geographical Dispersion'), 'module.php?mod=' . Constants::MODULE_MAJ_GEODISP_NAME . '&ged=' . $wt_tree->getNameUrl() . '&mod_action=GeoAnalysis@listAll', 'menu-maj-sosa-geodispersion');
                }
            }
            
            if(Auth::check()) {
                $submenus[] = new Menu(
                    I18N::translate('Sosa Configuration'),
                    $this->getConfigLink(),
                    'menu-maj-sosa-configuration',
                    array('rel' => 'nofollow'));
            }
                        
            //-- recompute Sosa submenu
            $controller = Globals::getController();
            if (!empty($controller) && $controller instanceof IndividualController 
                && Auth::check() && $wt_tree->getUserPreference(Auth::user(), 'MAJ_SOSA_ROOT_ID')
                ) {
                $controller
                    ->addInlineJavascript('
                        function majComputeSosaFromIndi(){
                            if($("#computesosadlg").length == 0) {
                                $("body").append("<div id=\"computesosadlg\" title=\"'. I18N::translate('Sosas computation') .'\"><div id=\"sosaloadingarea\"></div></div>");
                            }
	                        $("#computesosadlg").dialog({
                                modal: true,
                                closeOnEscape: false,
		                        width: 300,
		                        open: function(event, ui) {
			                        $("button.ui-dialog-titlebar-close").hide();
                                    $("#sosaloadingarea").empty().html("<i class=\"icon-loading-small\"></i>");
			                        $("#sosaloadingarea").load("module.php?mod=' . $this->getName() . '&mod_action=SosaConfig@computePartial&ged='. $wt_tree->getNameUrl() .'&userid='.Auth::user()->getUserId().'&pid=' . $controller->getSignificantIndividual()->getXref() . '", 
					                   function(){
						                  $("button.ui-dialog-titlebar-close").show();
                                          setTimeout(function(){
                                            $("#computesosadlg").dialog("close");
                                          }, 2000);
			                            });		
		                          }
	                         });	
                        }');
                	
                $submenus[] = new Menu(
                    I18N::translate('Complete Sosas'), 
                    '#', 
                    'menu-maj-sosa-recompute', 
                    array(
                        'rel' => 'nofollow',
                        'onclick' => 'return majComputeSosaFromIndi();'
                    ));
            }
            
        }
        
        $menu->setSubmenus($submenus);
        
        return $menu;
        
    }
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()}.*",
            ],
        ];
    }
715174
protected function _getAvailableLanguages()
    {
        $sDefLang = \OxidEsales\Eshop\Core\Registry::getUtilsServer()->getOxCookie('oxidadminlanguage');
        $sDefLang = $sDefLang ? $sDefLang : $this->_getBrowserLanguage();

        $aLanguages = \OxidEsales\Eshop\Core\Registry::getLang()->getAdminTplLanguageArray();
        foreach ($aLanguages as $oLang) {
            $oLang->selected = ($sDefLang == $oLang->abbr) ? 1 : 0;
        }

        return $aLanguages;
    }
1265139
private static function getDataArray()
    {
        if (self::$_dataArray === null) {
            $currentMenuItem = Yii::$app->menu->current;
            $array = [];
            foreach (Yii::$app->adminLanguage->getLanguages() as $lang) {
                $array[] = [
                    'lang' => $lang,
                    'item' => Yii::$app->menu->find()->where(['nav_id' => $currentMenuItem->navId])->lang($lang['short_code'])->with('hidden')->one(),
                ];
            }
            
            self::$_dataArray = $array;
        }
        
        return self::$_dataArray;
    }
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;
    }
327602
public function getAdminMenus()
    {
        if ($this->_adminMenus === null) {
            $this->setAdminMenus(array_merge($this->defaultAdminMenus(), $this->adminMenus()));
        }
        return $this->_adminMenus;
    }
645733
private function get_available() {
        global $CFG;
        $userid = $this->modinfo->get_user_id();
        if ($this->_available !== null || $userid == -1) {
            // Has already been calculated or does not need calculation.
            return $this->_available;
        }
        $this->_available = true;
        $this->_availableinfo = '';
        if (!empty($CFG->enableavailability)) {
            // Get availability information.
            $ci = new \core_availability\info_section($this);
            $this->_available = $ci->is_available($this->_availableinfo, true,
                    $userid, $this->modinfo);
        }
        // Execute the hook from the course format that may override the available/availableinfo properties.
        $currentavailable = $this->_available;
        course_get_format($this->modinfo->get_course())->
            section_get_available_hook($this, $this->_available, $this->_availableinfo);
        if (!$currentavailable && $this->_available) {
            debugging('section_get_available_hook() can not make unavailable section available', DEBUG_DEVELOPER);
            $this->_available = $currentavailable;
        }
        return $this->_available;
    }
752625
protected function getMenuList()
    {
        $links = $this->menu->getMenuList();
        $links->addParameterSources($this->request, $this->menu->getParameterSource());

        $source = new \Gems_Menu_ParameterSource(array(
            'gro_id_track' => $this->trackId,
            'gro_id_round' => $this->trackEngine->getPreviousRoundId($this->roundId),
            ));

        $links->append($this->menu->getCurrent()->toActionLink(true, \MUtil_Html::raw($this->_('&lt; Previous')), $source));
        $links->addCurrentParent($this->_('Cancel'));
        $links->addCurrentChildren();
        $links->addCurrentSiblings();

        $source->offsetSet('gro_id_round', $this->trackEngine->getNextRoundId($this->roundId));
        $links->append($this->menu->getCurrent()->toActionLink(true, \MUtil_Html::raw($this->_('Next &gt;')), $source));

        return $links;
    }
1044908
protected function getMenuItems() {
		$data = $this->getData();

		return array(
			'topLevel' => array(
				'id' => 'reseller-adminbar-icon',
				'title' => '<span aria-hidden="true" class="' . $data['reseller_identifier'] .
					'-icon ab-icon"></span>',
				'href' => $data['reseller_website_url'],
				'meta' => array(
					'class' => 'reseller-node-icon',
				),
			),
			'items' => array(
				array(
					'id' => 'reseller-site-url',
					'parent' => 'reseller-adminbar-icon',
					'title' => $data['reseller_title'],
					'href' => $data['reseller_website_url'],
					'meta' => array(
						'class' => 'reseller-dropdown',
						'target' => '_blank',
						'title' => $data['reseller_title'],
					),
				),
				array(
					'id' => 'reseller-support-center',
					'parent' => 'reseller-adminbar-icon',
					'title' => esc_html__( 'Support Center', 'boldgrid-library' ),
					'href' => $data['reseller_support_url'],
					'meta' => array(
						'class' => 'reseller-dropdown',
						'target' => '_blank',
						'title' => __( 'Support Center', 'boldgrid-library' ),
					),
				),
				array(
					'id' => 'reseller-amp-login',
					'parent' => 'reseller-adminbar-icon',
					'title' => esc_html__( 'AMP Login', 'boldgrid-library' ),
					'href' => $data['reseller_amp_url'],
					'meta' => array(
						'class' => 'reseller-dropdown',
						'target' => '_blank',
						'title' => __( 'Account Management', 'boldgrid-library' ),
					),
				),
			),
		);
	}
953458
public static function get_all_locations() {
		$menus = [];

		$locations = get_nav_menu_locations();

		foreach ( $locations as $location => $menu_id ) {
			$menus[ $location ] = [];

			$menu_items = wp_get_nav_menu_items( $menu_id );
			$menu_items = is_array( $menu_items ) ? $menu_items : [];

			foreach ( $menu_items as $menu_item ) {
				if ( ! $menu_item->menu_item_parent ) {
					$items = [
						'title' => $menu_item->title,
						'link' => str_replace( site_url(), '', $menu_item->url ),
						'items' => self::get_sub_menu_items( $menu_items, $menu_item->ID ),
					];
					$menus[ $location ][] = apply_filters( "menu_$location", $items );
				}
			}
		}

		return $menus;
	}
1316930
public function getNavData()
    {
        $result = [];

        if ($this->menu->items)
        {
            foreach ($this->menu->items as $item)
            {
                $data = $this->getRecursiveData($item);
                if (!ArrayHelper::getValue($data, 'url') && ! ArrayHelper::getValue($data, 'items')) {

                } else {
                    $result[$item->id] = $data;
                }
            }
        }

        return $result;
    }
100527
protected function getAvailableConditions()
    {
        /** @var CouponManager $couponManager */
        $couponManager = $this->container->get('thelia.coupon.manager');
        $availableConditions = $couponManager->getAvailableConditions();
        $cleanedConditions = [];
        /** @var ConditionInterface $availableCondition */
        foreach ($availableConditions as $availableCondition) {
            $condition = [];
            $condition['serviceId'] = $availableCondition->getServiceId();
            $condition['name'] = $availableCondition->getName();
            $condition['toolTip'] = $availableCondition->getToolTip();
            $cleanedConditions[] = $condition;
        }

        return $cleanedConditions;
    }
131620
public function getOrderedItems()
    {
        if (config('menus.ordering') || $this->ordering) {
            return $this->toCollection()->sortBy(function ($item) {
                return $item->order;
            })->all();
        }

        return $this->items;
    }
667241
public function getMenu()
    {
        if ($this->_menu === null) {
            $this->_menu = Yii::$app->get('menu');
        }

        return $this->_menu;
    }
551418
public function getAvailableIDs(): array
    {
        if ($this->availableTz === null) {
            $this->availableTz = [];
            $available = $this->timeZoneClass->getAvailableIDs();
            foreach ($available as $id) {
                $this->availableTz[] = $id;
            }
        }

        return $this->availableTz;
    }
1192184
public function getAvailable(): array
    {
        $result = [];

        $dbLanguages = $this->find('list', ['keyField' => 'code', 'valueField' => 'name'])
                            ->where(['trashed IS' => null])
                            ->toArray();
        $supportedLanguages = $this->getSupported();
        $result = array_diff_assoc($supportedLanguages, $dbLanguages);

        return $result;
    }