Gets definitions of admin routes that show submenu blocks.

@return array
An array whose keys are the route names, and whose values are arrays
containing:
- 'route_name': The route name.
- 'path': The path.
- 'title': The route title.
432302
public function collect($job_list) {
    $route_provider = \Drupal::service('router.route_provider');
    // TODO: figure out how on earth getRoutesByPattern() is meant to work!
    $routes = $route_provider->getAllRoutes();

    $admin_routes = [];
    foreach ($routes as $route_name => $route) {
      $controller = $route->getDefault('_controller');
      if ($controller == '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage') {
        $route_path = $route->getPath();

        // Skip the '/admin' path, as you don't put items there.
        if ($route_path == '/admin') {
          continue;
        }

        $admin_routes[$route_name] = [
          'route_name' => $route_name,
          'path' => $route_path,
          'title' => $route->getDefault('_title'),
        ];
      }
    }

    return $admin_routes;
  }
1361681
private function getRoutes(): array
    {
        $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(realpath($this->packagePath('Routes'))));

        return array_keys(array_filter(iterator_to_array($iterator), function (SplFileInfo $file) {
            return $file->isFile() && substr($file->getFilename(), 0, strlen('routes.')) === (string)'routes.';
        }));
    }
1310207
public function menuLinkPanels()
    {
        $this->getAllMenuLinkRoutes();
        $models = File::files(base_path('app/Models'));
        $panels = [];
        foreach($models as $file){
            $modelName = str_replace('.php', '', $file->getFileName()); // extract model name
            $modelClass ='App\\Models\\'.$modelName;

            if(method_exists($modelClass, 'menuLinkPanel')) {
                $menuPanels = $modelClass::menuLinkPanel();
                // handle one dimension menuLinkRoutes
                if(isset($menuPanels['items'])) {
                    $menuPanels['routes'] = $this->getMenuLinkRoutes($menuPanels['controller'], (isset($menuPanels['belongsTo']) ? $menuPanels['belongsTo'] : ''));
                    $panels[] = $menuPanels;
                }else{
                    foreach($menuPanels as $panelKey=>$panel){
                        $panel['routes'] = $this->getMenuLinkRoutes($panel['controller'], (isset($panel['belongsTo']) ? $panel['belongsTo'] : ''));
                        $panels[] = $panel;
                    }
                }
            }
        }
        return $panels;
    }
393744
protected function findAvailableRoutes()
    {
        $routes = [];
        $rules = Director::config()->get('rules');

        foreach ($rules as $pattern => $controllerInfo) {
            $routeClass = (is_string($controllerInfo)) ? $controllerInfo : $controllerInfo['Controller'];

            try {
                $routeController = Injector::inst()->get($routeClass);
                if ($routeController instanceof Controller) {
                    $routes[] = $pattern;
                }
            } catch (InjectorNotFoundException $ex) {
            }

        }
        return $routes;
    }
564240
public function getParentRouteName()
	{
		$absoluteRoute	= $this->getAbsoluteName();

		$absoluteRoutes	= explode('.', $absoluteRoute);

		if(count($absoluteRoutes) == 1)
			return null;

		array_pop($absoluteRoutes);

		$parentRoute	= implode('.', $absoluteRoutes);
		
		return $parentRoute;
	}
788531
public function get_routes($include_admin = false)
	{
		//if ($include_admin === FALSE && $GLOBALS['tf']->ima === 'admin')
		//$include_admin = TRUE;
		$routes = array_merge($this->public_routes, $this->routes);
		if ($include_admin === true) {
			$routes = array_merge($this->admin_routes, $routes);
		}
		uksort($routes, function ($a, $b) {
			if (strlen($a) == strlen($b)) {
				if ($a == $b) {
					return 0;
				}
				return ($a > $b) ? -1 : 1;
			} else {
				return (strlen($a) > strlen($b)) ? -1 : 1;
			}
		});
		//myadmin_log('route', 'debug', json_encode($routes), __LINE__, __FILE__);
		return $routes;
	}
1127136
private function getRouteFolders()
    {
        $libsPath[] = [DOMINIO => "public/{$this->directory}"];
        if (!empty($_SESSION['userlogin'])) {
            $libsPath[][DOMINIO] = "public/{$this->directory}/{$_SESSION['userlogin']['setor']}";
            $libsPath = array_merge($libsPath, array_map(function ($class) {
                return [$class => VENDOR . $class . "/public/{$this->directory}/{$_SESSION['userlogin']['setor']}"];
            }, $this->getRouteFile()));
        }
        $libsPath = array_merge($libsPath, array_map(function ($class) {
            return [$class => VENDOR . $class . "/public/{$this->directory}"];
        }, $this->getRouteFile()));

        return $libsPath;
    }
708045
public function getSourceDirs() {
        $dirs = array();
        foreach ($this->roadMap as $road) {
            /* @var $road SourceRoad */
            array_push($dirs, $road->getSourceDir());
        }
        return $dirs;
    }
148775
protected function getCommands()
    {
        $commands = [];

        $routes = $this->map->getRoutes();
        ksort($routes);

        $text = '';
        foreach ($routes as $route) {
            $name    = $route->name;
            $summary = $this->getCommandSummary($route);
            $text .= "    {$name}" . PHP_EOL;
            $text .= "        {$summary}" . PHP_EOL;
        }

        return "<<bold>>COMMANDS<<reset>>" . PHP_EOL
             . "    " . trim($text) . PHP_EOL . PHP_EOL;
    }
