Answers a list of breadcrumbs for the current page.

@param integer $maxDepth
@param boolean|string $stopAtPageType
@param boolean $showHidden

@throws Exception

@return ArrayList
488528
public function getBreadcrumbItems($maxDepth = 20, $stopAtPageType = false, $showHidden = false)
    {
        // Obtain Model Breadcrumb Items:
        
        $items = $this->owner->data()->getBreadcrumbItems($maxDepth, $stopAtPageType, $showHidden);
        
        // Obtain Extra Breadcrumb Items:
        
        $extra = $this->owner->getExtraBreadcrumbItems();
        
        // Check Breadcrumb Item Instances:
        
        $extra->each(function ($item) {
            
            if (!($item instanceof SiteTree) && !($item instanceof Crumbable)) {
                
                throw new Exception(
                    sprintf(
                        'Item of class "%s" is not a SiteTree object or an implementor of Crumbable',
                        get_class($item)
                    )
                );
                
            }
            
        });
        
        // Merge Extra Breadcrumb Items:
        
        $items->merge($extra);
        
        // Answer Breadcrumb Items:
        
        return $items;
    }
445552
public static List<Path> getSubPathList(Path startDirectoryPath,
			int maxDepth) {
		return getSubPathList(startDirectoryPath, maxDepth,
				JMPredicate.getTrue());
	}
1005467
public function getList(PageInterface $current = null, $level = 0, $rawRoutes = false, $showAll = true, $showFullpath = false, $showSlug = false, $showModular = false, $limitLevels = false)
    {
        if (!$current) {
            if ($level) {
                throw new \RuntimeException('Internal error');
            }

            $current = $this->root();
        }

        $list = [];

        if (!$current->root()) {
            if ($rawRoutes) {
                $route = $current->rawRoute();
            } else {
                $route = $current->route();
            }

            if ($showFullpath) {
                $option = $current->route();
            } else {
                $extra  = $showSlug ? '(' . $current->slug() . ') ' : '';
                $option = str_repeat('&mdash;-', $level). '&rtrif; ' . $extra . $current->title();


            }

            $list[$route] = $option;


        }

        if ($limitLevels === false || ($level+1 < $limitLevels)) {
            foreach ($current->children() as $next) {
                if ($showAll || $next->routable() || ($next->modular() && $showModular)) {
                    $list = array_merge($list, $this->getList($next, $level + 1, $rawRoutes, $showAll, $showFullpath, $showSlug, $showModular, $limitLevels));
                }
            }
        }

        return $list;
    }
1159500
public function getBannedCommunityUsers($communityId, $accessToken, $limit = 10, $cursor = null)
    {
        if (!$this->apiVersionIsGreaterThanV3()) {
            throw new EndpointNotSupportedByApiVersionException();
        }

        if (!$this->isValidLimit($limit)) {
            throw new InvalidLimitException();
        }

        if ($cursor && !is_string($cursor)) {
            throw new InvalidTypeException('Cursor', 'string', gettype($cursor));
        }

        $params = [
            'limit' => intval($limit),
            'cursor' => $cursor,
        ];

        return $this->get(sprintf('communities/%s/bans', $communityId), $params, $accessToken);
    }
207132
private function decidePaginatorFormat(
        DoctrinePaginator $paginator,
        string $parameterType,
        int $limitPerPage,
        int $page
    ) {
        if (Pagerfanta::class === $parameterType) {
            $paginator = new Pagerfanta(new DoctrineORMAdapter($paginator->getQuery()));
            $paginator->setMaxPerPage($limitPerPage);
            $paginator->setCurrentPage($page);
        }
        if (PaginationInterface::class === $parameterType) {
            $knp = new KnpPaginator();
            $paginator = $knp->paginate($paginator->getQuery(), $page, $limitPerPage);
        }

        return $paginator;
    }
