mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-02 05:01:04 -04:00
1) Removed the published boolean database field
2) Replaced it with a string field (state) which contains the state of the comment. i.e. published, unpublished, spam. Unsure if we want to create constants in comments.php to standardize the valid values... thoughts? 3) synchronized the spamfilter and comment unit tests with the current functionality
This commit is contained in:
@@ -30,7 +30,7 @@ class Comments_Controller extends REST_Controller {
|
||||
|
||||
$comments = ORM::factory("comment")
|
||||
->where("item_id", $item->id)
|
||||
->where("published", 1)
|
||||
->where("state", "published")
|
||||
->orderby("created", "desc")
|
||||
->find_all();
|
||||
|
||||
@@ -68,7 +68,8 @@ class Comments_Controller extends REST_Controller {
|
||||
|
||||
print json_encode(
|
||||
array("result" => "success",
|
||||
"resource" => $comment->published ? url::site("comments/{$comment->id}") : NULL,
|
||||
"resource" => $comment->state == "published" ? url::site("comments/{$comment->id}") :
|
||||
NULL,
|
||||
"form" => comment::get_add_form($item)->__toString()));
|
||||
} else {
|
||||
print json_encode(
|
||||
|
||||
Reference in New Issue
Block a user