@param PagePartInterface $pagepart

@return string
965802
public function getType(PagePartInterface $pagepart)
    {
        $possiblePagePartTypes = $this->configurator->getPossiblePagePartTypes();
        foreach ($possiblePagePartTypes as &$pageparttype) {
            if ($pageparttype['class'] == ClassLookup::getClass($pagepart)) {
                return $pageparttype['name'];
            }
        }

        return 'no name';
    }
682003
protected function formatMessagePart($messagePart)
    {
        $reference = $messagePart['reference'];

        if (!$reference) {
            return $this->autoLink($messagePart['text']);
        }

        $data = $reference->getData();

        switch ($reference->getType()) {
        case ReferenceType::PAGE:
        case ReferenceType::GROUP:
        case ReferenceType::USER:
            return $this->createLinkString('https://www.facebook.com/'.$data['id'], $messagePart['text']);
            break;
        default:
            return;
            break;
        }
    }
359438
protected function _getPart($part)
    {
        if (property_exists($this, $part)) {
            return $this->{$part};
        } elseif (!in_array($part, self::$_table_parts)) {
            throw new InvalidArgumentException(
                sprintf('Unknown table part "%s"!', $part)
            );
        }
    }
188064
public function pagerPageRange(PagerViewInterface $pager, $pageRange = null)
    {
        if (null === $pageRange) {
            $pageRange = $this->config->getPageRange();
        }

        $pageNumber = $pager->getCurrentPageNumber();
        $pageCount = $pager->getPageCount();

        if ($pageRange > $pageCount) {
            $pageRange = $pageCount;
        }

        $delta = ceil($pageRange / 2);

        if ($pageNumber - $delta > $pageCount - $pageRange) {
            $lowerBound = $pageCount - $pageRange + 1;
            $upperBound = $pageCount;
        } else {
            if ($pageNumber - $delta < 0) {
                $delta = $pageNumber;
            }

            $offset = $pageNumber - $delta;
            $lowerBound = $offset + 1;
            $upperBound = $offset + $pageRange;
        }

        $pages = array();
        for ($pageNumber = $lowerBound; $pageNumber <= $upperBound; ++$pageNumber) {
            $pages[$pageNumber] = $pageNumber;
        }

        return $pages;
    }
573817
private function getDecimalPart($decimalPart)
    {
        $result = '';
        if ($decimalPart > 0) {
            $unit = strlen($decimalPart) - 1;
            for ($i = 0; $i < strlen($decimalPart); ++$i) {
                $num = $decimalPart[$i];
                $result .= $this->uppers[$num].$this->units[$unit--];
            }
        }
        $result = str_replace('零分', '', $result);
        if ($this->thanOne) {
            $result = str_replace('零角', '零', $result);
        } else {
            $result = str_replace('零角', '', $result);
        }

        return $result;
    }
745515
protected function resolvePerPage($paginate)
    {
        if ($perPage = request($this->perPageName)) {
            if (is_array($paginate)) {
                $paginate['arguments'][0] = (int) $perPage;

                return $paginate['arguments'];
            }

            $this->perPage = (int) $perPage;
        }

        if (isset($paginate['arguments'][0])) {
            return $paginate['arguments'];
        }

        if ($name = $this->grid->getName()) {
            return [$this->perPage, ['*'], "{$name}_page"];
        }

        return [$this->perPage];
    }
1133632
public static function pagination( $pagination ) {
		$pagination = str_replace(
			"'",
			'"',
			$pagination
		);
		$pagination = preg_replace(
			'|<span ([^>]*?)class="page-numbers|',
			'<span $1 class="c-pagination__item',
			$pagination
		);
		$pagination = str_replace(
			'<a class="page-numbers',
			'<a class="c-pagination__item-link',
			$pagination
		);
		$pagination = str_replace(
			'c-pagination__item dots"',
			'c-pagination__item-ellipsis" aria-hidden="true"',
			$pagination
		);
		$pagination = str_replace(
			[ 'next page-numbers', 'prev page-numbers' ],
			'c-pagination__item-link',
			$pagination
		);

		return $pagination;
	}
1208645
public function getPage($pageNumber)
    {
        if (!\is_numeric($pageNumber)) {
            throw new \InvalidArgumentException(
                'Page number needs to be a number.'
            );
        }

        if ($pageNumber < 1 || $pageNumber > $this->getPageCount()) {
            throw new \InvalidArgumentException(
                \sprintf(
                    'Page number "%s" out of available page range (1 - %s)',
                    $pageNumber,
                    $this->getPageCount()
                )
            );
        }

        $this->readPages();

        $page = $this->pages[$pageNumber - 1];

        if ($page instanceof PdfIndirectObjectReference) {
            $readPages = function ($kids) use (&$readPages) {
                $kids = PdfArray::ensure($kids);

                /** @noinspection LoopWhichDoesNotLoopInspection */
                foreach ($kids->value as $reference) {
                    $reference = PdfIndirectObjectReference::ensure($reference);
                    $object = $this->parser->getIndirectObject($reference->value);
                    $type = PdfDictionary::get($object->value, 'Type');

                    if ($type->value === 'Pages') {
                        return $readPages(PdfDictionary::get($object->value, 'Kids'));
                    }

                    return $object;
                }

                throw new PdfReaderException(
                    'Kids array cannot be empty.',
                    PdfReaderException::KIDS_EMPTY
                );
            };

            $page = $this->parser->getIndirectObject($page->value);
            $dict = PdfType::resolve($page, $this->parser);
            $type = PdfDictionary::get($dict, 'Type');
            if ($type->value === 'Pages') {
                $kids = PdfType::resolve(PdfDictionary::get($dict, 'Kids'), $this->parser);
                $page = $this->pages[$pageNumber - 1] = $readPages($kids);
            } else {
                $this->pages[$pageNumber - 1] = $page;
            }
        }

        return new Page($page, $this->parser);
    }
142591
public function getFullRoute($routePart = '')
    {
        if ($routePart == '') {
            $routePart = $this->route;
        }
        
        $delimiter = $this->getRouteDelimiter();
        if (substr($routePart, 0, strlen($delimiter)) !== $delimiter) {
            $routePart = $delimiter . $routePart;
        }
        
        $posPoint = strrpos($routePart, '.');
        if (substr($routePart, -1) !== $delimiter && ($posPoint === false || $posPoint < strrpos($routePart, $delimiter))) {
            $routePart .= $delimiter;
        }
        
        return $this->base . $routePart;
    }
1245554
public function getWriterPart($pPartName = '') {
		if ($pPartName != '' && isset($this->_writerParts[strtolower($pPartName)])) {
			return $this->_writerParts[strtolower($pPartName)];
		} else {
			return null;
		}
	}
416257
protected function resolvePerPage($paginate)
    {
        if ($perPage = app('request')->input($this->perPageName)) {
            if (is_array($paginate)) {
                $paginate['arguments'][0] = (int) $perPage;

                return $paginate['arguments'];
            }

            $this->perPage = (int) $perPage;
        }

        if (isset($paginate['arguments'][0])) {
            return $paginate['arguments'];
        }

        return [$this->perPage];
    }
586492
private function getPageTypeLabel($pageTypeIdentifier)
    {
        $label             = '';
        $labelByIdentifier = $this->getPageTypeLabelMap();

        if (isset($labelByIdentifier[$pageTypeIdentifier])) {
            $label = $labelByIdentifier[$pageTypeIdentifier];
        }

        return $label;
    }
1235290
final public function perPage(RequestInterface $request, string $action = null): string
    {
        $html = '';

        if ($this->pagination->getCount() > 5 && $this->pagination->getCount() > $this->pagination->getDefaultPerPage()) {
            $actionPerPage = ($action != null) ? $action : Server::getRequestUri();

            $onChange = (!$request->isAjax()) ? $this->perPageOnchange() : '';

            $html .= $this->perPageOpenForm($actionPerPage);
            $html .= $this->perPageLabel();
            $html .= $this->perPageInputHidden();
            $html .= $this->perPageOpenSelect($onChange);    

            foreach ($this->pagination->getArrayOptionsSelect() as $valuePP) {
                $html .= $this->generateOption($valuePP);
            }

            $html .= $this->perPageCloseSelect();

            if ($this->accumulateIfHasQueryParams != null) {
                $html .= Str::inputHiddenIfHasQueryParams($this->accumulateIfHasQueryParams);
            }

            $html .= $this->perPageCloseForm();
        }

        return $html;
    }
918964
public function findComponentByPartial($partial)
    {
        foreach ($this->page->components as $component) {
            if (ComponentPartial::check($component, $partial)) {
                return $component;
            }
        }

        foreach ($this->layout->components as $component) {
            if (ComponentPartial::check($component, $partial)) {
                return $component;
            }
        }

        return null;
    }
860059
public function getPagePartRefs(HasPagePartsInterface $page, $context = 'main')
    {
        return $this->findBy(array(
            'pageId' => $page->getId(),
            'pageEntityname' => ClassLookup::getClass($page),
            'context' => $context,
        ), array('sequencenumber' => 'ASC'));
    }
1198707
protected function getPartHeaderFromFile(&$part)
    {
        $start = $part['starting-pos'];
        $end = $part['starting-pos-body'];
        fseek($this->stream, $start, SEEK_SET);
        $header = fread($this->stream, $end - $start);
        return $header;
    }
1320962
public function findTranslationOverlaysByPageId(int $pageId) : array
    {
        $queryBuilder = $this->getQueryBuilder();
        $queryBuilder->getRestrictions()->removeAll();
        $queryBuilder->getRestrictions()->add(GeneralUtility::makeInstance(DeletedRestriction::class));

        return $queryBuilder
            ->select('pid', 'l10n_parent', 'sys_language_uid')
            ->from('pages')
            ->add('where',
                $queryBuilder->expr()->eq('l10n_parent', $queryBuilder->createNamedParameter($pageId, \PDO::PARAM_INT))
                . BackendUtility::BEenableFields('pages')
            )->execute()->fetchAll();

    }