From 29efb6ba9f3e2cf15f29b509f985890c33bc08fa Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 14 Nov 2009 16:18:49 -0800 Subject: [PATCH] Rename "pager" to "paginator" so that we differentiate page.html.php from paginator.html.php --- modules/gallery/libraries/Theme_View.php | 16 ++++++---- modules/search/views/search.html.php | 2 +- themes/wind/views/album.html.php | 2 +- themes/wind/views/dynamic.html.php | 2 +- themes/wind/views/movie.html.php | 2 +- .../{pager.html.php => paginator.html.php} | 32 +++++++++++-------- themes/wind/views/photo.html.php | 2 +- 7 files changed, 32 insertions(+), 26 deletions(-) rename themes/wind/views/{pager.html.php => paginator.html.php} (78%) 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 +// ?>
  • - + @@ -46,17 +47,20 @@
  • - - $first_visible_position, - "to_number" => $last_visible_position, - "count" => $total)) ?> + + + $first_visible_position, + "to_number" => $last_visible_position, + "count" => $total)) ?> + + $position, "total" => $total)) ?> + - $position, "total" => $total)) ?> +
  • @@ -69,7 +73,7 @@ - + diff --git a/themes/wind/views/photo.html.php b/themes/wind/views/photo.html.php index 091fd7c5..e0fae3f1 100644 --- a/themes/wind/views/photo.html.php +++ b/themes/wind/views/photo.html.php @@ -15,7 +15,7 @@
    photo_top() ?> - pager() ?> + paginator() ?>
    resize_top($item) ?>