179837
public function getAvailableAndAssignedRoutes(): array
    {
        $routes = $this->getAppRoutes();
        $exists = [];

        foreach (array_keys($this->manager->getPermissions()) as $name) {
            if ($name[0] !== '/') {
                continue;
            }
            $exists[] = $name;
            unset($routes[$name]);
        }

        return [
            'available' => array_keys($routes),
            'assigned' => $exists,
        ];
    }
31792
public function getNavigationChildren()
    {
        $result = [];
        $children = $this->getChildren();
        foreach ($children as $child) {
            if ($child->getAppearInNavigation()) {
                $result[] = $child;
            }
        }

        return $result;
    }
199011
public function getList()
    {
        $routes = &gplcart_static('cli.route.list');

        if (isset($routes)) {
            return $routes;
        }

        $routes = (array) gplcart_config_get(GC_FILE_CONFIG_ROUTE_CLI);

        $this->hook->attach('cli.route.list', $routes, $this);
        $this->setAliases($routes);
        return $routes;
    }
905058
public function getPagesRoutes()
    {
        $qb = $this->createQueryBuilder('p');

        $results = $qb
            ->select('p.route')
            ->getQuery()
            ->getScalarResult();

        return array_column($results, 'route');
    }
681638
private function getRouteFolders()
    {
        $rotas = \Config\Config::getViewPermissoes();
        $libsPath[] = [DOMINIO => "public/{$this->directory}"];
        if (!empty($_SESSION['userlogin'])) {
            $libsPath[][DOMINIO] = "public/{$this->directory}/{$_SESSION['userlogin']['setor']}";
            $libsPath = array_merge($libsPath, array_map(function ($class) {
                return [$class => VENDOR . $class . "/public/{$this->directory}/{$_SESSION['userlogin']['setor']}"];
            }, $rotas));
        }
        $libsPath = array_merge($libsPath, array_map(function ($class) {
            return [$class => VENDOR . $class . "/public/{$this->directory}"];
        }, $rotas));

        return $libsPath;
    }
621536
protected function getRoutes()
    {
        $c = parent::ROUTE_PATTERN_CONTROLLER;
        $a = parent::ROUTE_PATTERN_ACTION;
        $v1 = self::ROUTE_PATTERN_VERSION_ONE;
        $v2 = self::ROUTE_PATTERN_VERSION_TWO;
        $v3 = self::ROUTE_PATTERN_VERSION_THREE;
        $o = self::ROUTE_PATTERN_OBJECT_ID;
        return array(
            "/$v1/$c" => self::MATCHES_CONTROLLER,
            "/$v1/$c/" => self::MATCHES_CONTROLLER,
            "/$v2/$c" => self::MATCHES_CONTROLLER,
            "/$v2/$c/" => self::MATCHES_CONTROLLER,
            "/$v3/$c" => self::MATCHES_CONTROLLER,
            "/$v3/$c/" => self::MATCHES_CONTROLLER,
            "/$v1/$c/$a" => self::MATCHES_CONTROLLER_AND_ACTION,
            "/$v1/$c/$a/" => self::MATCHES_CONTROLLER_AND_ACTION,
            "/$v2/$c/$a" => self::MATCHES_CONTROLLER_AND_ACTION,
            "/$v2/$c/$a/" => self::MATCHES_CONTROLLER_AND_ACTION,
            "/$v3/$c/$a" => self::MATCHES_CONTROLLER_AND_ACTION,
            "/$v3/$c/$a/" => self::MATCHES_CONTROLLER_AND_ACTION,
            "/$v1/$c/$o" => self::MATCHES_CONTROLLER_AND_ID,
            "/$v1/$c/$o/" => self::MATCHES_CONTROLLER_AND_ID,
            "/$v2/$c/$o" => self::MATCHES_CONTROLLER_AND_ID,
            "/$v2/$c/$o/" => self::MATCHES_CONTROLLER_AND_ID,
            "/$v3/$c/$o" => self::MATCHES_CONTROLLER_AND_ID,
            "/$v3/$c/$o/" => self::MATCHES_CONTROLLER_AND_ID,
            "/$v1/$c/$a/$o" => self::MATCHES_CONTROLLER_ACTION_AND_ID,
            "/$v1/$c/$a/$o/" => self::MATCHES_CONTROLLER_ACTION_AND_ID,
            "/$v1/$c/$o/$a" => self::MATCHES_CONTROLLER_ACTION_AND_ID,
            "/$v1/$c/$o/$a/" => self::MATCHES_CONTROLLER_ACTION_AND_ID,
            "/$v2/$c/$a/$o" => self::MATCHES_CONTROLLER_ACTION_AND_ID,
            "/$v2/$c/$a/$o/" => self::MATCHES_CONTROLLER_ACTION_AND_ID,
            "/$v2/$c/$o/$a" => self::MATCHES_CONTROLLER_ACTION_AND_ID,
            "/$v2/$c/$o/$a/" => self::MATCHES_CONTROLLER_ACTION_AND_ID,
            "/$v3/$c/$a/$o" => self::MATCHES_CONTROLLER_ACTION_AND_ID,
            "/$v3/$c/$a/$o/" => self::MATCHES_CONTROLLER_ACTION_AND_ID,
            "/$v3/$c/$o/$a" => self::MATCHES_CONTROLLER_ACTION_AND_ID,
            "/$v3/$c/$o/$a/" => self::MATCHES_CONTROLLER_ACTION_AND_ID,
        );
    }
862021
protected function getRouteDefinitions()
    {
        $provider = 'Adamgoose\AnnotationsServiceProvider';

        return '<?php '.PHP_EOL.PHP_EOL.Scanner::create(
          $this->laravel->getProvider($provider)->routeScans()
        )->getRouteDefinitions().PHP_EOL;
    }
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()}.*",
            ],
        ];
    }