Creates a page browser for tables with many records

@param string $renderPart Distinguish between 'top' and 'bottom' part of the navigation (above or below the records)
@return string Navigation HTML
764652
protected function renderListNavigation($renderPart = 'top')
    {
        $totalPages = ceil($this->totalItems / $this->iLimit);
        // Show page selector if not all records fit into one page
        if ($totalPages <= 1) {
            return '';
        }
        $content = '';
        $listURL = $this->listURL('', $this->table);
        // 1 = first page
        // 0 = first element
        $currentPage = floor($this->firstElementNumber / $this->iLimit) + 1;
        // Compile first, previous, next, last and refresh buttons
        if ($currentPage > 1) {
            $labelFirst = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:first'));
            $labelPrevious = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:previous'));
            $first = '<li><a href="' . $listURL . '&pointer=' . $this->getPointerForPage(1) . '" title="' . $labelFirst . '">'
                . $this->iconFactory->getIcon('actions-view-paging-first', Icon::SIZE_SMALL)->render() . '</a></li>';
            $previous = '<li><a href="' . $listURL . '&pointer=' . $this->getPointerForPage($currentPage - 1) . '" title="' . $labelPrevious . '">'
                . $this->iconFactory->getIcon('actions-view-paging-previous', Icon::SIZE_SMALL)->render() . '</a></li>';
        } else {
            $first = '<li class="disabled"><span>' . $this->iconFactory->getIcon('actions-view-paging-first', Icon::SIZE_SMALL)->render() . '</span></li>';
            $previous = '<li class="disabled"><span>' . $this->iconFactory->getIcon('actions-view-paging-previous', Icon::SIZE_SMALL)->render() . '</span></li>';
        }
        if ($currentPage < $totalPages) {
            $labelNext = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:next'));
            $labelLast = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:last'));
            $next = '<li><a href="' . $listURL . '&pointer=' . $this->getPointerForPage($currentPage + 1) . '" title="' . $labelNext . '">'
                . $this->iconFactory->getIcon('actions-view-paging-next', Icon::SIZE_SMALL)->render() . '</a></li>';
            $last = '<li><a href="' . $listURL . '&pointer=' . $this->getPointerForPage($totalPages) . '" title="' . $labelLast . '">'
                . $this->iconFactory->getIcon('actions-view-paging-last', Icon::SIZE_SMALL)->render() . '</a></li>';
        } else {
            $next = '<li class="disabled"><span>' . $this->iconFactory->getIcon('actions-view-paging-next', Icon::SIZE_SMALL)->render() . '</span></li>';
            $last = '<li class="disabled"><span>' . $this->iconFactory->getIcon('actions-view-paging-last', Icon::SIZE_SMALL)->render() . '</span></li>';
        }
        $reload = '<li><a href="#" onclick="document.dblistForm.action=' . GeneralUtility::quoteJSvalue($listURL
                . '&pointer=') . '+calculatePointer(document.getElementById(' . GeneralUtility::quoteJSvalue('jumpPage-' . $renderPart)
            . ').value); document.dblistForm.submit(); return true;" title="'
            . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:reload')) . '">'
            . $this->iconFactory->getIcon('actions-refresh', Icon::SIZE_SMALL)->render() . '</a></li>';
        if ($renderPart === 'top') {
            // Add js to traverse a page select input to a pointer value
            $content = '
<script type="text/javascript">
/*<![CDATA[*/
	function calculatePointer(page) {
		if (page > ' . $totalPages . ') {
			page = ' . $totalPages . ';
		}
		if (page < 1) {
			page = 1;
		}
		return (page - 1) * ' . $this->iLimit . ';
	}
/*]]>*/
</script>
';
        }
        $pageNumberInput = '
			<input type="number" min="1" max="' . $totalPages . '" value="' . $currentPage . '" size="3" class="form-control input-sm paginator-input" id="jumpPage-' . $renderPart . '" name="jumpPage-'
            . $renderPart . '" onkeyup="if (event.keyCode == 13) { document.dblistForm.action=' . htmlspecialchars(GeneralUtility::quoteJSvalue($listURL . '&pointer='))
            . '+calculatePointer(this.value); document.dblistForm.submit(); } return true;" />
			';
        $pageIndicatorText = sprintf(
            $this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:pageIndicator'),
            $pageNumberInput,
            $totalPages
        );
        $pageIndicator = '<li><span>' . $pageIndicatorText . '</span></li>';
        if ($this->totalItems > $this->firstElementNumber + $this->iLimit) {
            $lastElementNumber = $this->firstElementNumber + $this->iLimit;
        } else {
            $lastElementNumber = $this->totalItems;
        }
        $rangeIndicator = '<li><span>' . sprintf(
                $this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:rangeIndicator'),
                $this->firstElementNumber + 1,
                $lastElementNumber
            ) . '</span></li>';

        $titleColumn = $this->fieldArray[0];
        $data = [
            $titleColumn => $content . '
				<nav class="pagination-wrap">
					<ul class="pagination pagination-block">
						' . $first . '
						' . $previous . '
						' . $rangeIndicator . '
						' . $pageIndicator . '
						' . $next . '
						' . $last . '
						' . $reload . '
					</ul>
				</nav>
			'
        ];
        return $this->addElement(1, '', $data, '', '', '', 'pagination');
    }
