@param Page

@return string
174274
public function getText(Page $page = null)
    {
        if ($contents = $this->get('Contents')) {

            if ($contents instanceof ElementMissing) {
                return '';
			} elseif ($contents instanceof ElementNull) {
				return '';
            } elseif ($contents instanceof PDFObject) {
                $elements = $contents->getHeader()->getElements();

                if (is_numeric(key($elements))) {
                    $new_content = '';

                    foreach ($elements as $element) {
                        if ($element instanceof ElementXRef) {
                            $new_content .= $element->getObject()->getContent();
                        } else {
                            $new_content .= $element->getContent();
                        }
                    }

                    $header   = new Header(array(), $this->document);
                    $contents = new PDFObject($this->document, $header, $new_content);
                }
            } elseif ($contents instanceof ElementArray) {
                // Create a virtual global content.
                $new_content = '';

                foreach ($contents->getContent() as $content) {
                    $new_content .= $content->getContent() . "\n";
                }

                $header   = new Header(array(), $this->document);
                $contents = new PDFObject($this->document, $header, $new_content);
            }

            return $contents->getText($this);
        }

        return '';
    }
22731
public function getUrl($page)
	{
		$parameters = array(
			$this->env->getPageName() => $page,
		);

		// If we have any extra query string key / value pairs that need to be added
		// onto the URL, we will put them in query string form and then attach it
		// to the URL. This allows for extra information like sortings storage.
		if (count($this->query) > 0)
		{
			$parameters = array_merge($parameters, $this->query);
		}

		$fragment = $this->buildFragment();

		return $this->env->getCurrentUrl().'?'.http_build_query($parameters, null, '&').$fragment;
	}
2740
public function getTranslatedPageID($page)
    {
        $ids = static::getIDList();
        if (in_array($page->getCollectionID(), $ids)) {
            return $this->locale->getSiteTree()->getSiteHomePageID();
        }

        $mpRelationID = self::getMultilingualPageRelationID($page->getCollectionID());

        if ($mpRelationID) {
            $cID = self::getCollectionIDForLocale($mpRelationID, $this->getLocale());

            return $cID;
        }
    }
830271
public function render_head_html($page = null) {
        if (is_null($page)) {
            global $PAGE;
            $page = $PAGE;
        }
        // TODO go via behaviour.
        return $this->question->get_renderer($page)->head_code($this) .
                $this->behaviour->get_renderer($page)->head_code($this);
    }
202136
public function getTextArray(Page $page = null)
	{
		$text                = array();
		$sections            = $this->getSectionsText($this->content);
		$current_font        = new Font($this->document);

		foreach ($sections as $section) {

			$commands = $this->getCommandsText($section);

			foreach ($commands as $command) {

				switch ($command[self::OPERATOR]) {
					// set character spacing
					case 'Tc':
						break;

					// move text current point
					case 'Td':
						break;

					// move text current point and set leading
					case 'TD':
						break;

					case 'Tf':
						list($id,) = preg_split('/\s/s', $command[self::COMMAND]);
						$id           = trim($id, '/');
						$current_font = $page->getFont($id);
						break;

					case "'":
					case 'Tj':
						$command[self::COMMAND] = array($command);
					case 'TJ':
						// Skip if not previously defined, should never happened.
						if (is_null($current_font)) {
							// Fallback
							// TODO : Improve
							$text[] = $command[self::COMMAND][0][self::COMMAND];
							break;
						}

						$sub_text = $current_font->decodeText($command[self::COMMAND]);
						$text[] = $sub_text;
						break;

					// set leading
					case 'TL':
						break;

					case 'Tm':
						break;

					// set super/subscripting text rise
					case 'Ts':
						break;

					// set word spacing
					case 'Tw':
						break;

					// set horizontal scaling
					case 'Tz':
						//$text .= "\n";
						break;

					// move to start of next line
					case 'T*':
						//$text .= "\n";
						break;

					case 'Da':
						break;

					case 'Do':
						if (!is_null($page)) {
							$args = preg_split('/\s/s', $command[self::COMMAND]);
							$id   = trim(array_pop($args), '/ ');
							if ($xobject = $page->getXObject($id)) {
								$text[] = $xobject->getText($page);
							}
						}
						break;

					case 'rg':
					case 'RG':
						break;

					case 're':
						break;

					case 'co':
						break;

					case 'cs':
						break;

					case 'gs':
						break;

					case 'en':
						break;

					case 'sc':
					case 'SC':
						break;

					case 'g':
					case 'G':
						break;

					case 'V':
						break;

					case 'vo':
					case 'Vo':
						break;

					default:
				}
			}
		}

		return $text;
	}
