From 14f6e5f6d3933b958fa61b83c627412282610dee Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 8 Jan 2010 11:12:02 -0800 Subject: Allow the "name" param in get() so that you can restrict the query to children with a given name. --- modules/gallery/helpers/gallery_rest.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery_rest.php b/modules/gallery/helpers/gallery_rest.php index c7b32d8c..fd18d59a 100644 --- a/modules/gallery/helpers/gallery_rest.php +++ b/modules/gallery/helpers/gallery_rest.php @@ -40,8 +40,14 @@ class gallery_rest_Core { $item = rest::resolve($request->url); access::required("view", $item); + if (isset($request->params->name)) { + $where[] = array("name", "=", $request->params->name); + } else { + $where = array(); + } + $children = array(); - foreach ($item->children() as $child) { + foreach ($item->children($where) as $child) { $children[] = url::abs_site("rest/gallery/" . $child->relative_url()); } -- cgit v1.2.3