diff options
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/gallery_rss.php | 26 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_theme.php | 4 |
2 files changed, 16 insertions, 14 deletions
diff --git a/modules/gallery/helpers/gallery_rss.php b/modules/gallery/helpers/gallery_rss.php index 6e722ff6..6535d29d 100644 --- a/modules/gallery/helpers/gallery_rss.php +++ b/modules/gallery/helpers/gallery_rss.php @@ -21,24 +21,23 @@ class gallery_rss_Core { static function available_feeds($item) { return array(array("description" => t("New photos or movies"), - "sidebar" => true, + "type" => "block", "uri" => "updates"), array("description" => t("Album feed"), - "sidebar" => false, + "type" => "head", "uri" => "albums")); } 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; } diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index f955e8f7..290434ed 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -42,6 +42,10 @@ class gallery_theme_Core { $buf .= html::script("modules/gallery/js/fullsize.js"); } + if ($theme->item()) { + $buf .= rss::feed_link("albums/{$theme->item()->id}"); + } + if ($session->get("l10n_mode", false)) { $buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/gallery/css/l10n_client.css") . "\" />"; |