Commit 53321baf authored by Dries's avatar Dries
Browse files

- Patch by Kjartan:

   + Pager is not generated when there are less results than the limit.
   + Fixes ugly blank rows in administration pages when there is just one
     page.
parent 4c7bd41a
......@@ -29,6 +29,8 @@ function pager_display($tags = "", $limit = 10, $element = 0, $type = "default",
* @see pager_display
*/
function pager_display_default($tags = "", $limit = 10, $element = 0, $attributes = array()) {
global $pager_total;
if ($pager_total[$element] > $limit) {
$output .= "<div align=\"center\"><table cellpadding=\"10\"><tbody><tr>";
$output .= "<td align=\"center\">". pager_first(($tags[0] ? $tags[0] : t("first page")), $limit, $element, $attributes) ."</td>";
$output .= "<td align=\"center\">". pager_previous(($tags[1] ? $tags[1] : t("previous page")), $limit, $element, 1, $attributes) ."</td>";
......@@ -37,7 +39,8 @@ function pager_display_default($tags = "", $limit = 10, $element = 0, $attribute
$output .= "<td align=\"center\">". pager_last(($tags[4] ? $tags[4] : t("last page")), $limit, $element, $attributes) ."</td>";
$output .= "</tr></tbody></table></div>";
return "$output";
return $output;
}
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment