diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-11-14 16:18:49 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-11-14 16:20:36 -0800 |
commit | 29efb6ba9f3e2cf15f29b509f985890c33bc08fa (patch) | |
tree | 8fc4ad5dc1b7f1d8e9a54cb5db06f9522f4745f1 | |
parent | 846f365db9d3c1b61ed4bd68316bd5e7b80e56ec (diff) |
Rename "pager" to "paginator" so that we differentiate page.html.php
from paginator.html.php
-rw-r--r-- | modules/gallery/libraries/Theme_View.php | 16 | ||||
-rw-r--r-- | modules/search/views/search.html.php | 2 | ||||
-rw-r--r-- | themes/wind/views/album.html.php | 2 | ||||
-rw-r--r-- | themes/wind/views/dynamic.html.php | 2 | ||||
-rw-r--r-- | themes/wind/views/movie.html.php | 2 | ||||
-rw-r--r-- | themes/wind/views/paginator.html.php (renamed from themes/wind/views/pager.html.php) | 32 | ||||
-rw-r--r-- | themes/wind/views/photo.html.php | 2 |
7 files changed, 32 insertions, 26 deletions
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 @@ </li> <? endforeach ?> </ul> - <?= $theme->pager() ?> + <?= $theme->paginator() ?> <? else: ?> <p> 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 @@ </ul> <?= $theme->album_bottom() ?> -<?= $theme->pager() ?> +<?= $theme->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 @@ </ul> <?= $theme->dynamic_bottom() ?> -<?= $theme->pager() ?> +<?= $theme->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 @@ <div id="g-item"> <?= $theme->photo_top() ?> - <?= $theme->pager() ?> + <?= $theme->paginator() ?> <div id="g-movie" class="ui-helper-clearfix"> <?= $item->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 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 +// ?> <ul class="g-pager ui-helper-clearfix"> <li class="g-first"> - <? if ($page_type == "album"): ?> + <? if ($page_type == "album" || $page_type == "tag"): ?> <? if (isset($first_page_url)): ?> <a href="<?= $first_page_url ?>" class="g-button ui-icon-left ui-state-default ui-corner-all"> <span class="ui-icon ui-icon-seek-first"></span><?= t("First") ?></a> @@ -46,17 +47,20 @@ </li> <li class="g-info"> - <? if ($page_type == "album"): ?> - <?= /* @todo This message isn't easily localizable */ - /* @todo does this really need to be a t2? why not just skip the msg when there's 1 photo? */ - t2("Photo %from_number of %count", - "Photos %from_number - %to_number of %count", - $total, - array("from_number" => $first_visible_position, - "to_number" => $last_visible_position, - "count" => $total)) ?> + <? if ($total): ?> + <? if ($page_type == "album" || $page_type == "tag"): ?> + <?= /* @todo This message isn't easily localizable */ + t2("Photo %from_number of %count", + "Photos %from_number - %to_number of %count", + $total, + array("from_number" => $first_visible_position, + "to_number" => $last_visible_position, + "count" => $total)) ?> + <? else: ?> + <?= t("%position of %total", array("position" => $position, "total" => $total)) ?> + <? endif ?> <? else: ?> - <?= t("%position of %total", array("position" => $position, "total" => $total)) ?> + <?= t("No photos") ?> <? endif ?> </li> @@ -69,7 +73,7 @@ <span class="ui-icon ui-icon-seek-next"></span><?= t("Next") ?></a> <? endif ?> - <? if ($page_type == "album"): ?> + <? if ($page_type == "album" || $page_type == "tag"): ?> <? if (isset($last_page_url)): ?> <a href="<?= $last_page_url ?>" class="g-button ui-icon-right ui-state-default ui-corner-all"> <span class="ui-icon ui-icon-seek-end"></span><?= t("Last") ?></a> 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 @@ <div id="g-item"> <?= $theme->photo_top() ?> - <?= $theme->pager() ?> + <?= $theme->paginator() ?> <div id="g-photo"> <?= $theme->resize_top($item) ?> |