Returns HTML to display the paging bar.

@param paging_bar $pagingbar
@return string the HTML to output.
162134
protected function render_paging_bar(paging_bar $pagingbar) {
        // Any more than 10 is not usable and causes weird wrapping of the pagination.
        $pagingbar->maxdisplay = 10;
        return $this->render_from_template('core/paging_bar', $pagingbar->export_for_template($this));
    }
1128027
public function output_html() {
        global $OUTPUT;

        $activetab = optional_param('activetab', '', PARAM_TEXT);
        $context = array('tabs' => array());
        $havesetactive = false;

        foreach ($this->get_tabs() as $tab) {
            $active = false;

            // Default to first tab it not told otherwise.
            if (empty($activetab) && !$havesetactive) {
                $active = true;
                $havesetactive = true;
            } else if ($activetab === $tab->name) {
                $active = true;
            }

            $context['tabs'][] = array(
                'name' => $tab->name,
                'displayname' => $tab->visiblename,
                'html' => $tab->output_html(),
                'active' => $active,
            );
        }

        if (empty($context['tabs'])) {
            return '';
        }

        return $OUTPUT->render_from_template('theme_boost/admin_setting_tabs', $context);
    }
73499
public function onOutputFrontendTemplate($buffer)
    {
        if (null !== ($rootPage = PageModel::findByPk($GLOBALS['objPage']->rootId)) && $rootPage->cookiebar_enable) {
            $generator = new CookiebarGenerator();
            $cookiebar = $generator->createTemplate($rootPage->row())->parse();

            if ('before_wrapper' === $rootPage->cookiebar_placement) {
                $buffer = str_replace('<div id="wrapper">', $cookiebar.'<div id="wrapper">', $buffer);
            } else {
                $buffer = str_replace('</body>', $cookiebar.'</body>', $buffer);
            }
        }

        return $buffer;
    }
657817
public function getPaginationHTML()
    {
        if ($this->pagination->haveToPaginate()) {
            $view = new TwitterBootstrap3View();
            $me = $this;
            $result = $view->render(
                $this->pagination,
                function ($page) use ($me) {
                    $list = $me->getItemListObject();
                    $result = (string) $me->getBaseURL();
                    $result .= strpos($result, '?') === false ? '?' : '&';
                    $result .= ltrim($list->getQueryPaginationPageParameter(), '&') . '=' . $page;

                    return $result;
                },
                [
                    'prev_message' => tc('Pagination', '&larr; Previous'),
                    'next_message' => tc('Pagination', 'Next &rarr;'),
                    'active_suffix' => '<span class="sr-only">' . tc('Pagination', '(current)') . '</span>',
                ]
            );
        } else {
            $result = '';
        }

        return $result;
    }
