Get link page localization
@return Localization
332383
public function getPageLocalization()
	{
		throw new \Exception('Dont use me bro.');

		if (empty($this->pageId)) {
			return;
		}

		if ( ! is_null($this->pageLocalization)) {
			return $this->pageLocalization;
		}

		$em = ObjectRepository::getEntityManager($this);

		$pageData = null;
		$localizationEntity = Localization::CN();
		$localeId = ObjectRepository::getLocaleManager($this)
				->getCurrent()
				->getId();

		$criteria = array(
			'master' => $this->pageId,
			'locale' => $localeId,
		);

		// Now master page ID is stored, still the old implementation is working
		$dql = "SELECT l, m, p FROM $localizationEntity l
				JOIN l.master m
				LEFT JOIN l.path p
				WHERE (l.master = :master AND l.locale= :locale)
				OR l.id = :master";

		try {
			$pageData = $em->createQuery($dql)
					->setParameters($criteria)
					->getSingleResult();
		} catch (NoResultException $noResult) {

			// Special case for group page selection when no localization exists in database
			$master = $em->find(GroupPage::CN(), $this->pageId);

			if ($master instanceof GroupPage) {
				$pageData = $master->getLocalization($localeId);
			}
		}

		// Cache the result
		$this->pageLocalization = $pageData;

		return $pageData;
	}
905657
private Locale getWorkplaceLocale() {

        Locale result = OpenCms.getWorkplaceManager().getWorkplaceLocale(getCmsObject());
        if (result == null) {
            result = CmsLocaleManager.getDefaultLocale();
        }
        if (result == null) {
            result = Locale.getDefault();
        }
        return result;
    }
904423
public function getPageCanonical()
    {
        if (!$this->parser) {
            return;
        }

        $node = $this->parser->find('link[rel=canonical]', 0);

        if ($node) {
            return $node->getAttribute('href');
        }
    }
544861
protected function getPageLocalization()
	{
		// FIXME: using requested locale would make more common sense with global/local switch
		if (isset($this->pageData)) {
			return $this->pageData;
		}

		$this->pageData = $this->getPageLocalizationByRequestKey('page_id');

		if (empty($this->pageData)) {
			$pageId = $this->getRequestParameter('page_id');
			throw new CmsException('sitemap.error.page_not_found', "Page data for page {$pageId} not found");
		}

		/**
		 * Set the system current locale if differs from 'locale' parameter received.
		 * This is done for BACK button to work after navigating to page with different language.
		 * NB! this change won't be saved in the current locale browser cookie storage.
		 */
		$expectedLocaleId = $this->pageData->getLocaleId();

		if ($this->getCurrentLocale()->getId() !== $expectedLocaleId) {
			$this->container->getLocaleManager()
					->setCurrent($expectedLocaleId);
		}
		
		return $this->pageData;
	}
356567
public function getPageTypeMap()
    {
        $pageTypeMap = [];

        $pageTypes = SiteTree::page_type_classes();
        foreach ($pageTypes as $pageType) {
            $pageTypeMap[$pageType] = singleton($pageType)->i18n_singular_name();
        }

        asort($pageTypeMap);

        return $pageTypeMap;
    }
626031
public function getItemLabelAttribute()
    {
        if( $this->type == 'link' ) {
            return $this->link_text;
        }

        if( $this->type == 'page' && ! is_null($this->page) )
            return get_translation_name('title', $this->language_code, $this->page->translations->toArray());

        return '';
    }
496824
public function getPagePath() {
        $core = $this->getLoops()->getService("web_core");
        $page = $core->page;
        $pagepath = $page === $this ? "" : WebCore::getPagePathFromClassname($page, $core->page_parameter);
        return implode("/", $pagepath ? array_merge([$pagepath], $core->parameter) : $core->parameter);
    }
593686
public function baseIncludingLanguage()
    {
        $grav = Grav::instance();

        /** @var Pages $pages */
        $pages = $grav['pages'];

        return $pages->baseUrl(null, false);
    }
997266
public function getTitlePageSuffix()
    {
        if (($activePage = $this->getActPage())) {
            return \OxidEsales\Eshop\Core\Registry::getLang()->translateString('PAGE') . " " . ($activePage + 1);
        }
    }
241025
public function getTranslationsLocale()
    {
        $localeIso = $this->locale->getIso();

        if (isset($this->localeTranslationAssociations[$localeIso])) {
            return Locale::create($this->localeTranslationAssociations[$localeIso]);
        }

        return $this->locale;
    }
307994
public function getLocale(): string
    {
        if (is_null($this->locale)) {
            $this->locale = \Locale::getDefault();
        }

        return $this->locale;
    }
