Loads ALL of the pages for this lesson

@return array An array containing all pages from this lesson
974640
public function load_all_pages() {
        if (!$this->loadedallpages) {
            $manager = lesson_page_type_manager::get($this);
            $this->pages = $manager->load_all_pages($this);
            $this->loadedallpages = true;
        }
        return $this->pages;
    }
288317
private function initializePageParts()
    {
        // Get all the pagepartrefs
        /** @var PagePartRefRepository $ppRefRepo */
        $ppRefRepo = $this->em->getRepository('KunstmaanPagePartBundle:PagePartRef');
        $ppRefs = $ppRefRepo->getPagePartRefs($this->page, $this->context);

        // Group pagepartrefs per type
        $types = array();
        foreach ($ppRefs as $pagePartRef) {
            $types[$pagePartRef->getPagePartEntityname()][] = $pagePartRef->getPagePartId();
            $this->pagePartRefs[$pagePartRef->getId()] = $pagePartRef;
        }

        // Fetch all the pageparts (only one query per pagepart type)
        /** @var EntityInterface[] $pageParts */
        $pageParts = array();
        foreach ($types as $classname => $ids) {
            $result = $this->em->getRepository($classname)->findBy(array('id' => $ids));
            $pageParts = array_merge($pageParts, $result);
        }

        // Link the pagepartref to the pagepart
        foreach ($this->pagePartRefs as $pagePartRef) {
            foreach ($pageParts as $key => $pagePart) {
                if (ClassLookup::getClass($pagePart) == $pagePartRef->getPagePartEntityname()
                    && $pagePart->getId() == $pagePartRef->getPagePartId()
                ) {
                    $this->pageParts[$pagePartRef->getId()] = $pagePart;
                    unset($pageParts[$key]);

                    break;
                }
            }
        }
    }
789420
public function getPages()
	{
		return $this->total > $this->limit ? ceil($this->total / $this->limit) : 1;
	}
788640
public function get_children() {
        $children = array();

        if ($child = $this->get_area_coursecat_description(0, '/', '.')) {
            $children[] = $child;
        }

        list($coursecats, $hiddencats) = $this->get_categories();
        foreach ($coursecats as $category) {
            $context = context_coursecat::instance($category->id);
            $children[] = new self($this->browser, $context, $category);
        }

        $courses = $this->get_courses($hiddencats);
        foreach ($courses as $course) {
            $children[] = $this->get_child_course($course);
        }

        return array_filter($children);
    }
915107
public function load()
    {
        // NOTE: ALL THE LOCAL VARIABLES ARE USED INSIDE INCLUDED FILE, DO NOT REMOVE THEM!
        $grav = $this->grav;
        $config = $this->config;
        $name = $this->current();

        /** @var UniformResourceLocator $locator */
        $locator = $grav['locator'];
        $file = $locator('theme://theme.php') ?: $locator("theme://{$name}.php");

        $inflector = $grav['inflector'];

        if ($file) {
            // Local variables available in the file: $grav, $config, $name, $file
            $class = include $file;

            if (!is_object($class)) {
                $themeClassFormat = [
                    'Grav\\Theme\\' . ucfirst($name),
                    'Grav\\Theme\\' . $inflector->camelize($name)
                ];

                foreach ($themeClassFormat as $themeClass) {
                    if (class_exists($themeClass)) {
                        $themeClassName = $themeClass;
                        $class = new $themeClassName($grav, $config, $name);
                        break;
                    }
                }
            }
        } elseif (!$locator('theme://') && !defined('GRAV_CLI')) {
            exit("Theme '$name' does not exist, unable to display page.");
        }

        $this->config->set('theme', $config->get('themes.' . $name));

        if (empty($class)) {
            $class = new Theme($grav, $config, $name);
        }

        return $class;
    }
182106
protected function getPageList() {
		$linkPage = '';
		$linkPage .= $this->replaceLine(1);
		$lastList = floor($this->get('length') / 2);
		$i = 0;
		$length = 0;
		if ($this->pageTotal < $this->get('length') || $this->get('page') - $lastList < 2 || $this->pageTotal - $this->get('length') < 2) {
			$i = 2;
			if ($this->pageTotal <= $this->get('length')) {
				$length = $this->pageTotal - 1;
			} else {
				$length = $this->get('length');
			}
		} elseif ($this->get('page') - $lastList>= 2 && $this->get('page') + $lastList <= $this->pageTotal) {
			$i = $this->get('page')- $lastList;
			$length = $this->get('page') + $lastList- 1;
		} elseif ($this->get('page') + $lastList > $this->pageTotal) {
			$i = $this->pageTotal - $this->get('length') + 1;
			$length = $this->pageTotal - 1;
		}
		if ($this->get('page') > $lastList + 1 && $i > 2) {
			$linkPage .= $this->getOmit();
		}
		for (; $i <= $length; $i ++) {
			$linkPage .= $this->replaceLine($i);
		}
		if ($this->get('page') < $this->pageTotal - $lastList && $length < $this->pageTotal - 1) {
			$linkPage .= $this->getOmit();
		}
		$linkPage .= $this->replaceLine($this->pageTotal);
		return $linkPage;
	}