689608
public function createBreadcrumb()
    {
        if (null === $this->breadcrumb) {
            $this->createBreadcrumbRoot();

            // Retrieve the current page.
            $currentPage = $this->pageHelper->getCurrent();

            // If not found look for a parent
            if (null === $currentPage && null !== $request = $this->pageHelper->getRequest()) {
                // TODO create a route finder ? (same in AdminBundle ResourceHelper)
                $routeName = $request->attributes->get('_route');
                $i18nRouterClass = 'JMS\I18nRoutingBundle\Router\I18nRouterInterface';
                if (interface_exists($i18nRouterClass) && $this->router instanceof $i18nRouterClass) {
                    $route = $this->router->getOriginalRouteCollection()->get($routeName);
                } else {
                    $route = $this->router->getRouteCollection()->get($routeName);
                }
                if (null !== $route) {
                    $cmsOptions = $route->getOption('_cms');
                    if (null !== $cmsOptions
                        && array_key_exists('parent', $cmsOptions)
                        && 0 < strlen($cmsOptions['parent'])
                    ) {
                        $currentPage = $this->pageHelper->findByRoute($cmsOptions['parent']);
                    }
                }
            }

            // If found, build the breadcrumb
            if (null !== $currentPage) {
                $repository = $this->pageHelper->getPageRepository();
                $pages = $repository->findParentsForBreadcrumb($currentPage);

                // Fill the menu
                foreach ($pages as $page) {
                    if ($page['dynamicPath']) {
                        $params = ['uri' => null];
                    } else {
                        $params = ['route' => $page['route']];
                    }
                    $this->breadcrumb
                        ->addChild('page-' . $page['id'], $params)
                        ->setLabel($page['breadcrumb']);
                    $this->tagManager->addTags(sprintf('%s[id:%s]', $repository->getCachePrefix(), $page['id']));
                }
            }
        }

        return $this->breadcrumb;
    }
904410
public function getDirectories($showHidden = false)
    {
        $it = $this->getContents();

        return array_filter($it, function (HandlerInterface $handler) use ($showHidden) {
            return $handler->isDir() && ($showHidden ?: strpos($handler->getFilename(), '.') !== 0);
        });
    }
843849
protected function breadcrumbsIndex($route, $parsedRoute) {
        $urlContext = [];
        if (isset($parsedRoute['params'])) {
            if (isset($parsedRoute['params']['session'])) {
                $session = $parsedRoute['params']['session'];
                $urlContext['session'] = is_array($session) ? implode(',', $session) : $session;
            }
            if (isset($parsedRoute['params']['delivery'])) {
                $urlContext['delivery'] = $parsedRoute['params']['delivery'];
            }
            if (isset($parsedRoute['params']['context'])) {
                $urlContext['context'] = $parsedRoute['params']['context'];
            }
        }

        $breadcrumbs = array(
            'id' => 'history',
            'url' => _url('sessionHistory', 'Reporting', 'taoProctoring', $urlContext),
            'label' => __('Session history')
        );

        return $breadcrumbs;
    }
679462
protected function getFindPager(Query $query, $currentPage, $maxPerPage)
    {
        $adapter = new FindAdapter($query, $this->getSite()->getFindService());
        $pager = new Pagerfanta($adapter);

        $pager->setNormalizeOutOfRangePages(true);
        $pager->setMaxPerPage($maxPerPage);
        $pager->setCurrentPage($currentPage);

        return $pager;
    }
352702
protected function createContentSearchPager(Query $query, $currentPage, $maxPerPage)
    {
        @trigger_error(
            'PagerfantaFindTrait is deprecated since version 2.5 and will be removed in 3.0. Use PagerfantaTrait instead.',
            E_USER_DEPRECATED
        );

        $adapter = new ContentSearchAdapter($query, $this->getSite()->getFindService());

        return $this->getPager($adapter, $currentPage, $maxPerPage);
    }
663217
protected function AllowAccessToStep($bRedirectToPreviousPermittedStep = false)
    {
        $bAllowAccess = parent::AllowAccessToStep($bRedirectToPreviousPermittedStep);
        if ($bAllowAccess && $bRedirectToPreviousPermittedStep) {
            $oUser = TdbDataExtranetUser::GetInstance();
            if ($oUser->IsLoggedIn()) {
                $this->JumpToStep($this->GetNextStep());
            }
        }

        return $bAllowAccess;
    }
