Gets a list of page sizes for use in templates as a dropdown

@return ArrayList
320112
public function getPageSizesAsList()
    {
        $pageSizes = ArrayList::create();
        $perPage = $this->getItemsPerPage();
        foreach ($this->getPageSizes() as $pageSize) {
            $pageSizes->push(array(
                'Size' => $pageSize,
                'Selected' => $pageSize == $perPage
            ));
        }
        return $pageSizes;
    }
908509
protected function getPages()
    {
        $pages = $this->pages;
        ksort($pages);
        $pages = array_values($pages);

        return $pages;
    }
432359
public function getPagesAsOptions()
    {
        $pages = [];
        $publishedPages = $this->repo->all();

        foreach ($publishedPages as $page) {
            $pages[$page->title] = $page->id;
        }

        return $pages;
    }
1082396
public function AvailableSectionTypes()
    {
        $AvailableTypes = ClassInfo::subclassesfor('Section');
        unset($AvailableTypes['Section']);

        # Get section options from each page type.
        $pageTypeOptions = Config::inst()->get($this->owner->ClassName, 'section_options');

        foreach ($AvailableTypes as $key => $value) {
            $Config = Config::inst();
            $selectable_option = true;
            if ($Config->get($value, 'selectable_option') !== null) {
                $selectable_option = $Config->get($value, 'selectable_option');
            }
            $AvailableTypes[$key] = array(
                'classname' => $value,
                'type' => Section::Type($value),
                'presets' => $Config->get($value, 'presets'),
                'selectable_option' => $selectable_option,
                'limit' => $Config->get($value, 'limit'),
            );

            if (isset($pageTypeOptions[$key])) {
                $AvailableTypes[$key] = array_merge($AvailableTypes[$key], $pageTypeOptions[$key]);
            }

            $AvailableTypes[$key]['limit_reached'] = false;
            if(isset($AvailableTypes[$key]['limit'])){
                if ($AvailableTypes[$key]['limit'] == 0) {
                    $AvailableTypes[$key]['limit_reached'] = true;
                }

                $CurrentSectionCount = $this->owner
                    ->Sections()
                    ->filter('ClassName', $AvailableTypes[$key]['type'])
                    ->count();
                if ($CurrentSectionCount >= $AvailableTypes[$key]['limit']) {
                    $AvailableTypes[$key]['limit_reached'] = true;
                }
            }
        }

        return $AvailableTypes;
    }
436107
public function getDimensions(): array
    {
        if ($this->dimensions === null) {
            $attrs = $this->getXmlAttrs();

            $this->dimensions = [
                (float) $attrs->width ?? 0,
                (float) $attrs->height ?? 0,
            ];
        }

        return $this->dimensions;
    }
1021405
protected function getPagesArrayText()
    {
        if (empty($this->pages)) {
            return Builder::getArray(array(0 => ''), true);
        }
        $pages = array();
        foreach ($this->pages as $page) {
            $pages[$page->getPageNumber()] = $page->getControl()
                                                  ->getId();
        }
        return Builder::getArray($pages, true);
    }
998847
private function getThemeImageSizes()
    {
        $dataProvider = new DefaultDataProvider();
        $dataProvider->setBaseConfig(['source' => 'tl_image_size']);

        $config = $dataProvider->getEmptyConfig();
        $config->setFields(['id', 'name', 'width', 'height']);
        $config->setSorting(['pid', 'name']);

        $collection = $dataProvider->fetchAll($config);
        if (!$collection->count()) {
            return [];
        }

        $sizes = [];
        foreach ($collection as $model) {
            $sizes[$model->getProperty('id')] = sprintf(
                '%s (%sx%s)',
                $model->getProperty('name'),
                $model->getProperty('width'),
                $model->getProperty('height')
            );
        }

        return $sizes;
    }
1119815
public function getAvailable()
    {
        return [
            self::TEMAPLATE_PAPER_FORM_A4 => 'A4',
            self::TEMAPLATE_PAPER_FORMAT_A3 => 'A3',
            self::TEMAPLATE_PAPER_FORMAT_A5 => 'A5',
            self::TEMAPLATE_PAPER_FORMAT_A6 => 'A6',
            self::TEMAPLATE_PAPER_FORMAT_LETTER => 'Letter',
            self::TEMAPLATE_PAPER_FORMAT_LEGAL => 'Legal',
        ];
    }
900621
public function simpleRendeArray()
    {
        $array = [];
        $count = $this->paginator->getCount();
        $url = $this->path;
        $current = $this->paginator->getCurrentPage();

        // create appends string
        $appends = $this->createAppendString($this->paginator->getAppends());

        // create fragments string
        $fragments = $this->createFragmentsString($this->paginator->getFragments());


        if ($count < $this->paginator->getPerPage()) {
            $limit = 1;
        } else {
            $limit = ceil($count / $this->paginator->getPerPage());
        }


        if ($this->isAvaibleCurrentPage($current) && $current > 1) {

            $previous = $current - 1;
            $array[] = $this->buildChieldString('Previous', $this->buildFullChieldStrind($url, $appends), $this->pageName, $fragments, $previous);

        }

        if ($this->isAvaibleCurrentPage($current) && $current < $limit) {
            $next = $current + 1;

            $array[] = $this->buildChieldString('Next', $this->buildFullChieldStrind($url, $appends), $this->pageName, $fragments, $next);
        }

        return $array;
    }