836809
public function renderNav($numberOfPages, $currentPage = 1, $queryParameters = array(), $maxPagesDisplayedAroundCurrent = 2)
    {
        $navigation = array();

        $firstPageDisplayed = 1;
        $lastPageDisplayed = (int)$numberOfPages;

        $leftPartUrl = $this->prepareQueryString($queryParameters);

        if ($currentPage > $maxPagesDisplayedAroundCurrent) {
            $firstPageDisplayed = $currentPage - $maxPagesDisplayedAroundCurrent;
            $navigation[] = '<a href="' . $leftPartUrl . '1" class="navigatorShortcut1">'
                . $this->translator->trans('open_orchestra_display.twig.navigator.first')
                . '</a>';
        }

        if ($currentPage > 1) {
            $navigation[] = '<a href="' . $leftPartUrl . ($currentPage - 1) . ' "class="navigatorShortcut2">'
                . $this->translator->trans('open_orchestra_display.twig.navigator.previous')
                . '</a>';
        }

        if ($firstPageDisplayed > 1) {
            $navigation[] = '...';
        }

        if ($currentPage < $numberOfPages - $maxPagesDisplayedAroundCurrent) {
            $lastPageDisplayed = $currentPage + $maxPagesDisplayedAroundCurrent;
        }

        for ($i = $firstPageDisplayed; $i <= $lastPageDisplayed; $i++) {
            if ($i == $currentPage) {
                $navigation[] = '<span class="navigatorCurrent">' . $i . '</span>';
            } else {
                $navigation[] = ' <a href="' . $leftPartUrl . $i . '" class="navigatorPage">' . $i . '</a>';
            }
        }

        if ($lastPageDisplayed < $numberOfPages) {
            $navigation[] = '...';
        }

        if ($currentPage < $numberOfPages) {
            $navigation[]= '<a href="' . $leftPartUrl . ($currentPage + 1) . '" class="navigatorShortcut2">'
                . $this->translator->trans('open_orchestra_display.twig.navigator.next')
                . '</a>';
        }

        if ($currentPage < $numberOfPages - $maxPagesDisplayedAroundCurrent) {
            $navigation[]= '<a href="' . $leftPartUrl . $numberOfPages . '" class="navigatorShortcut1">'
                . $this->translator->trans('open_orchestra_display.twig.navigator.last')
                . '</a>';
        }

        return implode(' ', $navigation);
    }
1236150
public function render()
    {
        if (!$this->hasPages())
            return '';

        return sprintf(
            '<div><ul class="pagination">%s %s %s</ul></div>',
            $this->getPreviousButton(),
            $this->getLinks(),
            $this->getNextButton()
        );
    }
521453
function renderFullNav() {
        //echo $this->renderFirst() . " " . $this->renderPrev();
         
        return $this->renderFirst() . '&nbsp;' . $this->renderPrev() . '&nbsp;' . $this->renderNav() . '&nbsp;' . $this->renderNext() . '&nbsp;' . $this->renderLast();
    }
