From 5679e30ef6c68272cce295bd593bc23c9ec1e1b3 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 4 Apr 2010 11:55:54 -0700 Subject: REST changes: Allow PUT and POST requests to modify members, not just entity. TESTS ARE NOT UPDATED YET. - Fix item_rest::get() to maintain the proper sort order, which requires duplicating some Item_Model code. - Elide "weight" from the REST version of item - Adjust the weight of members according to the order they're returned from the client. You can't add or remove members here, you can only reorder them. - Changed the wire protocol to handle more complex values. Now "entity" and "members" are JSON encoded. The Gallery3 helper does this correctly. - Changed the wire protocol for tag_item -- now it stores the tag and item urls in the entity, not as members. This is more consistent. - Added missing security for renaming and deleting tags. - Got rid of vestigial tag_rest::post(). We add/remove tags via the relationship. --- modules/gallery/models/item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery/models') diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 6ede5109..4a87a2ab 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -941,7 +941,7 @@ class Item_Model extends ORM_MPTT { // Elide some internal-only data that is going to cause confusion in the client. foreach (array("relative_path_cache", "relative_url_cache", "left_ptr", "right_ptr", - "thumb_dirty", "resize_dirty") as $key) { + "thumb_dirty", "resize_dirty", "weight") as $key) { unset($data[$key]); } return $data; -- cgit v1.2.3