Searches the correct menu entry based on the requested route.

@access protected
@return false|\Zepi\Web\General\Entity\MenuEntry
356281
protected function searchCorrectMenuEntry()
    {
        foreach ($this->menuEntries as $location => $priorities) {
            foreach ($priorities as $priority => $menuEntries) {
                $menuEntry = $this->searchCorrectMenuEntryInArray($menuEntries);
    
                if ($menuEntry !== false) {
                    return $menuEntry;
                }
            }
        }
        
        return false;
    }
816628
public function getMatchingEntries()
    {
        if ($this->matchingEntries === null) {
            $this->matchingEntries = array();
            foreach ($this->entries as $entry) {
                $this->matchingEntries = array_merge($this->matchingEntries, $entry->getMatchingEntries());
            }
        }

        return $this->matchingEntries;
    }
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'));
    }
982626
private function find_main_submenu() {
			global $submenu;

			$top_level_menu_slug = $this->get_top_level_menu_slug();

			if ( ! isset( $submenu[ $top_level_menu_slug ] ) ) {
				return false;
			}

			$submenu_slug = $this->get_raw_slug();

			$position   = - 1;
			$found_submenu = false;

			$hook_name = get_plugin_page_hookname( $submenu_slug, '' );

			foreach ( $submenu[ $top_level_menu_slug ] as $pos => $sub ) {
				if ( $submenu_slug === $sub[2] ) {
					$position   = $pos;
					$found_submenu = $sub;
				}
			}

			if ( false === $found_submenu ) {
				return false;
			}

			return array(
				'menu'        => $found_submenu,
				'parent_slug' => $top_level_menu_slug,
				'position'    => $position,
				'hook_name'   => $hook_name
			);
		}
1228180
public function getBreadcrumbEntries(MenuEntry $entry = null)
    {
        $this->activateCorrectMenuEntry();
        
        if ($entry === null) {
            $entry = $this->activeMenuEntry;
            
            if ($entry == null) {
                return array();
            }
        }
        
        // Process the entries for the given entry
        $entries = array_reverse($this->processBreadcrumbEntries($entry), false);
        
        // If we have additional breadcrumb function for the breadcrumb navigation
        // we add the function here to the entries array
        if ($this->breadcrumbFunction != '') {
            array_push($entries, new HiddenMenuEntry(
                $this->breadcrumbFunction,
                $this->framework->getRequest()->getRoute()
            ));
        }
        
        return $entries;
    }
1273328
public function actionCheckRoute()
    {
        $post = Yii::$app->request->post();
        if (empty($post['route'])) {
            $result = Yii::t($this->tcModule, 'Error in POST-ed data');
        } else {
            $ctrlLinkPrefix = empty($post['ctrlLinkPrefix']) ? null : $post['ctrlLinkPrefix'];

            $url = ContentMenuBuilder::routeToLink($post['route'], $ctrlLinkPrefix);

            if (Yii::$app instanceof UniApplication && Yii::$app->type == UniApplication::APP_TYPE_BACKEND) {
                // backend application don't have frontend-routes, $url is wrong
                $url = false;

                // if module-container (system-module) has ApplicationModel - it can get frontend application with correct routes
                $containerModule = $this->module->module;
                if ($containerModule instanceof UniModule && array_key_exists(static::$sysAppModel, $containerModule->models)) {
                    $appModel = $containerModule::model(static::$sysAppModel);
                    $appFront = $appModel::initFrontendApplication();
                    $url = ContentMenuBuilder::routeToLink($post['route'], $ctrlLinkPrefix);
                    $appModel::restoreApplication();
                }
            }

            if ($url) {
                $result = htmlspecialchars($url);
            } else {
                $result = Yii::t($this->tcModule, "Can't resolve route '{route}'", ['route' => $post['route']]);
                if (!empty(ContentMenuBuilder::$errorRouteConvert)) {
                    $result .= ', ERROR: ' . ContentMenuBuilder::$errorRouteConvert;
                }
            }
        }
        return $result;
    }
