diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-09 08:41:38 -0800 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-09 08:41:38 -0800 |
| commit | 367f2218f6bc278a7d0bd870e03a5d631155871a (patch) | |
| tree | f5a8d428ca8c736b9b25273ee043e2e57536ac22 /modules/gallery/helpers | |
| parent | 3c30d595ae6a9a82e06f5427150d3667f00ef695 (diff) | |
Use the relative url cache to look up resources instead of the relative path. This allows us to forego the extension as part of the REST url. As well, urls are consistent between normal usage and rest usage.
Diffstat (limited to 'modules/gallery/helpers')
| -rw-r--r-- | modules/gallery/helpers/gallery_rest.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/gallery/helpers/gallery_rest.php b/modules/gallery/helpers/gallery_rest.php index dba109fd..043e17b5 100644 --- a/modules/gallery/helpers/gallery_rest.php +++ b/modules/gallery/helpers/gallery_rest.php @@ -24,7 +24,7 @@ class gallery_rest_Core { } $item = ORM::factory("item") - ->where("relative_path_cache", $request->path) + ->where("relative_url_cache", $request->path) ->viewable() ->find(); @@ -32,7 +32,7 @@ class gallery_rest_Core { return rest::not_found("Resource: {$request->path} missing."); } - $response_data = array("path" => $item->relative_path(), + $response_data = array("path" => $item->relative_url(), "title" => $item->title, "thumb_url" => $item->thumb_url(), "url" => $item->abs_url(), @@ -54,7 +54,7 @@ class gallery_rest_Core { foreach ($item->viewable()->children($limit, $offset, $where) as $child) { $children[] = array("type" => $child->type, "has_children" => $child->children_count() > 0, - "path" => $child->relative_path(), + "path" => $child->relative_url(), "title" => $child->title); } |