957237
protected function getSupportedSizes()
    {
        return [FieldInterface::SIZE_TINY, FieldInterface::SIZE_SMALL, FieldInterface::SIZE_MEDIUM, FieldInterface::SIZE_NORMAL, FieldInterface::SIZE_BIG];
    }
100178
public static function get_image_sizes() {
		// Bailout early if cached image configuration is available.
		if ( self::$sizes ) {
			return self::$sizes;
		}

		/**
		 * Filters image sizes used in Timmy.
		 *
		 * @since 0.13.0
		 *
		 * @param array $sizes Image configuration array. Default array().
		 */
		$sizes = apply_filters( 'timmy/sizes', array() );

		/**
		 * Fallback for get_image_sizes() function
		 *
		 * TODO: deprecate in 1.0.0
		 */
		if ( empty( $sizes ) && function_exists( 'get_image_sizes' ) ) {
			$sizes = get_image_sizes();
		}

		// Cache sizes for next requests.
		self::$sizes = $sizes;

		return $sizes;
	}
286693
public function getPortraitSizes()
    {
        $sizes = $this->getValue('sizes');

        if (empty($sizes)) {
            $sizes = $this->_sizes;
        }

        return $sizes;
    }
746158
public function getAppliedSets()
	{
		$list = ArrayList::create();
		if (!$this->owner->InheritBlockSets) {
			return $list;
		}

		$sets = BlockSet::get()->where("(PageTypesValue IS NULL) OR (PageTypesValue LIKE '%:\"{$this->owner->ClassName}%')");
		$ancestors = $this->owner->getAncestors()->column('ID');

		foreach ($sets as $set) {
			$restrictedToParerentIDs = $set->PageParents()->column('ID');
			if (count($restrictedToParerentIDs)) {
				// check whether the set should include selected parent, in which case check whether
				// it was in the restricted parents list. If it's not, or if include parentpage
				// wasn't selected, we check the ancestors of this page.
				if ($set->IncludePageParent && in_array($this->owner->ID, $restrictedToParerentIDs)) {
					$list->add($set);
				} else {
					if (count($ancestors)) {
						foreach ($ancestors as $ancestor) {
							if (in_array($ancestor, $restrictedToParerentIDs)) {
								$list->add($set);
								continue;
							}
						}
					}
				}
			} else {
				$list->add($set);
			}
		}

		return $list;
	}
542136
public function getList()
    {
        $pageType = $this->params('pageType', PageTypes::NORMAL);
        $pageId = $this->params('pageId', null);

        /** @var \Rcm\Validator\Page $validator */
        $validator = clone($this->getServiceLocator()->get(\Rcm\Validator\Page::class));
        $validator->setPageType($pageType);

        $return = [
            'valid' => true
        ];

        if (!$validator->isValid($pageId)) {
            $return['valid'] = false;
            $return['error'] = $validator->getMessages();

            /** @var \Zend\Http\Response $response */
            $response = $this->response;

            $errorCodes = array_keys($return['error']);

            foreach ($errorCodes as &$errorCode) {
                if ($errorCode == $validator::PAGE_EXISTS) {
                    $response->setStatusCode(409);
                    break;
                } elseif ($errorCode == $validator::PAGE_NAME) {
                    $response->setStatusCode(417);
                }
            }
        }

        return new JsonModel($return);
    }
389779
public function toArray() {
        $data = array_map(function ($value) {
            if ($value instanceof ArrayAble) {
                return $value->toArray();
            }
            return $value;
        }, $this->getPage());
        return [
            'paging' => [
                'limit' => $this->getPageSize(),
                'offset' => $this->getIndex(),
                'total' => $this->getTotal(),
                'more' => $this->hasMore()
            ],
            'data' => $data
        ];
    }
1007113
public function getBannerImageSizes()
    {
        $sizes = array();
        $imageSize = $this->Database
                            ->prepare("SELECT id, name, width, height FROM tl_image_size ORDER BY pid, name")
                            ->execute(\Input::get('id'));
        while ($imageSize->next())
        {
            $sizes[$imageSize->id] = $imageSize->name;
            $sizes[$imageSize->id] .= ' (' . $imageSize->width . 'x' . $imageSize->height . ')';
        }
        return array_merge(array('image_sizes'=>$sizes), $GLOBALS['TL_CROP']);
    }
1135586
public function pagination(): array
	{
		if(empty($this->pagination))
		{
			if(empty($this->request))
			{
				throw new RuntimeException('A [ Request ] instance is required to generate the pagination array.');
			}

			if(empty($this->urlBuilder))
			{
				throw new RuntimeException('A [ URLBuilder ] instance is required to generate the pagination array.');
			}

			$pagination = $this->toArray();

			if($this->options['max_page_links'] !== 0)
			{
				if($this->pages > $this->options['max_page_links'])
				{
					$start = (int) max(($this->currentPage) - ceil($this->options['max_page_links'] / 2), 0);

					$end = $start + $this->options['max_page_links'];

					if($end > $this->pages)
					{
						$end = $this->pages;
					}

					if($start > ($end - $this->options['max_page_links']))
					{
						$start = $end - $this->options['max_page_links'];
					}
				}
				else
				{
					$start = 0;

					$end = $this->pages;
				}

				$pagination['pages'] = [];

				for($i = $start + 1; $i <= $end; $i++)
				{
					$pagination['pages'][] =
					[
						'url'        => $this->buildPageUrl($i),
						'number'     => $i,
						'is_current' => $i === $this->currentPage,
					];
				}
			}

			$this->pagination = $pagination;
		}

		return $this->pagination;
	}