907014
public function render($renderer, $sub = false)
    {
        if (!empty($this->attrs['style'])) {
            $renderer->setCurrentStyle($this->attrs['style']);
        }
        if (!empty($this->attrs['width'])) {
            $this->attrs['width'] *= 3.9;
        }

        $this->text = $this->getStart() . $this->text;
        foreach ($this->elements as $element) {
            if ($element === 'footnotetexts') {
                $renderer->Footnotes();
            } elseif ($element === 'addpage') {
                $renderer->newPage();
            } elseif ($element instanceof ReportBaseHtml) {
                $element->render($renderer, true);
            } else {
                $element->render($renderer);
            }
        }
        $this->text .= $this->getEnd();
        if ($sub) {
            return $this->text;
        }
        $renderer->writeHTML($this->text); //prints 2 empty cells in the Expanded Relatives report
    }
624734
public function render() {
		$tabsList = new ListUnordered();
		$tabsList->setSeparator('');
		$tabsList->addClass('debug-bar');
		$tabsList->id = 'debug-elements';
		
		$panels = '';
		
		foreach ($this->info as $info) {
			$tabElement = $this->createTab($info);
			
			if (! $info->isEmpty()) {
				$id = 'debug-panel-' . substr(md5(rand(0, 1000) . $info->getName()), 24);
			
				$tabElement->addClass('withpanel clickable');
				$tabElement->setAttr('data-panel-id', $id);
				
				$panelTag = $this->createPanel($info);
				$panelTag->id = $id;
				
				$panels .= $panelTag->render();
			}
			
			$tabsList->addElement($tabElement);
		}
		
		$styleTag  = new Tag('style', $this->getAsset('bar.css'));
		$scriptTag = new Script($this->getAsset('bar.js'));
		
		$wrapperTag = new Tag('div', $tabsList->render(), 'debug-bar-wrapper');
		$debugTag   = new Tag('div', $panels . $wrapperTag->render(), 'debug-main');
		
		return $styleTag->render() . $scriptTag->render() . $debugTag->render();
	}
1092016
function render($mode=null)
	{
        $pager_html = "<div class='pager'>";
        if ($mode === null)
        {
            if (in_array('first', $this->span_open))
            {
                $pager_html .= $this->first_page();
            }
            if (in_array('previous', $this->span_open))
            {
                $pager_html .= $this->pre_page();
            }
            $pager_html .= $this->nowbar();
            if (in_array('next', $this->span_open))
            {
                $pager_html .= $this->next_page();
            }
            if (in_array('last', $this->span_open))
            {
				$pager_html.=$this->last_page();
			}
            if (in_array('pagesize', $this->span_open))
            {
                $pager_html .= $this->set_pagesize();
            }
            $pager_html .= '</div>';
            return $pager_html;
        }
        $pager_html .= '</div>';
        return $pager_html;
	}
