1
0

When the display limit is specified, but there less than the display limit items, then use the item count as the display limit.

This commit is contained in:
Tim Almdal 2011-06-02 21:33:05 -07:00
parent 246cf60db7
commit fd55451395
2 changed files with 8 additions and 4 deletions

View File

@ -30,12 +30,14 @@ class Dynamic_Controller extends Controller {
$page = Input::instance()->get("page", "1");
$album_defn = unserialize(module::get_var("dynamic", $album));
$children_count = $album_defn->limit;
if (empty($children_count)) {
$display_limit = $album_defn->limit;
if (empty($display_limit)) {
$children_count = ORM::factory("item")
->viewable()
->where("type", "!=", "album")
->count_all();
} else {
$children_count = $display_limit;
}
$offset = ($page-1) * $page_size;

View File

@ -30,12 +30,14 @@ class Dynamic_Controller extends Controller {
$page = Input::instance()->get("page", "1");
$album_defn = unserialize(module::get_var("dynamic", $album));
$children_count = $album_defn->limit;
if (empty($children_count)) {
$display_limit = $album_defn->limit;
if (empty($display_limit)) {
$children_count = ORM::factory("item")
->viewable()
->where("type", "!=", "album")
->count_all();
} else {
$children_count = $display_limit;
}
$offset = ($page-1) * $page_size;