PDA

Zobacz pełną wersję : Paginacja w zoo



morphic
13-05-2013, 13:52
Kolejny problem z ZOO.

Wszystkie dodatki (K2, VM, SOBI, inne) korzystają ze paginacji przypisanej do Joomla (chodzi mi o te numerki na dole strony kategorii :P ) . ZOO wybiło się przed szereg i ma własne. I problem pojawia się w tym momencie - jak zmusić ZOO żeby korzystało z tego samego pliku - znalazłem plik pagination.php w katalogu /libraries/joomla/html i widzę chyba ten kawałek J!, który za to odpowiada, mianowicie:

/** * Create and return the pagination data object. * * @return object Pagination data object. * * @since 11.1 */ protected function _buildDataObject() { // Initialise variables. $data = new stdClass;
// Build the additional URL parameters string. $params = ''; if (!empty($this->_additionalUrlParams)) { foreach ($this->_additionalUrlParams as $key => $value) { $params .= '&' . $key . '=' . $value; } }
$data->all = new JPaginationObject(JText::_('JLIB_HTML_VIEW_ALL'), $this->prefix); if (!$this->_viewall) { $data->all->base = '0'; $data->all->link = JRoute::_($params . '&' . $this->prefix . 'limitstart='); }
// Set the start and previous data objects. $data->start = new JPaginationObject(JText::_('JLIB_HTML_START'), $this->prefix); $data->previous = new JPaginationObject(JText::_('JPREV'), $this->prefix);
if ($this->get('pages.current') > 1) { $page = ($this->get('pages.current') - 2) * $this->limit;
// Set the empty for removal from route //$page = $page == 0 ? '' : $page;
$data->start->base = '0'; $data->start->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=0'); $data->previous->base = $page; $data->previous->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $page); }
// Set the next and end data objects. $data->next = new JPaginationObject(JText::_('JNEXT'), $this->prefix); $data->end = new JPaginationObject(JText::_('JLIB_HTML_END'), $this->prefix);
if ($this->get('pages.current') < $this->get('pages.total')) { $next = $this->get('pages.current') * $this->limit; $end = ($this->get('pages.total') - 1) * $this->limit;
$data->next->base = $next; $data->next->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $next); $data->end->base = $end; $data->end->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $end); }
$data->pages = array(); $stop = $this->get('pages.stop'); for ($i = $this->get('pages.start'); $i <= $stop; $i++) { $offset = ($i - 1) * $this->limit; // Set the empty for removal from route //$offset = $offset == 0 ? '' : $offset;
$data->pages[$i] = new JPaginationObject($i, $this->prefix); if ($i != $this->get('pages.current') || $this->_viewall) { $data->pages[$i]->base = $offset; $data->pages[$i]->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $offset); } } return $data; }}


Znalazłem też dziadostwo w ZOO, w templatce jest plik _pagination.php a jego zawartość wygląda z góry odmiennie:

<?php
/*** @package com_zoo* @author YOOtheme http://www.yootheme.com* @copyright Copyright (C) YOOtheme GmbH* @license http://www.gnu.org/licenses/gpl.html GNU/GPL*/

// no direct access
defined('_JEXEC') or die('Restricted access');


?>


<?php if ($pagination = $this->pagination->render($this->pagination_link)) : ?>
<div class="pagination">
<?php echo $pagination; ?>

</div>
<?php endif;

W J! paginacja opiera się na liście, a w ZOO na jednym czy dwóch divach.

Hilfe, bo do pochlastania się już niewiele mi brakuje :)

morphic
30-08-2013, 10:50
Oki już dałem radę :) Zrobiłem rzecz, której najmniej bym się spodziewał, że pomoże - ostylowałem pagination span w CSS-ie dla ZOO.

Temat raczej do zamknięcia.