120996
public function navigation()
    {
        // caching logic
        if ($this->validCache($this->nav)) {
            // get the value from the class cache
            $value = $this->nav;
        } else {
            // pull from the cache
            $value = $this->getCache();
            // check if the value is valid
            if (!$this->validCache($value)) {
                // if is invalid, do the work
                $value = $this->sendGet();
                // add the value from the work to the cache
                $this->setCache($value);
            }
        }

        // cache the value in the class
        $this->nav = $value;

        // spit out the value
        return $value;
    }
1174857
public function index()
    {
        $this->loadModel('Menu.MenuLinks');
        $links = $this->MenuLinks
            ->find('threaded')
            ->where([
                'parent_id IN' => $this->MenuLinks
                    ->find()
                    ->select(['id'])
                    ->where(['url' => '/admin/system/structure'])
            ])
            ->all();

        $this->title(__d('system', 'Site’s Structure'));
        $this->set('links', $links);
        $this->Breadcrumb->push('/admin/system/structure');
    }
1049404
protected function fetchAliasRouteNames()
    {
        if ('_list' != substr($this->getRouteName(), -5))
        {
            throw new MenuException('Route name used for AdminGeneratorMenuItems must end with _list');
        }
        
        $baseName = substr($this->getRouteName(), 0, -4);
        $actions = array('edit', 'update', 'show', 'object', 'batch', 'new', 'create', 'filters', 'scopes');
        
        $routes = array();
        foreach ($actions as $action)
        {
            $routes[] = $baseName.$action;
        }
        
        $this->addAliasRoutes($routes);
        
        return parent::fetchAliasRouteNames();
    }
418190
protected function checkPermissionRedirect()
    {
        if (!$this->user->hasAccess('backend.access_dashboard')) {
            $true = function () { return true; };
            if ($first = array_first(BackendMenu::listMainMenuItems(), $true)) {
                return Redirect::intended($first->url);
            }
        }
    }
1257491
public function EntryCRC()
    {
        return (isset($this->StatIndex['crc']) && is_int($this->StatIndex['crc'])) ? dechex($this->StatIndex['crc']) : false;
    }
1204030
private function find_top_level_menu() {
			global $menu;

			$position   = - 1;
			$found_menu = false;

			$menu_slug = $this->get_raw_slug();

			$hook_name = get_plugin_page_hookname( $menu_slug, '' );
			foreach ( $menu as $pos => $m ) {
				if ( $menu_slug === $m[2] ) {
					$position   = $pos;
					$found_menu = $m;
					break;
				}
			}

			if ( false === $found_menu ) {
				return false;
			}

			return array(
				'menu'      => $found_menu,
				'position'  => $position,
				'hook_name' => $hook_name
			);
		}
1339125
private function entrySecurityCheck(MenuEntry $entry)
    {
        if (null !== $resource = $entry->getResource()) {
            return $this->aclOperator->isAccessGranted($resource, 'VIEW');
        }

        return true;
    }
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;
    }
784371
public function actionIndex()
    {
        $request = \Yii::$app->request;
        if ($request->getIsOptions()) {
            return $this->ResponseOptions($this->verbs()['index']);
        }
        try{
            return Menu::getPageMenus(Yii::$app->request->queryParams);

        }catch(Exception $e)
        {
            throw new Exception($e);
        }



    }
606532
public function getCurrentRouteMatch() {
    if (empty($this->currentRouteMatch)) {
      $this->currentRouteMatch = \Drupal::service('current_route_match');
    }
    return $this->currentRouteMatch;
  }
172480
public function checkNavigator()
    {
        // can we find th' darned controller?
        if (!$this->checkControllerExists()) {
            $this->setNotFound();
            return;
        }

        // merge the feckin params
        if (array_key_exists('params', $this->config) && is_array($this->config['params']) ) {
            $merged = array_merge($this->config['params'], $this->request->getQueryParams());
            $this->request = $this->request->withQueryParams($merged);
        }

        // create the controller
        $this->controller = new $this->config['controller_name']($this->request);
        $this->controller->setServerEnvironment($this->getEnv());

        // where's the bloody action?
        if (!$this->checkActionExists()) {
            $this->setNotFound();
        }
        return null;
    }