summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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());
}