diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-06-09 20:49:32 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-06-09 20:49:32 -0700 |
commit | 3dacafb7182dd915c4c6d4e7d75722976e231465 (patch) | |
tree | c2923fb97d881b9c6087d1a9c4f316eed04514dd /modules/gallery/helpers | |
parent | b40057283e1dfbb3bbb41a6dfc8ccc8e2111d810 (diff) |
Revert the "preserve_ids" global query parameter. We decided that it was a
bad idea.
This reverts commit 6425d41eddd44091b2d83ba3c3734cc6990ca581.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/item_rest.php | 3 | ||||
-rw-r--r-- | modules/gallery/helpers/items_rest.php | 14 |
2 files changed, 7 insertions, 10 deletions
diff --git a/modules/gallery/helpers/item_rest.php b/modules/gallery/helpers/item_rest.php index 1d19d9f1..c88f92d9 100644 --- a/modules/gallery/helpers/item_rest.php +++ b/modules/gallery/helpers/item_rest.php @@ -78,10 +78,9 @@ class item_rest_Core { } $orm->order_by($order_by); - $preserve_ids = isset($p->preserve_ids) ? (bool)$p->preserve_ids : false; $result = array( "url" => $request->url, - "entity" => $item->as_restful_array($preserve_ids), + "entity" => $item->as_restful_array(), "relationships" => rest::relationships("item", $item)); if ($item->is_album()) { $result["members"] = array(); diff --git a/modules/gallery/helpers/items_rest.php b/modules/gallery/helpers/items_rest.php index e9773745..9cca9a54 100644 --- a/modules/gallery/helpers/items_rest.php +++ b/modules/gallery/helpers/items_rest.php @@ -36,8 +36,6 @@ class items_rest_Core { */ static function get($request) { $items = array(); - $preserve_ids = isset($request->params->preserve_ids) ? - (bool)$request->params->preserve_ids : false; if (isset($request->params->urls)) { foreach (json_decode($request->params->urls) as $url) { if (isset($request->params->type)) { @@ -47,10 +45,10 @@ class items_rest_Core { if (access::can("view", $item)) { if (isset($types)) { if (in_array($item->type, $types)) { - $items[] = items_rest::_format_restful_item($item, $preserve_ids); + $items[] = items_rest::_format_restful_item($item); } } else { - $items[] = items_rest::_format_restful_item($item, $preserve_ids); + $items[] = items_rest::_format_restful_item($item); } } } @@ -59,9 +57,9 @@ class items_rest_Core { if (!access::can("view", $item)) { throw new Kohana_404_Exception(); } - $items[] = items_rest::_format_restful_item($item, $preserve_ids); + $items[] = items_rest::_format_restful_item($item); while (($item = $item->parent()) != null) { - array_unshift($items, items_rest::_format_restful_item($item, $preserve_ids)); + array_unshift($items, items_rest::_format_restful_item($item)); }; } @@ -76,9 +74,9 @@ class items_rest_Core { return $item; } - private static function _format_restful_item($item, $preserve_ids) { + private static function _format_restful_item($item) { $item_rest = array("url" => rest::url("item", $item), - "entity" => $item->as_restful_array($preserve_ids), + "entity" => $item->as_restful_array(), "relationships" => rest::relationships("item", $item)); if ($item->type == "album") { $members = array(); |