diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-06-15 03:38:57 +0800 |
---|---|---|
committer | <unostar@danalan.info> | 2009-06-15 04:26:07 +0800 |
commit | 83d1b15c1e9ca89cc55879a5582cd9abafc5a792 (patch) | |
tree | 6f19eb5e1a3471d0d9b93d5b61668ce770eafe03 /modules/gallery/helpers | |
parent | 6007843c4acf3a83580989351de73ae64a2e61ed (diff) |
Don't use stdClass to return the feed data. Just use an array.
Signed-off-by: <unostar@danalan.info>
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/gallery_rss.php | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/modules/gallery/helpers/gallery_rss.php b/modules/gallery/helpers/gallery_rss.php index 455e210f..6535d29d 100644 --- a/modules/gallery/helpers/gallery_rss.php +++ b/modules/gallery/helpers/gallery_rss.php @@ -29,16 +29,15 @@ class gallery_rss_Core { } static function updates($offset, $limit) { - $feed = new stdClass(); - $feed->data["children"] = ORM::factory("item") + $feed["children"] = ORM::factory("item") ->viewable() ->where("type !=", "album") ->orderby("created", "DESC") ->find_all($limit, $offset); - $feed->max_pages = ceil($feed->data["children"]->count() / $limit); - $feed->data["title"] = t("Recent Updates"); - $feed->data["link"] = url::abs_site("albums/1"); - $feed->data["description"] = t("Recent Updates"); + $feed["max_pages"] = ceil($feed["children"]->count() / $limit); + $feed["title"] = t("Recent Updates"); + $feed["link"] = url::abs_site("albums/1"); + $feed["description"] = t("Recent Updates"); return $feed; } @@ -47,14 +46,13 @@ class gallery_rss_Core { $item = ORM::factory("item", $id); access::required("view", $item); - $feed = new stdClass(); - $feed->data["children"] = $item + $feed["children"] = $item ->viewable() ->descendants($limit, $offset, "photo"); - $feed->max_pages = ceil($item->viewable()->descendants_count("photo") / $limit); - $feed->data["title"] = $item->title; - $feed->data["link"] = url::abs_site("albums/{$item->id}"); - $feed->data["description"] = $item->description; + $feed["max_pages"] = ceil($item->viewable()->descendants_count("photo") / $limit); + $feed["title"] = $item->title; + $feed["link"] = url::abs_site("albums/{$item->id}"); + $feed["description"] = $item->description; return $feed; } |