430000
public function render($renderer)
    {
        $newelements      = [];
        $lastelement      = '';
        $footnote_element = [];
        // Element counter
        $cE = count($this->elements);
        //-- collapse duplicate elements
        for ($i = 0; $i < $cE; $i++) {
            $element = $this->elements[$i];
            if ($element instanceof ReportBaseElement) {
                if ($element instanceof ReportBaseText) {
                    if (!empty($footnote_element)) {
                        ksort($footnote_element);
                        foreach ($footnote_element as $links) {
                            $newelements[] = $links;
                        }
                        $footnote_element = [];
                    }
                    if (empty($lastelement)) {
                        $lastelement = $element;
                    } else {
                        // Checking if the Text has the same style
                        if ($element->getStyleName() == $lastelement->getStyleName()) {
                            $lastelement->addText(str_replace("\n", '<br>', $element->getValue()));
                        } elseif (!empty($lastelement)) {
                            $newelements[] = $lastelement;
                            $lastelement   = $element;
                        }
                    }
                } elseif ($element instanceof ReportPdfFootnote) {
                    // Check if the Footnote has been set with it’s link number
                    $renderer->checkFootnote($element);
                    // Save first the last element if any
                    if (!empty($lastelement)) {
                        $newelements[] = $lastelement;
                        $lastelement   = [];
                    }
                    // Save the Footnote with it’s link number as key for sorting later
                    $footnote_element[$element->num] = $element;
                } elseif (!($element instanceof ReportPdfFootnote) || trim($element->getValue()) != '') {
                    // Do not keep empty footnotes
                    if (!empty($footnote_element)) {
                        ksort($footnote_element);
                        foreach ($footnote_element as $links) {
                            $newelements[] = $links;
                        }
                        $footnote_element = [];
                    }
                    if (!empty($lastelement)) {
                        $newelements[] = $lastelement;
                        $lastelement   = [];
                    }
                    $newelements[] = $element;
                }
            } else {
                if (!empty($lastelement)) {
                    $newelements[] = $lastelement;
                    $lastelement   = [];
                }
                if (!empty($footnote_element)) {
                    ksort($footnote_element);
                    foreach ($footnote_element as $links) {
                        $newelements[] = $links;
                    }
                    $footnote_element = [];
                }
                $newelements[] = $element;
            }
        }
        if (!empty($lastelement)) {
            $newelements[] = $lastelement;
        }
        if (!empty($footnote_element)) {
            ksort($footnote_element);
            foreach ($footnote_element as $links) {
                $newelements[] = $links;
            }
        }
        $this->elements = $newelements;
        unset($footnote_element, $lastelement, $links, $newelements);

        // Used with line breaks and cell height calculation within this box
        $renderer->largestFontHeight = 0;

        // If current position (left)
        if ($this->left === ReportBaseElement::CURRENT_POSITION) {
            $cX = $renderer->GetX();
        } else {
            // For static position add margin (returns and updates X)
            $cX = $renderer->addMarginX($this->left);
        }

        // If current position (top)
        if ($this->top === ReportBaseElement::CURRENT_POSITION) {
            $cY = $renderer->GetY();
        } else {
            $cY = $this->top;
            $renderer->SetY($cY);
        }

        // Check the width if set to page wide OR set by xml to larger then page width (margin)
        if ($this->width == 0 || $this->width > $renderer->getRemainingWidthPDF()) {
            $cW = $renderer->getRemainingWidthPDF();
        } else {
            $cW = $this->width;
        }

        // Save the original margins
        $cM = $renderer->getMargins();
        // Use cell padding to wrap the width
        // Temp Width with cell padding
        if (is_array($cM['cell'])) {
            $cWT = $cW - ($cM['padding_left'] + $cM['padding_right']);
        } else {
            $cWT = $cW - ($cM['cell'] * 2);
        }
        // Element height (exept text)
        $eH = 0;
        $w  = 0;
        // Temp Height
        $cHT = 0;
        //-- $lw is an array
        // 0 => last line width
        // 1 => 1 if text was wrapped, 0 if text did not wrap
        // 2 => number of LF
        $lw = [];
        // Element counter
        $cE = count($this->elements);
        //-- calculate the text box height + width
        for ($i = 0; $i < $cE; $i++) {
            if (is_object($this->elements[$i])) {
                $ew = $this->elements[$i]->setWrapWidth($cWT - $w, $cWT);
                if ($ew == $cWT) {
                    $w = 0;
                }
                $lw = $this->elements[$i]->getWidth($renderer);
                // Text is already gets the # LF
                $cHT += $lw[2];
                if ($lw[1] == 1) {
                    $w = $lw[0];
                } elseif ($lw[1] == 2) {
                    $w = 0;
                } else {
                    $w += $lw[0];
                }
                if ($w > $cWT) {
                    $w = $lw[0];
                }
                // Footnote is at the bottom of the page. No need to calculate it’s height or wrap the text!
                // We are changing the margins anyway!
                // For anything else but text (images), get the height
                $eH += $this->elements[$i]->getHeight($renderer);
            }
        }

        // Add up what’s the final height
        $cH = $this->height;
        // If any element exist
        if ($cE > 0) {
            // Check if this is text or some other element, like images
            if ($eH == 0) {
                // This is text elements. Number of LF but at least one line
                $cHT = ($cHT + 1) * $renderer->getCellHeightRatio();
                // Calculate the cell hight with the largest font size used within this Box
                $cHT *= $renderer->largestFontHeight;
                // Add cell padding
                if ($this->padding) {
                    if (is_array($cM['cell'])) {
                        $cHT += ($cM['padding_bottom'] + $cM['padding_top']);
                    } else {
                        $cHT += ($cM['cell'] * 2);
                    }
                }
                if ($cH < $cHT) {
                    $cH = $cHT;
                }
            } elseif ($cH < $eH) {
                // This is any other element
                $cH = $eH;
            }
        }
        // Finaly, check the last cells height
        if ($cH < $renderer->lastCellHeight) {
            $cH = $renderer->lastCellHeight;
        }
        // Add a new page if needed
        if ($this->pagecheck) {
            // Reset last cell height or Header/Footer will inherit it, in case of pagebreak
            $renderer->lastCellHeight = 0;
            if ($renderer->checkPageBreakPDF($cH)) {
                $cY = $renderer->GetY();
            }
        }

        // Setup the border and background color
        $cS = ''; // Class Style
        if ($this->border) {
            $cS = 'D';
        } // D or empty string: Draw (default)
        $match = [];
        // Fill the background
        if ($this->fill) {
            if (!empty($this->bgcolor)) {
                if (preg_match('/#?(..)(..)(..)/', $this->bgcolor, $match)) {
                    $cS .= 'F'; // F: Fill the background
                    $r  = hexdec($match[1]);
                    $g  = hexdec($match[2]);
                    $b  = hexdec($match[3]);
                    $renderer->SetFillColor($r, $g, $b);
                }
            }
        }
        // Clean up a bit
        unset($lw, $w, $match, $cE, $eH);
        // Draw the border
        if (!empty($cS)) {
            if (!$renderer->getRTL()) {
                $cXM = $cX;
            } else {
                $cXM = $renderer->getPageWidth() - $cX - $cW;
            }
            $renderer->Rect($cXM, $cY, $cW, $cH, $cS);
        }
        // Add cell padding if set and if any text (element) exist
        if ($this->padding) {
            if ($cHT > 0) {
                if (is_array($cM['cell'])) {
                    $renderer->SetY($cY + $cM['padding_top']);
                } else {
                    $renderer->SetY($cY + $cM['cell']);
                }
            }
        }
        // Change the margins X, Width
        if (!$renderer->getRTL()) {
            if ($this->padding) {
                if (is_array($cM['cell'])) {
                    $renderer->SetLeftMargin($cX + $cM['padding_left']);
                } else {
                    $renderer->SetLeftMargin($cX + $cM['cell']);
                }
                $renderer->SetRightMargin($renderer->getRemainingWidthPDF() - $cW + $cM['right']);
            } else {
                $renderer->SetLeftMargin($cX);
                $renderer->SetRightMargin($renderer->getRemainingWidthPDF() - $cW + $cM['right']);
            }
        } else {
            if ($this->padding) {
                if (is_array($cM['cell'])) {
                    $renderer->SetRightMargin($cX + $cM['padding_right']);
                } else {
                    $renderer->SetRightMargin($cX + $cM['cell']);
                }
                $renderer->SetLeftMargin($renderer->getRemainingWidthPDF() - $cW + $cM['left']);
            } else {
                $renderer->SetRightMargin($cX);
                $renderer->SetLeftMargin($renderer->getRemainingWidthPDF() - $cW + $cM['left']);
            }
        }
        // Save the current page number
        $cPN = $renderer->getPage();

        // Render the elements (write text, print picture...)
        foreach ($this->elements as $element) {
            if ($element instanceof ReportBaseElement) {
                $element->render($renderer);
            } elseif ($element === 'footnotetexts') {
                $renderer->footnotes();
            } elseif ($element === 'addpage') {
                $renderer->newPage();
            }
        }
        // Restore the margins
        $renderer->SetLeftMargin($cM['left']);
        $renderer->SetRightMargin($cM['right']);

        // This will be mostly used to trick the multiple images last height
        if ($this->reseth) {
            $cH = 0;
            // This can only happen with multiple images and with pagebreak
            if ($cPN != $renderer->getPage()) {
                $renderer->setPage($cPN);
            }
        }
        // New line and some clean up
        if (!$this->newline) {
            $renderer->SetXY($cX + $cW, $cY);
            $renderer->lastCellHeight = $cH;
        } else {
            // addMarginX() also updates X
            $renderer->addMarginX(0);
            $renderer->SetY($cY + $cH);
            $renderer->lastCellHeight = 0;
        }
    }
