summaryrefslogtreecommitdiff
path: root/modules/rest/controllers/rest.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-04-04 11:55:54 -0700
committerBharat Mediratta <bharat@menalto.com>2010-04-04 11:55:54 -0700
commit5679e30ef6c68272cce295bd593bc23c9ec1e1b3 (patch)
tree8c2b5f9ed61aca0b2ad16478b9ee605a9398757d /modules/rest/controllers/rest.php
parent4e450b5a9664d2a24b74050f7b410cd581fc41cb (diff)
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.
Diffstat (limited to 'modules/rest/controllers/rest.php')
-rw-r--r--modules/rest/controllers/rest.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/rest/controllers/rest.php b/modules/rest/controllers/rest.php
index 29334cea..dab54976 100644
--- a/modules/rest/controllers/rest.php
+++ b/modules/rest/controllers/rest.php
@@ -54,6 +54,13 @@ class Rest_Controller extends Controller {
break;
}
+ if (isset($request->params->entity)) {
+ $request->params->entity = json_decode($request->params->entity);
+ }
+ if (isset($request->params->members)) {
+ $request->params->members = json_decode($request->params->members);
+ }
+
$request->method = strtolower($input->server("HTTP_X_GALLERY_REQUEST_METHOD", $method));
$request->access_key = $input->server("HTTP_X_GALLERY_REQUEST_KEY");
$request->url = url::abs_current(true);