diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2010-01-05 13:41:06 -0800 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-05 13:41:06 -0800 |
| commit | 31454d37b3ea02104925f1976609576c5f09c0c6 (patch) | |
| tree | b32b2c1d79a62a93daebbf7994afeba2c8fdf2a2 /modules/gallery/helpers | |
| parent | d18be7fe550e1233e7a19184529f1b87a6249343 (diff) | |
Improve REST tag support.
- Add support for retrieving a list of members from a collection
- Implement put(), post() and delete() for tags.
- Use tag_rest::delete() as a way to remove members from the tag collection
Diffstat (limited to 'modules/gallery/helpers')
| -rw-r--r-- | modules/gallery/helpers/gallery_rest.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/gallery/helpers/gallery_rest.php b/modules/gallery/helpers/gallery_rest.php index 858721d0..c7b32d8c 100644 --- a/modules/gallery/helpers/gallery_rest.php +++ b/modules/gallery/helpers/gallery_rest.php @@ -40,7 +40,12 @@ class gallery_rest_Core { $item = rest::resolve($request->url); access::required("view", $item); - return rest::reply($item->as_array()); + $children = array(); + foreach ($item->children() as $child) { + $children[] = url::abs_site("rest/gallery/" . $child->relative_url()); + } + + return rest::reply(array("resource" => $item->as_array(), "members" => $children)); } static function put($request) { |