1224182
public static function getBySectionOfSite($page)
    {
        $identifier = sprintf('/multilingual/section/%s', $page->getCollectionID());
        $cache = \Core::make('cache/request');
        $item = $cache->getItem($identifier);
        if (!$item->isMiss()) {
            $returnID = $item->get();
        } else {

            $item->lock();

            $returnID = false;

            if ($page->isPageDraft()) {
                $tree = false;
                if ($page->getPageDraftTargetParentPageID()) {
                    $cParentID = $page->getPageDraftTargetParentPageID();
                    if ($cParentID) {
                        $parent = Page::getByID($cParentID);
                        $tree = $parent->getSiteTreeObject();
                    }
                }
            }

            if (!isset($tree)) {
                $tree = $page->getSiteTreeObject();
            }

            if ($tree instanceof SiteTree) {
                $returnID = $tree->getSiteHomePageID();
            }

            $cache->save($item->set($returnID));
        }

        if ($returnID) {
            return static::getByID($returnID);
        }
    }
998705
public function getMetadataAction(Page $page)
    {
        $metadata = null !== $page->getMetaData() ? $page->getMetaData()->jsonSerialize() : array();
        if (empty($metadata)) {
            $metadata = $this->application->getContainer()->get('nestednode.metadata.resolver')->resolve($page);
        }

        return $this->createJsonResponse($metadata);
    }
892540
public function getPage($page) {
			if (array_key_exists($page, $this->pageCache))
				return $this->pageCache[$page];

			if (!file_exists(sprintf('%s/pages/%s.php', $this->getPluginRoot(), $page)))
				return '<div><strong>Page not found.</strong></div>';
			else {
				ob_start();

				include sprintf('%s/pages/%s.php', $this->getPluginRoot(), $page);

				$data = ob_get_clean();
			}

			$this->pageCache[$page] = $data;

			return $data;
		}
742628
public static function startPage($page = null)
    {
        if ($page !== null) {
            self::$_startPage = $page;
        }
        return self::$_startPage;
    }
409107
public function Index($Page = '') {
		$this->AddJsFile('search.js');
		$this->Title(T('Search'));
      
      SaveToConfig('Garden.Format.EmbedSize', '160x90', FALSE);
      Gdn_Theme::Section('SearchResults');
      
      list($Offset, $Limit) = OffsetLimit($Page, C('Garden.Search.PerPage', 20));
      $this->SetData('_Limit', $Limit);
		
		$Search = $this->Form->GetFormValue('Search');
      $Mode = $this->Form->GetFormValue('Mode');
      if ($Mode)
         $this->SearchModel->ForceSearchMode = $Mode;
      try {
         $ResultSet = $this->SearchModel->Search($Search, $Offset, $Limit);
      } catch (Gdn_UserException $Ex) {
         $this->Form->AddError($Ex);
         $ResultSet = array();
      } catch (Exception $Ex) {
         LogException($Ex);
         $this->Form->AddError($Ex);
         $ResultSet = array();
      }
      Gdn::UserModel()->JoinUsers($ResultSet, array('UserID'));
      
      // Fix up the summaries.
      $SearchTerms = explode(' ', Gdn_Format::Text($Search));
      foreach ($ResultSet as &$Row) {
         $Row['Summary'] = SearchExcerpt(Gdn_Format::PlainText($Row['Summary'], $Row['Format']), $SearchTerms);
         $Row['Format'] = 'Html';
      }
      
		$this->SetData('SearchResults', $ResultSet, TRUE);
		$this->SetData('SearchTerm', Gdn_Format::Text($Search), TRUE);
		if($ResultSet)
			$NumResults = count($ResultSet);
		else
			$NumResults = 0;
		if ($NumResults == $Offset + $Limit)
			$NumResults++;
		
		// Build a pager
		$PagerFactory = new Gdn_PagerFactory();
		$this->Pager = $PagerFactory->GetPager('MorePager', $this);
		$this->Pager->MoreCode = 'More Results';
		$this->Pager->LessCode = 'Previous Results';
		$this->Pager->ClientID = 'Pager';
		$this->Pager->Configure(
			$Offset,
			$Limit,
			$NumResults,
			'dashboard/search/%1$s/%2$s/?Search='.Gdn_Format::Url($Search)
		);
		
//		if ($this->_DeliveryType != DELIVERY_TYPE_ALL) {
//         $this->SetJson('LessRow', $this->Pager->ToString('less'));
//         $this->SetJson('MoreRow', $this->Pager->ToString('more'));
//         $this->View = 'results';
//      }
		
      $this->CanonicalUrl(Url('search', TRUE));

		$this->Render();
	}
