]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3114 added the rss link back to pages
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 20 Mar 2011 20:50:00 +0000 (20:50 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 20 Mar 2011 20:50:00 +0000 (20:50 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8784 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/entities.php
engine/lib/group.php
engine/lib/sites.php
engine/lib/users.php
engine/lib/views.php
views/default/page/elements/sidebar.php

index 7f07f7359e90c62797cbdefa958a706d611583f4..a800817d760e171565743c55cab6f335a802853b 100644 (file)
@@ -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,
index f3314ada64e94aa6173b508482fe6ed8cd455c03..d7827496103d2419c7a4899a4596039a8dce405e 100644 (file)
@@ -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
index 1df20a5cef1211f53cbda0375b70c367070149f9..5fed298228e2d5366ebb44847022f73ad8b3a184 100644 (file)
@@ -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
index ef673cacb40e1a897fd8caabea12d10905dc4d9b..55bacdcb2a3a15d6429c8dd0d416008bb3db5d82 100644 (file)
@@ -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
index 460b2c8b5e18c50fd582352640b2619ad55bb3e0..e74a286da533486ef293e25e188815f9a0e05966 100644 (file)
@@ -1478,6 +1478,29 @@ function elgg_views_register_core_head_elements() {
        elgg_load_css('elgg');
 }
 
+/**
+ * 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
index 6d40daf20d8189fb9063c2be72a8fdf2d7e62259..e1d25eed5d12dabdfa4b8bcd07b56fd51f63a149 100644 (file)
@@ -5,7 +5,10 @@
  * @uses $vars['sidebar'] Optional content that is displayed at the bottom of sidebar
  */
 
-echo elgg_view_menu('extras', array('sort_by' => 'name'));
+echo elgg_view_menu('extras', array(
+       'sort_by' => 'name',
+       'class' => 'elgg-menu-hz',
+));
 
 echo elgg_view('page/elements/owner_block', $vars);