diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 5e8bc728..19dc0829 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -140,26 +140,28 @@ class Theme_View_Core extends Gallery_View { * * See themes/wind/views/pager.html for documentation on the variables generated here. */ - public function pager() { - $v = new View("pager.html"); + public function paginator() { + $v = new View("paginator.html"); $v->page_type = $this->page_type; $v->first_page_url = null; $v->previous_page_url = null; $v->next_page_url = null; $v->last_page_url = null; - if ($this->page_type == "album") { + if ($this->page_type == "album" || $this->page_type = "tag") { $v->page = $this->page; $v->max_pages = $this->max_pages; $v->total = $this->children_count; + + $model = $this->page_type == "album" ? $this->item : $this->tag; if ($this->page != 1) { - $v->first_page_url = $this->item->url(); - $v->previous_page_url = $this->item->url("page=" . ($this->page - 1)); + $v->first_page_url = $model->url(); + $v->previous_page_url = $model->url("page=" . ($this->page - 1)); } if ($this->page != $this->max_pages) { - $v->next_page_url = $this->item->url("page=" . ($this->page + 1)); - $v->last_page_url = $this->item->url("page={$this->max_pages}"); + $v->next_page_url = $model->url("page=" . ($this->page + 1)); + $v->last_page_url = $model->url("page={$this->max_pages}"); } $v->first_visible_position = ($this->page - 1) * $this->page_size + 1; diff --git a/modules/search/views/search.html.php b/modules/search/views/search.html.php index 4b67157e..fdf22a9e 100644 --- a/modules/search/views/search.html.php +++ b/modules/search/views/search.html.php @@ -40,7 +40,7 @@ - pager() ?> + paginator() ?>

diff --git a/themes/wind/views/album.html.php b/themes/wind/views/album.html.php index 1163630d..2c2b54eb 100644 --- a/themes/wind/views/album.html.php +++ b/themes/wind/views/album.html.php @@ -38,4 +38,4 @@ album_bottom() ?> -pager() ?> +paginator() ?> diff --git a/themes/wind/views/dynamic.html.php b/themes/wind/views/dynamic.html.php index 51e48dc0..a8a4d362 100644 --- a/themes/wind/views/dynamic.html.php +++ b/themes/wind/views/dynamic.html.php @@ -26,4 +26,4 @@ dynamic_bottom() ?> -pager() ?> +paginator() ?> diff --git a/themes/wind/views/movie.html.php b/themes/wind/views/movie.html.php index a44b891a..27c293ce 100644 --- a/themes/wind/views/movie.html.php +++ b/themes/wind/views/movie.html.php @@ -2,7 +2,7 @@

photo_top() ?> - pager() ?> + paginator() ?>
movie_img(array("class" => "g-movie", "id" => "g-movie-id-{$item->id}")) ?> diff --git a/themes/wind/views/pager.html.php b/themes/wind/views/paginator.html.php similarity index 78% rename from themes/wind/views/pager.html.php rename to themes/wind/views/paginator.html.php index 51d52021..5d300cf4 100644 --- a/themes/wind/views/pager.html.php +++ b/themes/wind/views/paginator.html.php @@ -6,12 +6,12 @@ // for album views. // // Available variables for all page types: -// $page_type - "album", "movie" or "photo" +// $page_type - "album", "movie", "photo" or "tag" // $previous_page_url - the url to the previous page, if there is one // $next_page_url - the url to the next page, if there is one // $total - the total number of photos in this album // -// Available for the "album" page type: +// Available for the "album" and "tag" page types: // $page - what page number we're on // $max_pages - the maximum page number // $page_size - the page size @@ -22,11 +22,12 @@ // // Available for "photo" and "movie" page types: // $position - the position number of this photo +// ?>