diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2005-10-21 10:58:15 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2005-10-21 10:58:15 +0000 |
commit | a9260fa2cd279851db674fa84c1efebfe103ba0d (patch) | |
tree | cbb766e90c7bb148af94faa63d2837a20b7b2481 /includes/pager.inc | |
parent | c0525a7c18100c229a98091660251934a84c9a89 (diff) | |
download | brdo-a9260fa2cd279851db674fa84c1efebfe103ba0d.tar.gz brdo-a9260fa2cd279851db674fa84c1efebfe103ba0d.tar.bz2 |
- #32603: Clean up theme_pager_link (drumm)
Diffstat (limited to 'includes/pager.inc')
-rw-r--r-- | includes/pager.inc | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/includes/pager.inc b/includes/pager.inc index 978331a5d..959ce321b 100644 --- a/includes/pager.inc +++ b/includes/pager.inc @@ -356,23 +356,19 @@ function theme_pager_list($limit, $element = 0, $quantity = 5, $text = '', $attr * An HTML string that generates the link. */ function theme_pager_link($text, $page_new, $element, $attributes = array()) { - $q = $_GET['q']; - $page = array_key_exists('page', $_GET) ? $_GET['page'] : ''; + $page = isset($_GET['page']) ? $_GET['page'] : ''; + if ($new_page = implode(',', pager_load_array($page_new[$element], $element, explode(',', $page)))) { + $attributes['page'] = $new_page; + } + $query = array(); foreach ($attributes as $key => $value) { $query[] = $key .'='. $value; } - $page_new = pager_load_array($page_new[$element], $element, explode(',', $page)); - if (count($attributes)) { - $url = url($q, 'page='. implode(',', $page_new) .'&'. implode('&', $query)); - } - else { - $url = url($q, 'page='. implode(',', $page_new)); - } - - return '<a href="'. check_url($url) .'">'. check_plain($text) .'</a>'; + return l($text, $_GET['q'], array(), count($query) ? implode('&', $query) : NULL); } + /** * @} End of "Pager pieces". */ |