22333
public function Pages()
    {
        $pages = SiteTree::get();
        $types = $this->PageTypes->getValue();
        if (count($types)) {
            $pages = $pages->filter('ClassName', $types);
        }

        $parents = $this->PageParents()->column('ID');
        if (count($parents)) {
            $pages = $pages->filter('ParentID', $parents);
        }

        return $pages;
    }
1086453
protected function get_all_concepts() {
        global $USER;

        if ($this->cache === null) {
            $this->cache = cache::make_from_params(cache_store::MODE_REQUEST, 'filter', 'glossary');
        }

        // Try to get current course.
        $coursectx = $this->context->get_course_context(false);
        if (!$coursectx) {
            // Only global glossaries will be linked.
            $courseid = 0;
        } else {
            $courseid = $coursectx->instanceid;
        }

        $cached = $this->cache->get('concepts');
        if ($cached !== false && ($cached->cachecourseid != $courseid || $cached->cacheuserid != $USER->id)) {
            // Invalidate the page cache.
            $cached = false;
        }

        if ($cached !== false && is_array($cached->cacheconceptlist)) {
            return $cached->cacheconceptlist;
        }

        list($glossaries, $allconcepts) = \mod_glossary\local\concept_cache::get_concepts($courseid);

        if (!$allconcepts) {
            $tocache = new stdClass();
            $tocache->cacheuserid = $USER->id;
            $tocache->cachecourseid = $courseid;
            $tocache->cacheconceptlist = [];
            $this->cache->set('concepts', $tocache);
            return [];
        }

        $conceptlist = array();

        foreach ($allconcepts as $concepts) {
            foreach ($concepts as $concept) {
                $conceptlist[] = new filterobject($concept->concept, null, null,
                        $concept->casesensitive, $concept->fullmatch, null,
                        [$this, 'filterobject_prepare_replacement_callback'], [$concept, $glossaries]);
            }
        }

        // We sort longest first, so that when we replace the terms,
        // the longest ones are replaced first. This does the right thing
        // when you have two terms like 'Moodle' and 'Moodle 3.5'. You want the longest match.
        usort($conceptlist, [$this, 'sort_entries_by_length']);

        $conceptlist = filter_prepare_phrases_for_filtering($conceptlist);

        $tocache = new stdClass();
        $tocache->cacheuserid = $USER->id;
        $tocache->cachecourseid = $courseid;
        $tocache->cacheconceptlist = $conceptlist;
        $this->cache->set('concepts', $tocache);

        return $conceptlist;
    }
198916
public function getPages()
    {
        $pages = new Page();
        $userPages = new UserPage();
        $sql = "SELECT * FROM " . $userPages->getTableName() . " as up
        LEFT JOIN {$pages->getTableName()} as p ON up.id_page = p.id
        WHERE up.id_user = " . $this->id;

        return $this->db->select($sql);
    }
595278
private function getPages()
    {
        $rootPageId = $this->pluginConfig['urlEntries']['pages']['rootPageId'];
        $rootPage = $this->pageRepository->getPage($rootPageId);

        $cacheIdentifier = md5($rootPageId . '-pagesForSitemap');
        if ($this->cacheInstance->has($cacheIdentifier)) {
            $pages = $this->cacheInstance->get($cacheIdentifier);
        } else {
            $pages = $this->getSubPagesRecursive($rootPageId);
            $this->cacheInstance->set($cacheIdentifier, $pages, ['pagesForSitemap']);
        }

        return array_merge([$rootPage], $pages);
    }
332157
protected function _loadPageLevels()
    {
        $urlSegments = count(Request::segments());

        // check for homepage feed
        if ($urlSegments == 1 && substr(Request::segment(1), 0, 5) == 'root.') {
            if ($this->feedExtension = Feed::getFeedExtensionFromPath(Request::segment(1))) {
                $urlSegments = 0;
            }
        }

        // load homepage
        if (empty($this->pageLevels[0])) {
            $this->pageLevels[0] = self::_loadHomePage();
        }

        // load sub pages
        if ($urlSegments) {
            for ($i = 1; $i <= $urlSegments; $i++) {
                if (empty($this->pageLevels[$i])) {

                    $currentSegment = Request::segment($i);

                    if ($urlSegments == $i && $this->feedExtension = Feed::getFeedExtensionFromPath($currentSegment)) {
                        Feed::removeFeedExtensionFromPath($currentSegment);
                    }

                    $parentPage = $this->pageLevels[$i - 1];
                    if ($i == 1) {
                        $parentPage = isset($parentPage) ? clone $parentPage : new Page;
                        $parentPage->id = 0;
                    }

                    $this->pageLevels[$i] = self::_loadSubPage($currentSegment, $parentPage);

                    if (empty($this->pageLevels[$i])) {
                        if (($searchOffset = self::_isSearchPage($currentSegment, $parentPage)) !== false) {
                            $this->searchRequired = true;
                            $this->searchQuery = implode('/', array_slice(Request::segments(), $i - 1 + $searchOffset));
                            unset($this->pageLevels[$i]);
                            $urlSegments = $i - 1;
                        }
                        break;
                    }

                }
            }
        }

        $this->pageLevels = array_filter($this->pageLevels);

        if (!empty($this->pageLevels[$urlSegments])) {
            $this->is404 = false;
        } else {
            $page404 = new Page;
            $page404Lang = new PageLang;
            $page404Lang->url = '';
            $page404Lang->name = '404';
            $page404->setRelation('pageCurrentLang', $page404Lang);
            $this->pageLevels[] = $page404;
        }

        if ($this->searchQuery === false && $query = Request::input('q')) {
            $this->searchQuery = $query;
        }
        $this->searchQuery = $this->searchQuery !== false ? urldecode($this->searchQuery) : false;
    }