949245
public function getLinkForPage($page)
    {
        return $page->Link() . "article/" . $this->HailID . '/' . Convert::raw2url($this->Title);
    }
1161625
function renderPage(page) {
    var template = pageTemplate(page);
    var html = renderTemplate(page, template);
    return '<div data-render-page="' + esc(template) + '">' + html + '</div>';
  }
839755
public function sitemap($page = null)
    {
        $ret = array();

        foreach ($this->sitemapPages as $sitemapPage) {
            if (empty($this->pages[$sitemapPage['page_uid']])) {
                // invalid page
                continue;
            }

            $ret[] = GeneralUtility::fullUrl($sitemapPage['page_url']);
        }

        // Call hook
        GeneralUtility::callHookAndSignal(__CLASS__, 'sitemapTextOutput', $this, $ret);

        return implode("\n", $ret);
    }
31810
protected function buildPageUrl(int $page): string
	{
		if($this->params === null)
		{
			$this->params = $this->request->getQuery()->all();
		}

		return $this->urlBuilder->current([$this->options['page_key'] => $page] + $this->params);
	}
1030458
private function get_link_html($page)
    {
        global $post;

        if (! empty($post) && $page->ID == $post->ID) {
            $li_class = $this->args['li_active_class'] . ' ' . $this->args['li_class'];
            $link_class = $this->args['link_active_class'] . ' ' . $this->args['link_class'];
        } else {
            $li_class = $this->args['li_class'];
            $link_class = $this->args['link_class'];
        }

        return \sprintf(
            '<li class="%s">%s<a class="%s" href="%s">%s%s%s</a>%s</li>',
            $li_class,
            $this->args['before_link'],
            $link_class,
            get_the_permalink($page),
            $this->args['before_text'],
            get_the_title($page),
            $this->args['after_text'],
            $this->args['after_link']
        );
    }
978681
public function actionIndex($page = 1)
    {
        $sort = [];
        $params = Yii::$app->request->queryParams;
        if (empty($params['sort'])) {
            $sort['defaultOrder'] = ['parent_uid' => SORT_ASC, 'module_id' => SORT_ASC];
        } else {
            if($params['sort'] == 'module_id') {
                $sort['defaultOrder'] = ['parent_uid' => SORT_ASC, 'module_id' => SORT_ASC];
                unset($params['sort']);
            } else if ($params['sort'] == '-module_id') {
                $sort['defaultOrder'] = ['parent_uid' => SORT_DESC, 'module_id' => SORT_DESC];
                unset($params['sort']);
            }
            Yii::$app->request->setQueryParams($params);
        }

        $dataProvider = new ActiveDataProvider([
            'query' => Modmgr::find(),
            'sort' => $sort,
        ]);

        $pager = $dataProvider->getPagination();
        $pager->pageSize = $this->pageSize;
        $pager->page = $page - 1; //! from 0

        return $this->render('index', [
            'dataProvider' => $dataProvider,
        ]);
    }
544428
public function createUri($page)
    {
        $queryString   = $this->query;
        $queryString[] = "page={$page}";
        $queryString   = implode('&', $queryString);

        return Request::pathInfo() . "?{$queryString}";
    }