summaryrefslogtreecommitdiff
path: root/modules/comment/controllers
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2010-08-19 23:29:35 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2010-08-19 23:29:35 +0000
commit45b6d344b4a5431e7cf11fde5808c63bf7553676 (patch)
tree33a5bd2ee0124553c4d35f4152e607296479a551 /modules/comment/controllers
parentd1475ec40ebda6404baab45b5b2482c651e657f9 (diff)
parent21a0f832b66eaba902b09e2a88ece52c76e4a0c3 (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/comment/controllers')
-rw-r--r--modules/comment/controllers/admin_manage_comments.php10
-rw-r--r--modules/comment/controllers/comments.php4
2 files changed, 8 insertions, 6 deletions
diff --git a/modules/comment/controllers/admin_manage_comments.php b/modules/comment/controllers/admin_manage_comments.php
index e451791f..0889dc4e 100644
--- a/modules/comment/controllers/admin_manage_comments.php
+++ b/modules/comment/controllers/admin_manage_comments.php
@@ -35,9 +35,9 @@ class Admin_Manage_Comments_Controller extends Admin_Controller {
public function menu_labels() {
$menu = $this->_menu($this->_counts());
json::reply(array((string) $menu->get("unpublished")->label,
- (string) $menu->get("published")->label,
- (string) $menu->get("spam")->label,
- (string) $menu->get("deleted")->label));
+ (string) $menu->get("published")->label,
+ (string) $menu->get("spam")->label,
+ (string) $menu->get("deleted")->label));
}
public function queue($state) {
@@ -51,8 +51,10 @@ class Admin_Manage_Comments_Controller extends Admin_Controller {
$view->content->state = $state;
$view->content->comments = ORM::factory("comment")
->order_by("created", "DESC")
+ ->order_by("id", "DESC")
->where("state", "=", $state)
- ->limit(self::$items_per_page, ($page - 1) * self::$items_per_page)
+ ->limit(self::$items_per_page)
+ ->offset(($page - 1) * self::$items_per_page)
->find_all();
$view->content->pager = new Pagination();
$view->content->pager->initialize(
diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php
index 6ec4132b..ff0e9ce1 100644
--- a/modules/comment/controllers/comments.php
+++ b/modules/comment/controllers/comments.php
@@ -57,8 +57,8 @@ class Comments_Controller extends Controller {
$view->comment = $comment;
json::reply(array("result" => "success",
- "view" => (string)$view,
- "form" => (string)comment::get_add_form($item)));
+ "view" => (string)$view,
+ "form" => (string)comment::get_add_form($item)));
} else {
$form = comment::prefill_add_form($form);
json::reply(array("result" => "error", "form" => (string)$form));