1078793
protected function loadQuery()
    {
        if( !isset( $this->session[ $this->saveID ] ) ) {
            return;
        }
        $saved        = $this->session[ $this->saveID ];
        $this->inputs = array_merge( $saved[ 'inputs' ], $this->inputs );
        $this->perPage = $saved[ 'perPage' ];
        if( $currPage=$this->getKey($this->pager) ) {
            $this->currPage = $currPage;
        } else{
            $this->currPage = $saved['currPage'];
        }
    }
250571
public function get_lastpageid() {
        global $DB;
        if ($this->lastpageid == null) {
            if (!$this->loadedallpages) {
                $lastpageid = $DB->get_field('lesson_pages', 'id', array('lessonid'=>$this->properties->id, 'nextpageid'=>0));
                if (!$lastpageid) {
                    print_error('cannotfindlastpage', 'lesson');
                }
                $this->lastpageid = $lastpageid;
            } else {
                $lastpageid = $this->get_lastpage();
                $this->lastpageid = $lastpageid->id;
            }
        }

        return $this->lastpageid;
    }
262824
public function getAllPagetypes()
    {
        $path = config('page.paths.pagetypes');

        $pagetypes = collect();

        // Loop though all files in path and manually instantiate classes.
        foreach (glob($path.'/*.php') as $filename) {
            $fullClassName = self::getFullNamespace($filename).'\\'.self::getClassName($filename);
            $pagetypes[] = new $fullClassName;
        }

        return $pagetypes;
    }
737759
public static function getList()
    {
        $db = Loader::db();
        $r = $db->query("select Pages.cID from Pages inner join Collections on Pages.cID = Collections.cID where cFilename is not null order by cDateModified desc");
        $pages = array();
        while ($row = $r->fetchRow()) {
            $c = Page::getByID($row['cID']);
            $pages[] = $c;
        }

        return $pages;
    }
757462
protected function loadPagetree()
    {
        $environment = $this->getEnvironment();
        $input       = $environment->getInputProvider();
        $session     = $environment->getSessionStorage();
        $field       = $input->getValue('field');
        $name        = $input->getValue('name');
        $level       = (int) $input->getValue('level');
        $rootId      = $input->getValue('id');

        $ajaxId   = \preg_replace('/.*_([0-9a-zA-Z]+)$/', '$1', $rootId);
        $ajaxKey  = \str_replace('_' . $ajaxId, '', $rootId);
        $ajaxName = null;
        if ('editAll' === $input->getValue('act')) {
            $ajaxKey  = \preg_replace('/(.*)_[0-9a-zA-Z]+$/', '$1', $ajaxKey);
            $ajaxName = \preg_replace('/.*_([0-9a-zA-Z]+)$/', '$1', $name);
        }

        $nodes          = $session->get($ajaxKey);
        $nodes[$ajaxId] = (int) $input->getValue('state');
        $session->set($ajaxKey, $nodes);

        $arrData['strTable'] = $environment->getDataDefinition()->getName();
        $arrData['id']       = $ajaxName ?: $rootId;
        $arrData['name']     = $name;

        /** @var \PageSelector $widget */
        $widget        = new $GLOBALS['BE_FFL']['pageSelector']($arrData, $this->getDataContainer());
        $widget->value = $this->getTreeValue('page', $input->getValue('value'));


        $response = new Response($widget->generateAjax($ajaxId, $field, $level));

        throw new ResponseException($response);
    }
1138973
public function all() {
        $size = $this->maxPageSize();

        $firstPageResponse = $this->request( $this->createPaginatedRequestQuery( 0, $size ) );
        $header_values = $firstPageResponse->getResponse()->getHeader('X-Result-Total');
        $total = array_shift($header_values);

        $result = $firstPageResponse->json();

        if( $total <= $size ) {
            return $result;
        }

        $requests = [];
        for( $page = 1; $page < ceil( $total / $size ); $page++ ) {
            $requests[] = $this->createPaginatedRequestQuery( $page, $size );
        }

        $responses = $this->requestMany( $requests );

        foreach( $responses as $response ) {
            $result = array_merge( $result, $response->json() );
        }

        return $result;
    }