aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/views.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-20 20:50:00 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-20 20:50:00 +0000
commit21f41d24e2fad631499ab80950e4d9a1e22bcca0 (patch)
treefd4897bf93bae387c5b30a84829468b3659e687b /engine/lib/views.php
parent07125786f7d6fbe1b394141a2cdd983af7092f12 (diff)
downloadelgg-21f41d24e2fad631499ab80950e4d9a1e22bcca0.tar.gz
elgg-21f41d24e2fad631499ab80950e4d9a1e22bcca0.tar.bz2
Fixes #3114 added the rss link back to pages
git-svn-id: http://code.elgg.org/elgg/trunk@8784 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/views.php')
-rw-r--r--engine/lib/views.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/engine/lib/views.php b/engine/lib/views.php
index 460b2c8b5..e74a286da 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -1479,6 +1479,29 @@ function elgg_views_register_core_head_elements() {
}
/**
+ * Add the rss link to the extras when if needed
+ */
+function elgg_views_add_rss_link() {
+ global $autofeed;
+ if (isset($autofeed) && $autofeed == true) {
+ $url = full_url();
+ if (substr_count($url,'?')) {
+ $url .= "&view=rss";
+ } else {
+ $url .= "?view=rss";
+ }
+
+ $url = elgg_format_url($url);
+ elgg_register_menu_item('extras', array(
+ 'name' => 'rss',
+ 'text' => elgg_view_icon('rss'),
+ 'href' => $url,
+ 'title' => elgg_echo('feed:rss'),
+ ));
+ }
+}
+
+/**
* Initialize viewtypes on system boot event
* This ensures simplecache is cleared during upgrades. See #2252
*
@@ -1502,6 +1525,7 @@ function elgg_views_boot() {
elgg_load_js('jquery.form');
elgg_register_event_handler('ready', 'system', 'elgg_views_register_core_head_elements');
+ elgg_register_event_handler('pagesetup', 'system', 'elgg_views_add_rss_link');
// discover the built-in view types
// @todo the cache is loaded in load_plugins() but we need to know view_types earlier