public function render($outputMode = NULL, $skipChilds = false) { parent::render($outputMode, $skipChilds); if (!org_glizy_ObjectValues::get('org.glizycms.js', 'jsTree', false)) { org_glizy_ObjectValues::set('org.glizycms.js', 'jsTree', true); $this->addOutputCode(org_glizy_helpers_JS::linkStaticJSfile('jquery/jquery-jstree/jquery.jstree.js')); $this->addOutputCode(org_glizy_helpers_JS::linkStaticJSfile('jquery/jquery-jstree/jquery.cookie.js')); } }
/** * @param null $outputMode * @param bool $skipChilds */ function render($outputMode = NULL, $skipChilds = false) { if ($this->_content['totalPages'] > 1) { $currentPage = $this->_content['currentPage']; $groupLength = $this->getAttribute("groupLength"); $start = 1; $stop = $this->_content['totalPages']; $lastLink = array(); $showDisabledLinks = $this->getAttribute('showDisabledLinks'); if ($this->_content['totalPages'] > $groupLength) { $start = max(1, floor($currentPage / $groupLength) * $groupLength); $stop = min($this->_content['totalPages'], $start + ($groupLength - 1)); if ($currentPage != 1 || $showDisabledLinks) { $label = $this->getAttribute('arrowGroupPrev'); if ($label) { $tempArray = array(); $tempArray['__cssClass__'] = 'noNumber'; $tempArray['__url__'] = $currentPage != 1 ? org_glizy_helpers_Link::addParams(array($this->getId() . '_' . $this->pageUrl => 1)) : ''; $tempArray['value'] = $label; $this->_content['pagesLinks'][] = $tempArray; } $label = $this->getAttribute('arrowPrev'); if ($label) { $tempArray = array(); $tempArray['__cssClass__'] = 'noNumber'; $tempArray['__url__'] = $currentPage != 1 ? org_glizy_helpers_Link::addParams(array($this->getId() . '_' . $this->pageUrl => max(1, $currentPage - 1))) : ''; $tempArray['value'] = $label; $this->_content['pagesLinks'][] = $tempArray; } } if ($currentPage != $this->_content['totalPages'] || $showDisabledLinks) { $label = $this->getAttribute('arrowNext'); if ($label) { $tempArray = array(); $tempArray['__cssClass__'] = 'noNumber'; $tempArray['__url__'] = $currentPage != $this->_content['totalPages'] ? org_glizy_helpers_Link::addParams(array($this->getId() . '_' . $this->pageUrl => min($this->_content['totalPages'], $currentPage + 1))) : ''; $tempArray['value'] = $label; $lastLink[] = $tempArray; } $label = $this->getAttribute('arrowGroupNext'); if ($label) { $tempArray = array(); $tempArray['__cssClass__'] = 'noNumber'; $tempArray['__url__'] = $currentPage != $this->_content['totalPages'] ? org_glizy_helpers_Link::addParams(array($this->getId() . '_' . $this->pageUrl => $this->_content['totalPages'])) : ''; $tempArray['value'] = $label; $lastLink[] = $tempArray; } } } for ($i = $start; $i <= $stop; $i++) { $tempArray = array(); $tempArray['__cssClass__'] = $currentPage == $i ? 'current' : 'number'; $tempArray['__cssClass__'] .= $i == $start ? ($tempArray['__cssClass__'] != '' ? ' ' : '') . 'first' : ''; $tempArray['__cssClass__'] .= $i == $stop ? ($tempArray['__cssClass__'] != '' ? ' ' : '') . 'last' : ''; $tempArray['__url__'] = ''; $tempArray['value'] = $i; if ($currentPage != $i) { $tempArray['__url__'] = org_glizy_helpers_Link::addParams(array($this->getId() . '_' . $this->pageUrl => $i)); } $this->_content['pagesLinks'][] = $tempArray; } if (count($lastLink)) { $this->_content['pagesLinks'] = array_merge($this->_content['pagesLinks'], $lastLink); } } $this->_content['goTo'] = ''; if ($this->getAttribute('showGoTo')) { $form = '<form action="' . org_glizy_helpers_Link::addParams(array()) . '" method="post">'; $form .= '<input class="page" type="text" onfocus="this.value=\'\';" value="#" name="' . $this->getId() . '_' . $this->pageUrl . '"/>'; $form .= '<input class="go" type="image" src="' . org_glizy_Assets::get('ICON_GO') . '"/>'; $form .= '</form>'; $this->_content['goTo'] = $form; } if ($this->getAttribute('showTotal')) { $this->_content['totalRecords'] = $this->_content['recordsCount']; } parent::render($outputMode, $skipChilds); }