632791
public function search($applicablePropertyModelId, $params, $showHidden = false)
    {
        $query = self::find()
            ->where([
                'applicable_property_model_id' => $applicablePropertyModelId,
            ]);

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'pagination' => [
                'pageSize' => 10,
            ],
        ]);
        $dataProvider->sort->attributes['name'] = [
            'asc' => ['property_group_translation.name' => SORT_ASC],
            'desc' => ['property_group_translation.name' => SORT_DESC],
        ];

        if (!($this->load($params))) {
            if ($showHidden === false) {
                $this->is_deleted = 0;
                $query->andWhere(['is_deleted' => $this->is_deleted]);
            }
            return $dataProvider;
        }

        // perform filtering
        $query->andFilterWhere(['id' => $this->id]);
        $query->andFilterWhere(['like', 'internal_name', $this->internal_name]);
        $query->andFilterWhere(['is_auto_added' => $this->is_auto_added]);
        $query->andFilterWhere(['is_deleted' => $this->is_deleted]);
        // filter by multilingual field
        $query->andFilterWhere(['like', 'property_group_translation.name', $this->name]);

        return $dataProvider;
    }
902404
public function getPagedResults($limit = 50, $page = 0): Paginator
    {
        $dql = sprintf(self::DQL_GET_PAGED, TargetTemplate::class);
        return $this->getPaginator($dql, $limit, $page);
    }
1098332
protected function keyValueTypeToRule(KeyValueType $type, $maxDepth, array $relations, array &$path)
    {

        $rules = [];

        foreach ($type as $key=>$keyType) {

            $path[] = $key;

            if ($relations && $keyType instanceof KeyValueType && !in_array(implode('.', $path), $relations)) {
                array_pop($path);
                continue;
            }

            $rules[$key] = $this->toRuleRecursive($type[$key], $maxDepth, $relations, $path);

            array_pop($path);

        }

        return $rules;

    }
916863
protected function getFilterPager(Query $query, $currentPage, $maxPerPage)
    {
        $adapter = new FilterAdapter($query, $this->getSite()->getFilterService());
        $pager = new Pagerfanta($adapter);

        $pager->setNormalizeOutOfRangePages(true);
        $pager->setMaxPerPage($maxPerPage);
        $pager->setCurrentPage($currentPage);

        return $pager;
    }
321759
private function getListingParameters($contentTypeSlug, $allowViewless = false)
    {
        $contentType = $this->getContentType(current(explode('/', $contentTypeSlug)));

        // If there is no ContentType, don't get parameters for it
        if ($contentType === false) {
            return [];
        }

        // If the ContentType is 'viewless', don't show the listing / record page.
        if ($contentType['viewless'] && !$allowViewless) {
            $this->abort(Response::HTTP_NOT_FOUND, 'Page ' . $contentType['slug'] . ' not found.');
        }

        // Build the pager
        $page = $this->app['pager']->getCurrentPage($contentType['slug']);
        $order = isset($contentType['listing_sort']) ? $contentType['listing_sort'] : $this->getListingOrder($contentType);

        // CT value takes precedence over theme & config.yml
        if (!empty($contentType['listing_records'])) {
            $amount = $contentType['listing_records'];
        } else {
            $amount = $this->getOption('theme/listing_records') ?: $this->getOption('general/listing_records');
        }

        return ['limit' => $amount, 'order' => $order, 'page' => $page, 'paging' => true];
    }
436470
private void showHiddenTabPopup() {
		JPopupMenu menu = new JPopupMenu();
		if (getMousePosition() == null) {
			// Startup
			return;
		}
		Collections.sort(this.hiddenTabs, NAME_COMPARATOR);
		
		for (Component c : this.hiddenTabs) {
			if (c instanceof AbstractPanel) {
				final AbstractPanel ap = (AbstractPanel)c;
				JMenuItem mi = new JMenuItem(ap.getName());
				mi.setIcon(ap.getIcon());
				mi.addActionListener(new ActionListener(){
					@Override
					public void actionPerformed(ActionEvent e) {
						setVisible(ap, true);
						ap.setTabFocus();
					}});
				menu.add(mi);
			}
		}
		menu.show(this, this.getMousePosition().x, this.getMousePosition().y);
	}