233599
public function generatepage_html(){
		$bhtml=BHTML::getInstance();
		$status=200;
		//Forming page from blocks...
		$jsused=array();
		$cssused=array();
		foreach($this->rules as &$c){
			if(isset($this->positions[$c->position])){
				$this->positions[$c->position].=$c->output;
				}else{
				$this->positions[$c->position]=$c->output;
				}
			if($c->status!=200){
				$status=$c->status;
				}
			if(isset($c->locationurl)){
				$bhtml->setLocationUrl($c->locationurl,$c->locationtime);
				}
			if(isset($c->modified)){
				$bhtml->setLastModified($c->modified);
				}
			if(isset($c->title)){
				$bhtml->setTitle($c->title);
				}
			if(isset($c->meta)){
				foreach($c->meta as $meta){
					$bhtml->add_meta($meta['name'],$meta['content'],$meta['http_equiv']);
					}
				}
			if(isset($c->link)){
				foreach($c->link as $link){
					//Remove dublicates...
					$wasused=false;
					if($link['rel']=='stylesheet'){
						$wasused=isset($cssused[$link['href']]);
						$cssused[$link['href']]=1;
						}
					if(!$wasused){
						$bhtml->add_link($link);
						}
					}
				}
			if(isset($c->js)){
				foreach($c->js as $js){
					//Remove dublicates...
					$wasused=false;
					if(!empty($js['file'])){
						$wasused=isset($jsused[$js['file']]);
						$jsused[$js['file']]=1;
						}
					if(!$wasused){
						$bhtml->addJS($js['file'],$js['src'],$js['priority']);
						}
					}
				}
			if(isset($c->style)){
				foreach($c->style as $st){
					$bhtml->addCSSDeclaration($st);
					}
				}
			if(isset($c->frameworks)){
				foreach($c->frameworks as $framework){
					$bhtml->useFramework($framework);
					}
				}
			//Add breadcrumbs elements
			if(isset($c->breadcrumbs)){
				bimport('cms.breadcrumbs');
				$gbc=BGeneralBreadcrumbs::getInstance();
				foreach($c->breadcrumbs as $bc){
					$gbc->elements[]=$bc;
					}
				}
			}
		//Output the page
		header('Content-Type: text/html; charset=utf-8');
		if($status==403){
			header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden');
			}
		if($status==404){
			header($_SERVER['SERVER_PROTOCOL'].' 404 Page Not Found');
			}
		if($status==500){
			header($_SERVER['SERVER_PROTOCOL'].' 500 Server Error!');
			}
		$bhtml->headers_check();
		//Check for last-modified
		if((isset($_SERVER['HTTP_IF_MODIFIED_SINCE']))&&(isset($bhtml->last_modified))){
			$mod_since=new DateTime($_SERVER['HTTP_IF_MODIFIED_SINCE']);
			$interval=date_diff($bhtml->last_modified,$mod_since);
			if($interval->invert==0){
	        		header($_SERVER['SERVER_PROTOCOL'].' 304 Not Modified');
				return;//return nothing!
				}
			}
		if($this->templatename===NULL){
			$this->templatename='default';
			}
		//Detect device...
		$device=BBrowserUseragent::detectDevice();
		if($device==DEVICE_TYPE_MPHONE){
			$suffix='.m';
			}
		elseif($device==DEVICE_TYPE_TABLET){
			$suffix='.m';
			}else{
			$suffix='.d';
			}
		$fn=BTEMPLATESPATH.$this->templatename.DIRECTORY_SEPARATOR.'template'.$suffix.'.php';
		//
		if(!file_exists($fn)){
			$fn=BTEMPLATESPATH.$this->templatename.DIRECTORY_SEPARATOR.'template.d.php';
			}
		//
		if(!file_exists($fn)){
			$fn=BTEMPLATESPATH.'default'.DIRECTORY_SEPARATOR.'template'.$suffix.'.php';
			}
		//
		if(!file_exists($fn)){
			$fn=BTEMPLATESPATH.'default'.DIRECTORY_SEPARATOR.'template.d.php';
			}

		//Starting render
		if(DEBUG_MODE){
			BLog::addToLog('[Router]: Rendering template...');
			}
		ob_start();
		include $fn;
		$tpl_str=ob_get_clean();
		$tpl_str=str_replace('{{head}}','',$tpl_str);
		if(DEBUG_MODE){
			BLog::addToLog('[Router]: Filling empty positions...');
			}
		$pattern='/{{position.(?P<position>\w+)*}}/';
		preg_match_all($pattern, $tpl_str, $matches);
		foreach($matches['position'] as $pos){
			if(!isset($this->positions[$pos])){
				$this->positions[$pos]='';
				}
			}
		if(DEBUG_MODE){
			BLog::addToLog('[Router]: Put content into positions...');
			}
		foreach($this->positions as $p=>$val){
			$tpl_str=str_replace('{{position:'.$p.'}}',$val,$tpl_str);
			}
		//Output debug information, if necessary.
		if(DEBUG_MODE){
			BLog::addToLog('[Router]: Generation time: '.sprintf('%7.7f',self::page_time()));
			BLog::addToLog('[Router]: MySQL queries:'.BMySQL::getQueriesCount());
			$qc=BCache::getQueriesCount();
			BLog::addToLog('[Router]: Cache queries: get-'.$qc['get'].' set-'.$qc['set'].' mset-'.$qc['mset'].' mget-'.$qc['mget'].' gc-'.$qc['gc']);
			BLog::addToLog('[Router]: Outputing the template...');
			}
		echo($tpl_str);
		BLog::addToLog('[Router]: All done!');
		if(!empty($this->htmllogger)){
			$this->htmllogger->print_html();
			}
		}
607664
public function output() {
		$arguments = func_get_args();
		$this->pager->page();
		$result = [];

		if (count($arguments) == 1) {
			$headers = $arguments[0];
			$fields = $arguments[0];
		} elseif (count($arguments == 2)) {
			$headers = $arguments[0];
			$fields = $arguments[1];
			if (count($headers) != count($fields)) {
				throw new \Exception('If headers and fields are given, both should have an equal amount of values');
			}
		} else {
			throw new \Exception('This function requires 1 or 2 arrays as parameter: The first is the header, second are the field names or closures.');
		}


		foreach ($this->pager->items as $item) {
			$row = [];
			foreach ($headers as $key => $header) {
				if (is_callable($fields[$key])) {
					$row[$header] = $fields[$key]($item);
				} else {
					$row[$header] = \Skeleton\Pager\Util::object_get_attribute($item, $fields[$key]);
				}
			}
			$result[] = $row;
		}

		$this->output_array($headers, $result);

	}