291887
function renderPageTree(root, renderOpts) {

    renderOpts = u.assign({ openClass:'open' }, renderOpts);

    if (renderOpts.groupBy) {
      var folderPages =
        u.map(u.groupBy(root._children, renderOpts.groupBy), function(children, name) {
          if (name === 'undefined') { name = renderOpts.defaultGroup || ''; }
          return { folderPage: true,
                   _href:      name ? '/' + u.slugify(name) + '/' : '',
                   _children:  children,
                   name:       name };
        });
      return recurse(folderPages);
    }
    else return recurse(root._children);

    function recurse(children, pid) {
      pid = pid || renderOpts.pageTreeID || 'page-tree';
      var out = '\n<ul>';

      u.each(children, function(page) {
        var ppid = (pid + '-' + page._href).replace(/\W+/g, '-').replace(/^-|-$/g,'');
        out += '\n<li' + (page._children ? ' id="' + ppid + '" class="folder"' : '') + '>'
            + (page.folderPage ?
              ((page.name || page._href) ? '<span class="folderPage">' + (page.name || u.unslugify(page._href)) + '</span>' : '') :
              renderLink(u.assign({}, renderOpts, { href:page._href, title:(page.title || page.name) })))
            + (page._children ? recurse(page._children, ppid) : '')
            + '</li>';
      });
      return out + '\n</ul>';
    }
  }
