summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2011-04-26 09:48:21 -0700
committerBharat Mediratta <bharat@menalto.com>2011-04-26 09:48:21 -0700
commit5cf38ed816006af52fa08475d2957a6f18846887 (patch)
treeafc496762fad5527ef6b17508096ec38601b0f34 /modules/comment
parentc6d1d6a6aed96f772690b74ac0be482bc2128a8d (diff)
Stop using Pagination() and instead use $theme->pager() in views.
Move the pager() function up to Gallery_View and replace themes/admin_wind/views/pager.html.php (Pagination based) with a modified version from the wind theme in themes/admin_wind/views/paginator.html.php. Fixes #1718.
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/controllers/admin_manage_comments.php13
-rw-r--r--modules/comment/views/admin_manage_comments.html.php2
2 files changed, 8 insertions, 7 deletions
diff --git a/modules/comment/controllers/admin_manage_comments.php b/modules/comment/controllers/admin_manage_comments.php
index 9bd1d7f6..effefcbb 100644
--- a/modules/comment/controllers/admin_manage_comments.php
+++ b/modules/comment/controllers/admin_manage_comments.php
@@ -45,6 +45,8 @@ class Admin_Manage_Comments_Controller extends Admin_Controller {
$view = new Admin_View("admin.html");
$view->page_title = t("Manage comments");
+ $view->page_type = "collection";
+ $view->page_subtype = "admin_comments";
$view->content = new View("admin_manage_comments.html");
$view->content->counts = $this->_counts();
$view->content->menu = $this->_menu($view->content->counts);
@@ -56,13 +58,12 @@ class Admin_Manage_Comments_Controller extends Admin_Controller {
->limit(self::$items_per_page)
->offset(($page - 1) * self::$items_per_page)
->find_all();
- $view->content->pager = new Pagination();
- $view->content->pager->initialize(
- array("query_string" => "page",
- "total_items" => $view->content->counts->$state,
- "items_per_page" => self::$items_per_page,
- "style" => "classic"));
+ // Pagination info
+ $view->page = $page;
+ $view->page_size = self::$items_per_page;
+ $view->children_count = $this->_counts()->$state;
+ $view->max_pages = ceil($view->children_count / $view->page_size);
print $view;
}
diff --git a/modules/comment/views/admin_manage_comments.html.php b/modules/comment/views/admin_manage_comments.html.php
index 34a28986..e7a61837 100644
--- a/modules/comment/views/admin_manage_comments.html.php
+++ b/modules/comment/views/admin_manage_comments.html.php
@@ -194,7 +194,7 @@
</table>
<div class="g-paginator">
- <?= $pager ?>
+ <?= $theme->paginator() ?>
</div>
</div>