From b32670f0300b24ad8366d154c3b9a6853f9c710f Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 14 Jun 2009 11:20:08 -0700 Subject: Rename: rss::get_feeds() -> rss::available_feeds() rss::process_feed() -> rss::feed_data() --- modules/rss/helpers/rss_theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/rss/helpers/rss_theme.php') diff --git a/modules/rss/helpers/rss_theme.php b/modules/rss/helpers/rss_theme.php index b82133bd..0f12b475 100644 --- a/modules/rss/helpers/rss_theme.php +++ b/modules/rss/helpers/rss_theme.php @@ -40,7 +40,7 @@ class rss_theme_Core { $block->css_id = "gRss"; $block->title = t("Available RSS Feeds"); $block->content = new View("rss_block.html"); - $block->content->feeds = rss::get_feeds($theme->item()); + $block->content->feeds = rss::available_feeds($theme->item()); return $block; } -- cgit v1.2.3 From 484796e7cc54c3690462ee061850b563c4d5da16 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 14 Jun 2009 11:39:53 -0700 Subject: Remove rss:item_feed, rss::tag_fead and rss_theme::head and move that functionality in the _theme::head function. Created rss::feed_link to wrap the module supplied uri in the html link element. --- modules/gallery/helpers/gallery_theme.php | 4 ++++ modules/rss/helpers/rss.php | 10 +++------- modules/rss/helpers/rss_theme.php | 12 ------------ modules/tag/helpers/tag_theme.php | 6 +++++- 4 files changed, 12 insertions(+), 20 deletions(-) (limited to 'modules/rss/helpers/rss_theme.php') 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 .= ""; diff --git a/modules/rss/helpers/rss.php b/modules/rss/helpers/rss.php index cf42ec28..e4d6f5e9 100644 --- a/modules/rss/helpers/rss.php +++ b/modules/rss/helpers/rss.php @@ -19,13 +19,9 @@ */ class rss_Core { - static function item_feed($item) { - $id = $item->is_album() ? $item->id : $item->parent_id; - return url::site("rss/feed/albums/$id"); - } - - static function tag_feed($tag) { - return url::site("rss/feed/tags/$tag->id}"); + static function feed_link($uri) { + $url = url::site("rss/feed/$uri"); + return ""; } /** diff --git a/modules/rss/helpers/rss_theme.php b/modules/rss/helpers/rss_theme.php index 0f12b475..52d988bf 100644 --- a/modules/rss/helpers/rss_theme.php +++ b/modules/rss/helpers/rss_theme.php @@ -18,18 +18,6 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class rss_theme_Core { - static function head($theme) { - if ($theme->item()) { - $url = rss::item_feed($theme->item()); - } else if ($theme->tag()) { - $url = rss::tag_feed($theme->tag()); - } - - if (!empty($url)) { - return ""; - } - } - static function sidebar_blocks($theme) { // @todo this needs to be data driven if (!$theme->item()) { diff --git a/modules/tag/helpers/tag_theme.php b/modules/tag/helpers/tag_theme.php index a32d71b6..45f55986 100644 --- a/modules/tag/helpers/tag_theme.php +++ b/modules/tag/helpers/tag_theme.php @@ -20,7 +20,11 @@ class tag_theme_Core { static function head($theme) { $url = url::file("modules/tag/js/tag.js"); - return ""; + $head[] = ""; + if ($theme->tag() && module::is_active("rss")) { + $head[] = rss::feed_link("tags/{$theme->tag()->id}"); + } + return implode("\n", $head); } static function sidebar_blocks($theme) { -- cgit v1.2.3