summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-01-08 11:12:02 -0800
committerBharat Mediratta <bharat@menalto.com>2010-01-08 11:12:02 -0800
commit14f6e5f6d3933b958fa61b83c627412282610dee (patch)
treee975b6521cdaba545d9d69af1eb12f0faccd25f5 /modules
parentd43badb4ecac092c897cb52cc54696d1489bc2e0 (diff)
Allow the "name" param in get() so that you can restrict the query to children with a given name.
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/helpers/gallery_rest.php8
1 files changed, 7 insertions, 1 deletions
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());
}