Add a new Page Control

@api
@param Control $pageControl Page Control
@param string  $pageNumber  (optional) Page number
@return static
974720
public function addPageControl(Control $pageControl, $pageNumber = null)
    {
        if ($pageNumber === null) {
            $pageNumber = count($this->pages) + 1;
        }
        $page = new PagingPage($pageControl, $pageNumber);
        return $this->addPage($page);
    }
1228529
public DynaFormControl addControl(final Object data, final int colspan, final int rowspan) {
        return addControl(data, DynaFormControl.DEFAULT_TYPE, colspan, rowspan);
    }
456614
public function getLinkForPage($pageNumber, $label, $htmlOptions = array()) {
        return Html::get()->link($this->getURLForPage($pageNumber), $label, $htmlOptions);
    }
1028369
public function edit(Page $page, PageContent $content)
    {
        return $this->view('titan::pages.components.content')
            ->with('page', $page)
            ->with('item', $content);
    }
702798
private void doGetComponent() throws PageException {
	Struct sct = new StructImpl();
	pageContext.setVariable(getString("admin", action, "returnVariable"), sct);
	// Base Component
	try {
	    PageSource psCFML = config.getBaseComponentPageSource(CFMLEngine.DIALECT_CFML);

	    if (psCFML != null && psCFML.exists()) sct.set("baseComponentTemplateCFML", psCFML.getDisplayPath());
	    else sct.set("baseComponentTemplateCFML", "");
	}
	catch (PageException e) {
	    sct.set("baseComponentTemplateCFML", "");
	}
	try {
	    PageSource psLucee = config.getBaseComponentPageSource(CFMLEngine.DIALECT_LUCEE);

	    if (psLucee != null && psLucee.exists()) sct.set("baseComponentTemplateLucee", psLucee.getDisplayPath());
	    else sct.set("baseComponentTemplateLucee", "");

	}
	catch (PageException e) {
	    sct.set("baseComponentTemplateLucee", "");
	}
	sct.set("strBaseComponentTemplateCFML", config.getBaseComponentTemplate(CFMLEngine.DIALECT_CFML));
	sct.set("strBaseComponentTemplateLucee", config.getBaseComponentTemplate(CFMLEngine.DIALECT_LUCEE));

	// dump template
	try {
	    PageSource ps = ((PageContextImpl) pageContext).getPageSourceExisting(config.getComponentDumpTemplate());
	    if (ps != null) sct.set("componentDumpTemplate", ps.getDisplayPath());
	    else sct.set("componentDumpTemplate", "");
	}
	catch (PageException e) {
	    sct.set("componentDumpTemplate", "");
	}
	sct.set("strComponentDumpTemplate", config.getComponentDumpTemplate());

	sct.set("deepSearch", Caster.toBoolean(config.doComponentDeepSearch()));
	sct.set("componentDataMemberDefaultAccess", ComponentUtil.toStringAccess(config.getComponentDataMemberDefaultAccess()));
	sct.set("triggerDataMember", Caster.toBoolean(config.getTriggerComponentDataMember()));
	sct.set("useShadow", Caster.toBoolean(config.useComponentShadow()));
	sct.set("ComponentDefaultImport", config.getComponentDefaultImport());
	sct.set("componentLocalSearch", config.getComponentLocalSearch());
	sct.set("componentPathCache", config.useComponentPathCache());

    }
833875
public function getPaginationControl(PaginatorInterface $paginator) {
		$currentPage = $paginator->getCurrentPage();
		$pagesNumber = $paginator->getPagesNumber();
		
		if ($currentPage > $pagesNumber) {
			$currentPage = $pagesNumber;
		}
		
		if ($pagesNumber > $this->_rangeSize) {
			$rangeMiddle = (int) ceil($this->_rangeSize / 2);
			
			if ($currentPage - $rangeMiddle > $pagesNumber - $this->_rangeSize) {
				$lower = $pagesNumber - $this->_rangeSize + 1;
				$upper = $pagesNumber;
			} else {
				if ($currentPage - $rangeMiddle < 0) {
					$rangeMiddle = $currentPage;
				}

				$offset = $currentPage - $rangeMiddle;
				$lower  = $offset + 1;
				$upper  = $offset + $this->_rangeSize;
			}
		} else {
			$lower = 1;
			$upper = $pagesNumber;
		}
		
		$range = [];
		
		for ($i = $lower; $i <= $upper; ++ $i) {
			$range[] = $i;
		}
		
		$data = [
			PaginatorInterface::CONTROL_CURRENT => $currentPage,
			PaginatorInterface::CONTROL_RANGE   => $range
		];
		
		if ($currentPage > 2) {
			$data[PaginatorInterface::CONTROL_FIRST] = 1;
		}
		
		if ($pagesNumber > $currentPage + 1) {
			$data[PaginatorInterface::CONTROL_LAST] = $pagesNumber;
		}
		
		if ($currentPage > 1) {
			$data[PaginatorInterface::CONTROL_PREVIOUS] = $currentPage - 1;
		}
		
		if ($currentPage < $pagesNumber) {
			$data[PaginatorInterface::CONTROL_NEXT] = $currentPage + 1;
		}
		
		return $data;
	}
764239
public function addAgendaSetupPage($label, $privilege, $controller, array $other = array())
    {
        $page = $this->addPage($label, $privilege, $controller, 'index', $other);
        $page->addAutofilterAction();
        $page->addCreateAction();
        $page->addExportAction();
        $page->addImportAction();
        $show = $page->addShowAction();
        $show->addEditAction();
        $show->addDeleteAction();

        $show->addAction($this->_('Clean up'), $privilege . '.cleanup', 'cleanup')
                ->setModelParameters(1);

        return $page;
    }