1371125
public function render()
    {
        if (!$this->grid->showPagination()) {
            return '';
        }

        return $this->paginationRanger().
            $this->paginationLinks().
            $this->perPageSelector();
    }
899366
public function paginate($pageLimit = 25)
    {
        $page = Paginator::resolveCurrentPage() ?: 1;
       
        return new Paginator($this->items, $this->hits, $this->totalHits(), $pageLimit, $page, ['path' => Paginator::resolveCurrentPath()]);
    }
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)
            );
        }
    }
203823
public function render_positions(){
		$debug_pages_cache=defined('DEBUG_PAGES_CACHE')?DEBUG_PAGES_CACHE:1;
		$bCache = BFactory::getCache();
		if(($bCache)&&($debug_pages_cache)){
			//Accumulating keys...
			$keys=array();
			$suffix=BBrowserUseragent::getDeviceSuffix();
			foreach($this->rules as &$c){
				$c->key=$this->getUrlCahceKey($c->com,$this->langcode,$suffix,$c->segments);
				$keys[]=$c->key;
				}
			//Multi-get from cache
			$list=$bCache->mget($keys);
			foreach($this->rules as &$c){
				if(($list[$c->key]!==false)&&($list[$c->key]!==NULL)){
					$c->status=$list[$c->key]->status;//200 | 403 | 404
					$c->output=$list[$c->key]->output;
					$c->title=$list[$c->key]->title;
					$c->meta=$list[$c->key]->meta;
					$c->link=$list[$c->key]->link;
					$c->js=$list[$c->key]->js;
					$c->style=$list[$c->key]->style;
					$c->frameworks=$list[$c->key]->frameworks;
					$c->breadcrumbs=$list[$c->key]->breadcrumbs;
					$c->modified=new DateTime($list[$c->key]->modified);
					$c->cachecontrol=$list[$c->key]->cachecontrol;
					$c->cachetime=$list[$c->key]->cachetime;
					$c->locationurl=$list[$c->key]->locationurl;
					$c->locationtime=$list[$c->key]->locationtime;
					$c->rendered=true;
					}
				}
			}
		//Rendering components, not loaded from cache...
		$tocache=array();
		foreach($this->rules as &$c){
			if(!$c->rendered){
				if(ROUTER_DEBUG){
					$view=isset($c->segments['view'])?$c->segments['view']:'';
					BLog::addToLog('[Router]: Rendering component ('.$c->com.(empty($view)?'':'.'.$view).')...');
					}
				$controller=$this->component_load($c->com);
				if(empty($controller)){
					continue;
					}
				$controller->templatename=$this->templatename;
				//Running component...
				$c->output=$controller->run($c->segments);
				$c->status=$controller->status;
				$c->title=$controller->title;
				$c->meta=$controller->meta;
				$c->link=$controller->link;
				$c->js=$controller->js;
				$c->style=$controller->style;
				$c->frameworks=$controller->frameworks;
				$c->breadcrumbs=$controller->breadcrumbs;
				$c->modified=empty($controller->modified)?NULL:$controller->modified->format('Y-m-d H:i:s');
				$c->cachecontrol=$controller->cachecontrol;
				$c->cachetime=$controller->cachetime;
				$c->locationurl=$controller->locationurl;
				$c->locationtime=$controller->locationtime;
				$c->rendered=true;
				//Caching the result, if necessary.
				if(($bCache)&&($debug_pages_cache)&&($c->cachecontrol)){
					$bCache->set($c->key,$c,$c->cachetime);
					}
				//Convert to object.
				$c->modified=$controller->modified;
				}
			}
		}
