diff options
author | shadlaws <shad@shadlaws.com> | 2013-01-19 08:40:19 +0100 |
---|---|---|
committer | shadlaws <shad@shadlaws.com> | 2013-01-19 08:40:19 +0100 |
commit | 592eff0e5a8af6f74eff4806dc6e7de56ca02761 (patch) | |
tree | ef6019a8c6452d3b0212e51fe10ec09a07344dc0 /modules/gallery/helpers | |
parent | 93afe52ae16b5f01a1bd9966af061ea0d6224370 (diff) |
#1942 - Make data_rest and file_proxy more consistent - several minor documentation/formatting changes.
No actual functionality changed here.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/data_rest.php | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/modules/gallery/helpers/data_rest.php b/modules/gallery/helpers/data_rest.php index 343975f6..abd4638e 100644 --- a/modules/gallery/helpers/data_rest.php +++ b/modules/gallery/helpers/data_rest.php @@ -32,27 +32,21 @@ class data_rest_Core { throw new Rest_Exception("Bad Request", 400, array("errors" => array("size" => "invalid"))); } - switch ($p->size) { - case "thumb": - $file = $item->thumb_path(); - break; - - case "resize": - $file = $item->resize_path(); - break; + // Note: this code is roughly duplicated in file_proxy, so if you modify this, please look to + // see if you should make the same change there as well. - case "full": + if ($p->size == "full") { $file = $item->file_path(); - break; + } else if ($p->size == "resize") { + $file = $item->resize_path(); + } else { + $file = $item->thumb_path(); } if (!file_exists($file)) { throw new Kohana_404_Exception(); } - // Note: this code is roughly duplicated in data_rest, so if you modify this, please look to - // see if you should make the same change there as well. - // // We don't have a cache buster in the url, so don't set cache headers here. // We don't need to save the session for this request Session::instance()->abort_save(); |