1138459
public static function add( $type, $control_id, $args ) {
		$control = static::_control( $type, $control_id, $args );
		if ( $control ) {
			static::$controls[ $control->get_id() ] = $control;
		}
		return $control;
	}
498879
public function create(
        $width,
        $currentPageNumber,
        $lastPageNumber,
        $actionFirstPage,
        $actionPreviousPage,
        $actionNextPage,
        $actionLastPage,
        $actionGotoPage
    ) {

        $frame = Frame::Create();
        $frame->setSize($width, 16);

        $pagerLine = $this->uiFactory->createLayoutLine(0, -1);
        $buttonSize = 6;

        $empty = Quad::create();
        $empty->setOpacity(0)->setSize($buttonSize, $buttonSize);

        // Show previous buttons
        if ($currentPageNumber > 2) {
            $button = $this->uiFactory->createButton("", Button::TYPE_DECORATED);
            $button
                ->setSize($buttonSize, $buttonSize)
                ->setAction($actionFirstPage);
        } else {
            $button = clone $empty;
        }


        $pagerLine->addChild($button);

        if ($currentPageNumber > 1) {
            $button = $this->uiFactory->createButton("", Button::TYPE_DECORATED);
            $button
                ->setSize($buttonSize, $buttonSize)
                ->setAction($actionPreviousPage);

        } else {
            $button = clone $empty;
        }
        $pagerLine->addChild($button);


        // Show current page.

        $input = $this->uiFactory->createInput('pager_gotopage', $currentPageNumber, 7);
        $input->setAction($actionGotoPage)->setPosition(0, 1)->setHorizontalAlign("center");


        $label = $this->uiFactory->createLabel(" / $lastPageNumber");
        $label->setSize(10, 7)->setHorizontalAlign("left");

        $line = $this->uiFactory->createLayoutLine(0, -2);
        $line->setHorizontalAlign("left");
        $line->addChildren([$input, $label]);

        if ($lastPageNumber > 1) {
            $pagerLine->addChild($line);
        } else {
            $label->setText("1 / 1");
            $pagerLine->addChild($label);
        }

        if ($currentPageNumber < $lastPageNumber) {
            $button = $this->uiFactory->createButton("", Button::TYPE_DECORATED);
            $button
                ->setSize($buttonSize, $buttonSize)
                ->setZ(3)
                ->setAction($actionNextPage);

        } else {
            $button = clone $empty;
        }
        $pagerLine->addChild($button);

        if ($currentPageNumber < $lastPageNumber - 1) {
            $button = $this->uiFactory->createButton("", Button::TYPE_DECORATED);
            $button
                ->setSize($buttonSize, $buttonSize)
                ->setAction($actionLastPage);

        } else {
            $button = clone $empty;
        }
        $pagerLine->addChild($button);

        $pagerLine->setAlign("center", "top");
        $pagerLine->setX(($width - $pagerLine->getWidth()) / 2);


        $borderTop = $this->uiFactory->createLine(0, 0);
        $borderTop->setLength($width)->setColor("fff");

        $frame->addChild($borderTop);
        $frame->addChild($pagerLine);

        return $frame;
    }
17291
public function addMbPageStructure($pageName, MbPageStructure $mbPageStructure)
    {
        $mbPageStructure->setMbPage(MbPage::create($pageName));
        $mbPageStructure->enablePage();
        $mbPageStructure->execute($this->getMbRequest(), $this->getMbResponse(), $this);
    }
974071
public function setCurrentPage( $page_number )
	{
		if ( !is_int( $page_number ) )
		{
			trigger_error( 'Pagination setCurrentPage: Page number must be an integer.' );
			return false;
		}

		if ( $page_number <= 0 )
		{
			trigger_error( 'Pagination setCurrentPage: Page number must be a positive integer.' );
			return false;
		}

		$this->current_page_number = $page_number;
	}
11367
private function makeQuery($pageNumber = 1)
    {
        $params = array(
            'page_size' => $this->pageSize,
            'page' => $pageNumber
        );
        $params = array_merge($params, $this->filter);
        $params = array_merge($params, $this->order);
        $response = $this->api->get($this->typeClass->url(), $params);
        $this->countCached = $response->meta->total_count;

        return $response;
    }
2360
public function setParentControl(Control $parentControl = null)
    {
        $this->parentControl = $parentControl;
        $this->matcher->setParentControl($parentControl);
    }
156649
public function can_add_section_heading($pagenumber) {
        // There is a default section heading on this page,
        // do not show adding new section heading in the Add menu.
        if ($pagenumber == 1) {
            return false;
        }
        // Get an array of firstslots.
        $firstslots = array();
        foreach ($this->sections as $section) {
            $firstslots[] = $section->firstslot;
        }
        foreach ($this->slotsinorder as $slot) {
            if ($slot->page == $pagenumber) {
                if (in_array($slot->slot, $firstslots)) {
                    return false;
                }
            }
        }
        // Do not show the adding section heading on the last add menu.
        if ($pagenumber == 0) {
            return false;
        }
        return true;
    }
393663
public function set(): PageInterface
    {
        $hook = $this->isNetwork() ? 'network_admin_menu' : 'admin_menu';

        // Action for page display.
        $this->action->add($hook, [$this, 'build']);
        // Action for page settings.
        $this->action->add('admin_init', [$this, 'configureSettings']);

        return $this;
    }
997369
public function addItem(Control $item, Control $control, $isStartElement = false)
    {
        $menuElement = new MenuElement($item, $control);
        $this->addElement($menuElement, $isStartElement);
        return $this;
    }
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);
    }