summaryrefslogtreecommitdiff
path: root/modules/rss/helpers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-06-15 02:39:53 +0800
committer <unostar@danalan.info>2009-06-15 04:26:01 +0800
commitfdbffc870d84ec035068420f5a8b4292d7aade13 (patch)
tree8976399ba14ce71b80682390c8e3574e3167dca1 /modules/rss/helpers
parent879e81f0a1fc4477a8e563d45348330706b6da8a (diff)
Remove rss:item_feed, rss::tag_fead and rss_theme::head and move that
functionality in the <module_name>_theme::head function. Created rss::feed_link to wrap the module supplied uri in the html link element. Signed-off-by: <unostar@danalan.info>
Diffstat (limited to 'modules/rss/helpers')
-rw-r--r--modules/rss/helpers/rss.php10
-rw-r--r--modules/rss/helpers/rss_theme.php12
2 files changed, 3 insertions, 19 deletions
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 "<link rel=\"alternate\" type=\"" . rest::RSS . "\" href=\"$url\" />";
}
/**
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 "<link rel=\"alternate\" type=\"" . rest::RSS . "\" href=\"$url\" />";
- }
- }
-
static function sidebar_blocks($theme) {
// @todo this needs to be data driven
if (!$theme->item()) {