360262
function renderPages($itemsCount, $itemsPerPage, $pageCount, $Descending = false, $sub_prefix='')
    {
        $prefix = empty($sub_prefix)?str_repeat('sub_', $this->sub):$sub_prefix;
        if ($itemsCount > $itemsPerPage)
        {
            $result = '<div class="admListPages">'.strPages;
            if ($Descending)
            {
                $forFrom = $pageCount;
                $forTo = 0;
                $forDelta = -1;
            }
            else
            {
                $forFrom = 1;
                $forTo = $pageCount+1;
                $forDelta = 1;
            }
            $pageIndex = arg($prefix.'pg') ? arg($prefix.'pg', 'int') : $forFrom;
            for ($i = $forFrom; $i != $forTo; $i += $forDelta)
            {
                if ($i == $pageIndex)
                {
                    $result .= '<span class="selected">&nbsp;'.$i.'&nbsp;</span>';
                }
                else
                {
                    $result .= '<a href="'.$this->url(array($prefix.'pg' => $i)).'">&nbsp;'.$i.'&nbsp;</a>';
                }
            }
            $result .= "</div>\n";
            return $result;
        }
        else
        {
            return '';
        }
    }
165756
public function render()
	{
		$paginator = $this->getPaginator();
		$page = $paginator->page;
		if ($paginator->pageCount < 2) {
			$steps = array($page);
		} else {
			$arr = range(max($paginator->firstPage, $page - 3), min($paginator->lastPage, $page + 3));
			if ($this->countBlocks) {
				$quotient = ($paginator->pageCount - 1) / $this->countBlocks;
				for ($i = 0; $i <= $this->countBlocks; $i++) {
					$arr[] = round($quotient * $i) + $paginator->firstPage;
				}
			}
			sort($arr);
			$steps = array_values(array_unique($arr));
		}

		$this->template->steps = $steps;
		$this->template->paginator = $paginator;
		$this->template->isAjax = $this->isAjax;
		$this->template->handle = 'showPage!';

		$this->template->setFile($this->getTemplateFile());
		$this->template->render();
	}
1362319
final public function render($ifIssetGet = null): string
    {
        $html = '';

        $andIfHasQueryParams = $this->accumulateIfHasQueryParams($ifIssetGet);

        if ($this->pagination->getGetPP() != Pagination::ALL && $this->pagination->getCount() > $this->pagination->getPerPage()) {
            $html .= $this->open();

            $html .= $this->previousLink(Str::andIfHasQueryParams($andIfHasQueryParams));
            $html .= $this->firstLink(Str::andIfHasQueryParams($andIfHasQueryParams));

            for ($i = $this->pagination->getPageStart(); $i <= $this->pagination->getPageEnd(); $i++) {
                if ($i == $this->pagination->getCurrentPage()) {
                    $html .= $this->paginationActive($i);
                } else {
                    if ($i != 1 && $i != $this->pagination->getNbPages()) {
                        $html .= $this->paginationLink($i.Str::andIfHasQueryParams($andIfHasQueryParams), $i);
                    }
                }
            }

            $html .= $this->lastLink(Str::andIfHasQueryParams($andIfHasQueryParams));
            $html .= $this->nextLink(Str::andIfHasQueryParams($andIfHasQueryParams));

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

        return $html;
    }
863314
function renderNav($prefix = '<span class="page_link">', $suffix = '</span>') {
        if ($this->total_rows == 0)
            return FALSE;
         
        $batch = ceil($this->page / $this->links_per_page );
        $end = $batch * $this->links_per_page;
        if ($end == $this->page) {
        //$end = $end + $this->links_per_page - 1;
        //$end = $end + ceil($this->links_per_page/2);
        }
        if ($end > $this->max_pages) {
            $end = $this->max_pages;
        }
        $start = $end - $this->links_per_page + 1;
        $links = '';
         
        for($i = $start; $i <= $end; $i ++) {
            if ($i == $this->page) {
                $links .= $prefix . " $i " . $suffix;                                       
            } else {
                $links .= " <a href='javascript:void(0);' OnClick='getdata( $i )' title='Outra página'>$i</a> ";
            }
        }
         
        return $links;
    }