293419
public function query_db($pagesize, $useinitialsbar = true) {

        $total = \tool_monitor\rule_manager::count_rules_by_courseid($this->courseid);
        $this->pagesize($pagesize, $total);
        $rules = \tool_monitor\rule_manager::get_rules_by_courseid($this->courseid, $this->get_page_start(),
                $this->get_page_size());
        $this->rawdata = $rules;
        // Set initial bars.
        if ($useinitialsbar) {
            $this->initialbars($total > $pagesize);
        }
    }
776330
public function adminBar() {
		global $wp_admin_bar;

		if ( ! $wp_admin_bar instanceof \WP_Admin_Bar ) {
			return;
		}
		$nodes = $wp_admin_bar->get_nodes();
		if ( ! is_iterable( $nodes ) ) {
			return;
		}

		// First initialize the array of child/parent pairs:
		$relationships = [];
		foreach ( $nodes as $id => $node ) {
			$parent = ! empty( $node->parent ) ? $node->parent : 'root';
			// Child : Parent
			$relationships[ $id ] = $parent;
		}
		$relationships['root'] = null;

		$tree = $this->parseAdminBarTree( $relationships );

		ob_start();
		$this->printAdminBarTree( $tree[0]['children'], $nodes );
		$html = ob_get_clean();

		$this->adminBarForSiteMap = $html;
	}
1371125
public function render()
    {
        if (!$this->grid->showPagination()) {
            return '';
        }

        return $this->paginationRanger().
            $this->paginationLinks().
            $this->perPageSelector();
    }
1218612
private function getHtmlBeginning()
	{
		$html = '<' . $this->tagName;

		foreach ($this->attributes as $name => $value) {
			$html .= ' ' . $name . '="' . htmlspecialchars($value) . '"';
		}

		return $html;
	}
957590
protected String htmlPagingBar() {

        if (getNumberOfPages() < 2) {
            return "";
        }
        StringBuffer html = new StringBuffer(1024);
        CmsMessages messages = Messages.get().getBundle(getWp().getLocale());
        html.append("<table width='100%' cellspacing='0' style='margin-top: 5px;'>\n");
        html.append("\t<tr>\n");
        html.append("\t\t<td class='main'>\n");
        // prev button
        String id = "listPrev";
        String name = messages.key(Messages.GUI_LIST_PAGING_PREVIOUS_NAME_0);
        String iconPath = ICON_LEFT;
        boolean enabled = getCurrentPage() > 1;
        String helpText = messages.key(Messages.GUI_LIST_PAGING_PREVIOUS_HELP_0);
        if (!enabled) {
            helpText = messages.key(Messages.GUI_LIST_PAGING_PREVIOUS_HELPDIS_0);
        }
        String onClic = "listSetPage('" + getId() + "', " + (getCurrentPage() - 1) + ")";
        html.append(A_CmsHtmlIconButton.defaultButtonHtml(
            CmsHtmlIconButtonStyleEnum.SMALL_ICON_TEXT,
            id,
            name,
            helpText,
            enabled,
            iconPath,
            null,
            onClic));
        html.append("\n");
        // next button
        id = "listNext";
        name = messages.key(Messages.GUI_LIST_PAGING_NEXT_NAME_0);
        iconPath = ICON_RIGHT;
        enabled = getCurrentPage() < getNumberOfPages();
        helpText = messages.key(Messages.GUI_LIST_PAGING_NEXT_HELP_0);
        if (!enabled) {
            helpText = messages.key(Messages.GUI_LIST_PAGING_NEXT_HELPDIS_0);
        }
        onClic = "listSetPage('" + getId() + "', " + (getCurrentPage() + 1) + ")";
        html.append(A_CmsHtmlIconButton.defaultButtonHtml(
            CmsHtmlIconButtonStyleEnum.SMALL_ICON_TEXT,
            id,
            name,
            helpText,
            enabled,
            iconPath,
            null,
            onClic));
        html.append("\n");
        // page selection list
        html.append("\t\t\t&nbsp;&nbsp;&nbsp;");
        html.append("\t\t\t<select name='listPageSet' id='id-page_set' onChange =\"listSetPage('");
        html.append(getId());
        html.append("', this.value);\" style='vertical-align: bottom;'>\n");
        html.append(
            htmlPageSelector(
                getNumberOfPages(),
                getMaxItemsPerPage(),
                getSize(),
                getCurrentPage(),
                getWp().getLocale()));
        html.append("\t\t\t</select>\n");
        html.append("\t\t\t&nbsp;&nbsp;&nbsp;");
        boolean isNotSearching = true;
        if (getMetadata().isSearchable()) {
            isNotSearching = CmsStringUtil.isEmptyOrWhitespaceOnly(m_searchFilter);
        }
        if (isNotSearching) {
            html.append(
                messages.key(
                    Messages.GUI_LIST_PAGING_TEXT_2,
                    new Object[] {m_name.key(getWp().getLocale()), new Integer(getTotalSize())}));
        } else {
            html.append(messages.key(
                Messages.GUI_LIST_PAGING_FILTER_TEXT_3,
                new Object[] {m_name.key(getWp().getLocale()), new Integer(getSize()), new Integer(getTotalSize())}));
        }
        html.append("\t\t</td>\n");
        html.append("\t</tr>\n");
        html.append("</table>\n");
        return html.toString();
    }
