mirror of
https://github.com/Pathduck/gallery3.git
synced 2024-10-29 21:07:18 -04:00
Fixed item controllers so that any item position is computed correctly, when some other items belonging to the same parent album are not viewable.
Changed depracated calls to item_Model::get_position() to item::get_position().
This commit is contained in:
parent
0d7e951aa5
commit
24c0b69847
@ -37,7 +37,7 @@ class Albums_Controller extends Items_Controller {
|
||||
|
||||
if ($show) {
|
||||
$child = ORM::factory("item", $show);
|
||||
$index = $album->get_position($child);
|
||||
$index = item::get_position($child);
|
||||
if ($index) {
|
||||
$page = ceil($index / $page_size);
|
||||
if ($page == 1) {
|
||||
|
@ -28,10 +28,10 @@ class Movies_Controller extends Items_Controller {
|
||||
access::required("view", $movie);
|
||||
|
||||
$where = array(array("type", "!=", "album"));
|
||||
$position = $movie->parent()->get_position($movie, $where);
|
||||
$position = item::get_position($movie, $where);
|
||||
if ($position > 1) {
|
||||
list ($previous_item, $ignore, $next_item) =
|
||||
$movie->parent()->children(3, $position - 2, $where);
|
||||
$movie->parent()->viewable()->children(3, $position - 2, $where);
|
||||
} else {
|
||||
$previous_item = null;
|
||||
list ($next_item) = $movie->parent()->viewable()->children(1, $position, $where);
|
||||
|
@ -28,10 +28,10 @@ class Photos_Controller extends Items_Controller {
|
||||
access::required("view", $photo);
|
||||
|
||||
$where = array(array("type", "!=", "album"));
|
||||
$position = $photo->parent()->get_position($photo, $where);
|
||||
$position = item::get_position($photo, $where);
|
||||
if ($position > 1) {
|
||||
list ($previous_item, $ignore, $next_item) =
|
||||
$photo->parent()->children(3, $position - 2, $where);
|
||||
$photo->parent()->viewable()->children(3, $position - 2, $where);
|
||||
} else {
|
||||
$previous_item = null;
|
||||
list ($next_item) = $photo->parent()->viewable()->children(1, $position, $where);
|
||||
|
Loading…
Reference in New Issue
Block a user