1074458
public function getLocalizedUrlsForPage(BasePageDocument $page)
    {
        $localizedUrls = [];
        $webspaceKey = $this->getWebspace($page);
        $webspace = $this->webspaceManager->findWebspaceByKey($webspaceKey);
        $node = $this->getNode($page);

        $structure = $this->getStructureMetadata($page);
        $resourceLocatorProperty = $structure->getPropertyByTagName('sulu.rlp');

        foreach ($webspace->getAllLocalizations() as $localization) {
            $resolvedLocale = $localization->getLocale();
            $locale = $resolvedLocale;

            $shadowEnabledName = $this->encoder->localizedSystemName(
                ShadowLocaleSubscriber::SHADOW_ENABLED_FIELD,
                $resolvedLocale
            );

            if (true === $node->getPropertyValueWithDefault($shadowEnabledName, false)) {
                $shadowLocaleName = $this->encoder->localizedSystemName(
                    ShadowLocaleSubscriber::SHADOW_LOCALE_FIELD,
                    $resolvedLocale
                );
                $resolvedLocale = $node->getPropertyValue($shadowLocaleName);
            }

            $stageName = $this->encoder->localizedSystemName(
                WorkflowStageSubscriber::WORKFLOW_STAGE_FIELD,
                $resolvedLocale
            );

            if (false === $node->hasProperty($stageName)) {
                continue;
            }

            $stage = $node->getProperty($stageName);

            if (WorkflowStage::PUBLISHED !== $stage->getValue()) {
                continue;
            }

            $url = $node->getPropertyValueWithDefault(
                $this->encoder->localizedContentName($resourceLocatorProperty->getName(), $locale),
                null
            );

            if (null === $url) {
                continue;
            }

            $localizedUrls[$locale] = $url;
        }

        return $localizedUrls;
    }
832415
private function get_opening_links()
    {
        $output = '';

        $previous_link = esc_attr(get_pagenum_link(\intval($this->current_page) - 1));
        $first_page_link = esc_attr(get_pagenum_link(1));

        if ($this->args['show_first_last'] && $first_page_link && $this->current_page > 2) {
            $output .= \sprintf($this->args['first_wrapper'], $first_page_link);
        }

        if ($this->args['show_previous_next'] && $previous_link && $this->current_page !== 1) {
            $output .= \sprintf($this->args['previous_wrapper'], $previous_link);
        }

        return $output;
    }
883280
public function GetNextPageLink()
    {
        $sLink = false;
        if ($this->HasNextPage()) {
            $oGlobal = TGlobal::instance();
            $oExecutingModule = &$oGlobal->GetExecutingModulePointer();
            $aAdditionalParameters = array('module_fnc['.$oExecutingModule->sModuleSpotName.']' => 'ChangePage', TdbShopArticleList::URL_LIST_KEY_NAME => $this->GetListIdentKey(), TdbShopArticleList::URL_LIST_REQUEST => 'NextPage', TdbShopArticleList::URL_LIST_CURRENT_PAGE => $this->GetCurrentPageNumber());
            $sLink = $this->getActivePageService()->getLinkToActivePageRelative($aAdditionalParameters, TdbShopArticleList::GetParametersToIgnoreInPageLinks());
        }

        return $sLink;
    }
902613
public function pages()
    {
        $links[] = [__d('me_cms', 'List pages'), [
            'controller' => 'Pages',
            'action' => 'index',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];

        //Only admins and managers can access these actions
        if ($this->Auth->isGroup(['admin', 'manager'])) {
            $links[] = [__d('me_cms', 'Add page'), [
                'controller' => 'Pages',
                'action' => 'add',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
            $links[] = [__d('me_cms', 'List categories'), [
                'controller' => 'PagesCategories',
                'action' => 'index',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
            $links[] = [__d('me_cms', 'Add category'), [
                'controller' => 'PagesCategories',
                'action' => 'add',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
        }

        $links[] = [__d('me_cms', 'List static pages'), [
            'controller' => 'Pages',
            'action' => 'indexStatics',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];

        return [$links, I18N_PAGES, ['icon' => 'far copy']];
    }
201344
public function getTranslatedLinkTargets()
    {
        $translatedLinkTargets = [];
        foreach ($this->linkTargets as $key => $value) {
            $translatedLinkTargets[$key] = $value;
        }

        return $translatedLinkTargets;
    }
697760
private function get_links()
    {
        list($min, $max) = $this->get_min_max();
        $output = '';

        if (! empty($min) && ! empty($max) && $this->args['range'] >= 0) {
            for ($i = $min; $i <= $max; $i++) {
                if ($this->current_page == $i) {
                    // output active HTML.
                    $output .= \sprintf($this->args['active_link_wrapper'], $i);
                } else {
                    // output link HTML.
                    $output .= \sprintf(
                        $this->args['link_wrapper'],
                        esc_attr(get_pagenum_link($i)),
                        number_format_i18n($i)
                    );
                }
            }
        }

        return $output;
    }