From 897215689c3b85e6df9085291b3a5b60b7e69b08 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 14 Feb 2010 07:32:35 -0800 Subject: Remove the dirty flags from the information returned from the rest request for an item. In addition, add links to the images. --- modules/gallery/models/item.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index dbd56fa2..283654c7 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -930,8 +930,18 @@ class Item_Model extends ORM_MPTT { } unset($data["album_cover_item_id"]); + if (access::can("view_fillsize", $this) && $this->is_photo()) { + $data["fullsize_url"] = $this->abs_url(); + } + + if ($tmp = $this->resize_url() && $this->is_photo()) { + $data["resize_url"] = $tmp; + } + $data["thumb_url"] = $this->thumb_url(); + // Elide some internal-only data that is going to cause confusion in the client. - foreach (array("relative_path_cache", "relative_url_cache", "left_ptr", "right_ptr") as $key) { + foreach (array("relative_path_cache", "relative_url_cache", "left_ptr", "right_ptr", + "thumb_dirty", "resize_dirty") as $key) { unset($data[$key]); } return $data; -- cgit v1.2.3