aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
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
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')
-rw-r--r--engine/lib/entities.php6
-rw-r--r--engine/lib/group.php2
-rw-r--r--engine/lib/sites.php2
-rw-r--r--engine/lib/users.php2
-rw-r--r--engine/lib/views.php24
5 files changed, 33 insertions, 3 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 7f07f7359..a800817d7 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -1199,6 +1199,9 @@ $time_created_lower = NULL, $time_updated_upper = NULL, $time_updated_lower = NU
function elgg_list_entities(array $options = array(), $getter = 'elgg_get_entities',
$viewer = 'elgg_view_entity_list') {
+ global $autofeed;
+ $autofeed = true;
+
$defaults = array(
'offset' => (int) max(get_input('offset', 0), 0),
'limit' => (int) max(get_input('limit', 10), 0),
@@ -2067,6 +2070,9 @@ function entities_page_handler($page) {
* @since 1.7.0
*/
function elgg_list_registered_entities(array $options = array()) {
+ global $autofeed;
+ $autofeed = true;
+
$defaults = array(
'full_view' => TRUE,
'allowed_types' => TRUE,
diff --git a/engine/lib/group.php b/engine/lib/group.php
index f3314ada6..d78274961 100644
--- a/engine/lib/group.php
+++ b/engine/lib/group.php
@@ -24,7 +24,7 @@ function get_group_entity_as_row($guid) {
}
/**
- * Create or update the extras table for a given group.
+ * Create or update the entities table for a given group.
* Call create_entity first.
*
* @param int $guid GUID
diff --git a/engine/lib/sites.php b/engine/lib/sites.php
index 1df20a5ce..5fed29822 100644
--- a/engine/lib/sites.php
+++ b/engine/lib/sites.php
@@ -40,7 +40,7 @@ function get_site_entity_as_row($guid) {
}
/**
- * Create or update the extras table for a given site.
+ * Create or update the entities table for a given site.
* Call create_entity first.
*
* @param int $guid Site GUID
diff --git a/engine/lib/users.php b/engine/lib/users.php
index ef673cacb..55bacdcb2 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -30,7 +30,7 @@ function get_user_entity_as_row($guid) {
}
/**
- * Create or update the extras table for a given user.
+ * Create or update the entities table for a given user.
* Call create_entity first.
*
* @param int $guid The user's GUID
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