770665
public function render()
    {
        if (!$this->grid->usePagination()) {
            return '';
        }

        return $this->paginationRanger().
            $this->paginationLinks().
            $this->perPageSelector();
    }
1370487
public function getEasyMarkup(){

        $markup = '';

        if($this->prevUrl){
            $markup .= "<li class='pagination-previous' title='View previous page'><a href='{$this->prevUrl}'>prev</a></li>";
        }//if

        $pages = $this->getPrevUrls(5);

        foreach($pages as $i => $page){
            $markup .= "<li><a href='{$page}' title='View page {$i} of {$this->totalPages}'>{$i}</a></li>";
        }//foreach

        if($this->totalPages){
            $markup .= "<li class='current' title='Your viewing page {$this->currentPage} of {$this->totalPages}'><a>{$this->currentPage}</a></li>";
        }//if

        $pages = $this->getNextUrls(5);

        foreach($pages as $i => $page){
            $markup .= "<li><a href='{$page}' title='View page {$i} of {$this->totalPages}'>{$i}</a></li>";
        }//foreach

        if($this->nextUrl){
            $markup .= "<li class='pagination-next' title='View next page'><a href='{$this->nextUrl}'>next</a></li>";
        }//if

        return "<ul class='pagination'>{$markup}</ul>";

    }
162516
protected function renderMenu(bool $specialSidebar = false): string
    {
        $presenter = $this->getPresenter();
        $menu = $presenter->getOpenTagWrapper();

        foreach ($this->getOrderedItems() as $item) {
            if ($item->isHidden()) {
                continue;
            }

            if ($item->hasChilds()) {
                $menu .= $presenter->getMenuWithDropDownWrapper($item, $specialSidebar);
            } elseif ($item->isHeader()) {
                $menu .= $presenter->getHeaderWrapper($item);
            } elseif ($item->isDivider()) {
                $menu .= $presenter->getDividerWrapper();
            } else {
                $menu .= $presenter->getMenuWithoutDropdownWrapper($item);
            }
        }

        $menu .= $presenter->getCloseTagWrapper();

        return $menu;
    }
1174242
public function getPaginationHtml($pager, $routeName, array $routeAttributes = [])
	{
		return (new TwitterBootstrap3View())->render($pager,
			function($page) use ($routeName, $routeAttributes) {
				return $this->app['router']->generate($routeName, array_merge(['page' => $page], $routeAttributes));
			},
			[
				'proximity' => 2,
				'prev_message' => 'Précédente',
				'next_message' => 'Suivante'
			]
		);
	}
860396
public function _toHtml()
    {
        $html = '';

        foreach ($this->getChildNames() as $childName) {
            if ($html === '') {
                $renderer = $this->getChildBlock($childName);
                $html = $renderer->render($this->getFilter());
            }
        }

        return $html;
    }
1026148
private function getPagination()
    {
        # pagination
        $this->pagination['page'] = 1;
        $this->pagination['per_page'] = Utils::findKey($this->options, 'limit', 50);
        $this->pagination['padding'] = Utils::findKey($this->options, 'padding', 0);
        $this->pagination['offset'] = Utils::findKey($this->options, 'offset', 0);

        $this->payload['size'] = $this->pagination['per_page'];
        $this->payload['from'] = $this->pagination['offset'];
    }