diff --git a/template.php b/template.php index d394b77..38a36de 100644 --- a/template.php +++ b/template.php @@ -440,54 +440,68 @@ function tao_pager_link($vars) { } } - return array( - 'title' => $text, - 'href' => $_GET['q'], - 'attributes' => $attributes, - 'query' => count($query) ? $query : NULL, - ); + $attributes['href'] = url($_GET['q'], array('query' => $query)); + return '' . check_plain($text) . ''; } /** * Override of theme_views_mini_pager(). */ function tao_views_mini_pager($vars) { + global $pager_page_array, $pager_total; + $tags = $vars['tags']; - $quantity = $vars['quantity']; $element = $vars['element']; $parameters = $vars['parameters']; - global $pager_page_array, $pager_total; - - // Calculate various markers within this pager piece: - // Middle is used to "center" pages around the current page. - $pager_middle = ceil($quantity / 2); // current is the page we are currently paged to $pager_current = $pager_page_array[$element] + 1; // max is the maximum page number $pager_max = $pager_total[$element]; // End of marker calculations. - $links = array(); if ($pager_total[$element] > 1) { - $links['pager-previous'] = theme('pager_previous', array( - 'text' => (isset($tags[1]) ? $tags[1] : t('Prev')), + + $li_previous = theme('pager_previous', array( + 'text' => (isset($tags[1]) ? $tags[1] : t('‹‹')), 'element' => $element, 'interval' => 1, - 'parameters' => $parameters + 'parameters' => $parameters, )); - $links['pager-current'] = array( - 'title' => t('@current of @max', array( - '@current' => $pager_current, - '@max' => $pager_max) - ) - ); - $links['pager-next'] = theme('pager_next', array( - 'text' => (isset($tags[3]) ? $tags[3] : t('Next')), + if (empty($li_previous)) { + $li_previous = " "; + } + + $li_next = theme('pager_next', array( + 'text' => (isset($tags[3]) ? $tags[3] : t('››')), 'element' => $element, 'interval' => 1, - 'parameters' => $parameters + 'parameters' => $parameters, + )); + + if (empty($li_next)) { + $li_next = " "; + } + + $items[] = array( + 'class' => array('pager-previous'), + 'data' => $li_previous, + ); + + $items[] = array( + 'class' => array('pager-current'), + 'data' => t('@current of @max', array('@current' => $pager_current, '@max' => $pager_max)), + ); + + $items[] = array( + 'class' => array('pager-next'), + 'data' => $li_next, + ); + return theme('item_list', array( + 'items' => $items, + 'title' => NULL, + 'type' => 'ul', + 'attributes' => array('class' => array('pager')), )); - return theme('links', array('links' => $links, 'attributes' => array('class' => array('links', 'pager', 'views-mini-pager')))); } }