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:
parent
246cf60db7
commit
fd55451395
@ -30,12 +30,14 @@ class Dynamic_Controller extends Controller {
|
|||||||
$page = Input::instance()->get("page", "1");
|
$page = Input::instance()->get("page", "1");
|
||||||
|
|
||||||
$album_defn = unserialize(module::get_var("dynamic", $album));
|
$album_defn = unserialize(module::get_var("dynamic", $album));
|
||||||
$children_count = $album_defn->limit;
|
$display_limit = $album_defn->limit;
|
||||||
if (empty($children_count)) {
|
if (empty($display_limit)) {
|
||||||
$children_count = ORM::factory("item")
|
$children_count = ORM::factory("item")
|
||||||
->viewable()
|
->viewable()
|
||||||
->where("type", "!=", "album")
|
->where("type", "!=", "album")
|
||||||
->count_all();
|
->count_all();
|
||||||
|
} else {
|
||||||
|
$children_count = $display_limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$offset = ($page-1) * $page_size;
|
$offset = ($page-1) * $page_size;
|
||||||
|
@ -30,12 +30,14 @@ class Dynamic_Controller extends Controller {
|
|||||||
$page = Input::instance()->get("page", "1");
|
$page = Input::instance()->get("page", "1");
|
||||||
|
|
||||||
$album_defn = unserialize(module::get_var("dynamic", $album));
|
$album_defn = unserialize(module::get_var("dynamic", $album));
|
||||||
$children_count = $album_defn->limit;
|
$display_limit = $album_defn->limit;
|
||||||
if (empty($children_count)) {
|
if (empty($display_limit)) {
|
||||||
$children_count = ORM::factory("item")
|
$children_count = ORM::factory("item")
|
||||||
->viewable()
|
->viewable()
|
||||||
->where("type", "!=", "album")
|
->where("type", "!=", "album")
|
||||||
->count_all();
|
->count_all();
|
||||||
|
} else {
|
||||||
|
$children_count = $display_limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$offset = ($page-1) * $page_size;
|
$offset = ($page-1) * $page_size;
|
||||||
|
Reference in New Issue
Block a user