Просмотр исходного кода

Ticket #5273 - Get rid of duplicates in code.

AntonLV 11 месяцев назад
Родитель
Сommit
687cc82873

+ 46 - 26
modules/base/groups/classes/BxBaseModGroupsSearchResult.php

@@ -109,15 +109,14 @@ class BxBaseModGroupsSearchResult extends BxBaseModProfileSearchResult
     {
         $CNF = &$this->oModule->_oConfig->CNF;
 
-        $oProfileAuthor = BxDolProfile::getInstance((int)$aParams['author']);
-        if (!$oProfileAuthor) 
-            return false;
+        if(!($oProfileAuthor = BxDolProfile::getInstance((int)$aParams['author']))) 
+            return !($this->isError = true);
 
         $iProfileAuthor = $oProfileAuthor->id();
         $this->aCurrent['restriction']['owner']['value'] = $iProfileAuthor;
 
         if(!empty($aParams['per_page']))
-        	$this->aCurrent['paginate']['perPage'] = is_numeric($aParams['per_page']) ? (int)$aParams['per_page'] : (int)getParam($aParams['per_page']);
+            $this->aCurrent['paginate']['perPage'] = is_numeric($aParams['per_page']) ? (int)$aParams['per_page'] : (int)getParam($aParams['per_page']);
 
         $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_JOINED_ENTRIES'] . '&profile_id={profile_id}';
         $this->aCurrent['title'] = _t($CNF['T']['txt_all_entries_by_author']);
@@ -130,9 +129,8 @@ class BxBaseModGroupsSearchResult extends BxBaseModProfileSearchResult
     {
         $CNF = &$this->oModule->_oConfig->CNF;
 
-        $oProfileAuthor = BxDolProfile::getInstance((int)$aParams['user']);
-        if (!$oProfileAuthor) 
-            return false;
+        if(!($oProfileAuthor = BxDolProfile::getInstance((int)$aParams['user']))) 
+            return !($this->isError = true);
 
         $iListId = 0;
         if(isset($aParams['list_id']))
@@ -141,16 +139,16 @@ class BxBaseModGroupsSearchResult extends BxBaseModProfileSearchResult
         $iProfileAuthor = $oProfileAuthor->id();
         $oFavorite = $this->oModule->getObjectFavorite();
         if(!$oFavorite || (!$oFavorite->isPublic() && $iProfileAuthor != bx_get_logged_profile_id())) 
-            return false;
+            return !($this->isError = true);
 
         $aConditions = $oFavorite->getConditionsTrack($CNF['TABLE_ENTRIES'], 'id', $iProfileAuthor, $iListId);
         if(!empty($aConditions) && is_array($aConditions)) {
             if(empty($this->aCurrent['restriction']) || !is_array($this->aCurrent['restriction']))
-                $this->aCurrent['restriction'] = array();
+                $this->aCurrent['restriction'] = [];
             $this->aCurrent['restriction'] = array_merge($this->aCurrent['restriction'], $aConditions['restriction']);
 
             if(empty($this->aCurrent['join']) || !is_array($this->aCurrent['join']))
-                $this->aCurrent['join'] = array();
+                $this->aCurrent['join'] = [];
             $this->aCurrent['join'] = array_merge($this->aCurrent['join'], $aConditions['join']);
         }
 
@@ -165,25 +163,24 @@ class BxBaseModGroupsSearchResult extends BxBaseModProfileSearchResult
     {
         $CNF = &$this->oModule->_oConfig->CNF;
 
-        $oJoinedProfile = BxDolProfile::getInstance((int)$aParams['joined_profile']);
-        if (!$oJoinedProfile)
-            return false;
+        if(!($oJoinedProfile = BxDolProfile::getInstance((int)$aParams['joined_profile'])))
+            return !($this->isError = true);
 
-        $bProcessConditionsForPrivateContent = false;
+        $sDbPrefix = $this->oModule->_oConfig->getDbPrefix();
 
-        $this->aCurrent['join']['fans'] = array(
+        $this->aCurrent['join']['fans'] = [
             'type' => 'INNER',
-            'table' => 'bx_groups_fans',
+            'table' => $sDbPrefix . 'fans',
             'mainField' => 'id',
             'onField' => 'content',
-            'joinFields' => array('initiator'),
-        );
+            'joinFields' => ['initiator'],
+        ];
 
-        $this->aCurrent['restriction']['fans'] = array('value' => $oJoinedProfile->id(), 'field' => 'initiator', 'operator' => '=', 'table' => 'bx_groups_fans');
+        $this->aCurrent['restriction']['fans'] = ['value' => $oJoinedProfile->id(), 'field' => 'initiator', 'operator' => '=', 'table' => $sDbPrefix . 'fans'];
 
         $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_JOINED_ENTRIES'] . '&profile_id={profile_id}';
         $this->aCurrent['title'] = ($sKey = 'txt_joined_entries') && !empty($CNF['T'][$sKey]) ? _t($CNF['T'][$sKey]) : '';
-        $this->aCurrent['rss']['link'] = 'modules/?r=groups/rss/' . $sMode . '/' . $oJoinedProfile->id();
+        $this->aCurrent['rss']['link'] = 'modules/?r=' . $this->oModule->_oConfig->getUri() . '/rss/' . $sMode . '/' . $oJoinedProfile->id();
 
         return true;
     }
@@ -191,18 +188,17 @@ class BxBaseModGroupsSearchResult extends BxBaseModProfileSearchResult
     protected function _updateCurrentForContext($sMode, $aParams, &$oProfileContext)
     {
         $CNF = &$this->oModule->_oConfig->CNF;
-        
-        $oProfileContext = BxDolProfile::getInstance((int)$aParams['context']);
-        if (!$oProfileContext) 
-            return false;
+
+        if(!($oProfileContext = BxDolProfile::getInstance((int)$aParams['context'])))
+            return !($this->isError = true);
 
         $iProfileIdContext = $oProfileContext->id();
-        $this->aCurrent['restriction']['context'] = array(
+        $this->aCurrent['restriction']['context'] = [
             'value' => -$iProfileIdContext,
             'field' => $CNF['FIELD_ALLOW_VIEW_TO'],
             'operator' => '=',
             'table' => $CNF['TABLE_ENTRIES']
-        );
+        ];
 
         if(!empty($aParams['per_page']))
             $this->aCurrent['paginate']['perPage'] = is_numeric($aParams['per_page']) ? (int)$aParams['per_page'] : (int)getParam($aParams['per_page']);
@@ -213,6 +209,30 @@ class BxBaseModGroupsSearchResult extends BxBaseModProfileSearchResult
 
         return true;
     }
+    
+    protected function _updateCurrentForFollowedEntries($sMode, $aParams, &$oJoinedProfile)
+    {
+        $CNF = &$this->oModule->_oConfig->CNF;
+
+        if(!($oJoinedProfile = BxDolProfile::getInstance((int)$aParams['followed_profile'])))
+            return !($this->isError = true);
+
+        $this->aCurrent['join']['followed'] = [
+            'type' => 'INNER',
+            'table' => 'sys_profiles_conn_subscriptions',
+            'mainField' => 'id',
+            'onField' => 'content',
+            'joinFields' => ['initiator'],
+        ];
+
+        $this->aCurrent['restriction']['followed'] = ['value' => $oJoinedProfile->id(), 'field' => 'initiator', 'operator' => '=', 'table' => 'sys_profiles_conn_subscriptions'];
+
+        $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_FOLLOWED_ENTRIES'] . '&profile_id={profile_id}';
+        $this->aCurrent['title'] = ($sKey = 'txt_followed_entries') && !empty($CNF['T'][$sKey]) ? _t($CNF['T'][$sKey]) : '';
+        $this->aCurrent['rss']['link'] = 'modules/?r=' . $this->oModule->_oConfig->getUri() . '/rss/' . $sMode . '/' . $oJoinedProfile->id();
+
+        return true;
+    }
 }
 
 /** @} */

+ 1 - 1
modules/base/text/classes/BxBaseModTextTemplate.php

@@ -636,7 +636,7 @@ class BxBaseModTextTemplate extends BxBaseModGeneralTemplate
         $bBadgesSingle = isset($aParams['badges_single']) ? $aParams['badges_single'] : false;
         $bBadgesCompact = isset($aParams['badges_compact']) ? $aParams['badges_compact'] : false;
 
-        $sCoverData = $aData[$CNF['FIELD_THUMB_POSITION']] ?? '';
+        $sCoverData = ($sKey = 'FIELD_THUMB_POSITION') && isset($CNF[$sKey]) && $aData[$CNF[$sKey]] ?? '';
         $sCoverSettings = $this->_getImageSettings($CNF['FIELD_THUMB'], $sCoverData, 'unit_cover');
 
         $aTmplVars = array (

+ 11 - 27
modules/boonex/courses/classes/BxCoursesSearchResult.php

@@ -80,42 +80,29 @@ class BxCoursesSearchResult extends BxBaseModGroupsSearchResult
         $bProcessConditionsForPrivateContent = true;
         switch ($sMode) {
             case 'created_entries':
-                if(!$this->_setAuthorConditions($sMode, $aParams, $oJoinedProfile)) {
-                    $this->isError = true;
-                    break;
-                }
+                $this->_setAuthorConditions($sMode, $aParams, $oJoinedProfile);
                 break;
 
             case 'context':
                 $oProfileAuthor = null;
                 if(!$this->_updateCurrentForContext($sMode, $aParams, $oProfileAuthor))
-                    $this->isError = true;
+                    break;
+                        
+                if(!$this->aCurrent['title'])
+                    $this->aCurrent['title'] = _t('_bx_courses_page_title_browse_by_context');
                 break;
 
             case 'joined_entries':
-                $oJoinedProfile = BxDolProfile::getInstance((int)$aParams['joined_profile']);
-                if (!$oJoinedProfile) {
-                    $this->isError = true;
+                $oJoinedProfile = null;
+                if(!$this->_updateCurrentForJoinedEntries($sMode, $aParams, $oJoinedProfile))
                     break;
-                }
 
                 $bProcessConditionsForPrivateContent = false;
 
-                $this->aCurrent['join']['fans'] = array(
-                    'type' => 'INNER',
-                    'table' => 'bx_courses_fans',
-                    'mainField' => 'id',
-                    'onField' => 'content',
-                    'joinFields' => array('initiator'),
-                );
-
-                $this->aCurrent['restriction']['fans'] = array('value' => $oJoinedProfile->id(), 'field' => 'initiator', 'operator' => '=', 'table' => 'bx_courses_fans');
-
-                $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_JOINED_ENTRIES'] . '&profile_id={profile_id}';
-                $this->aCurrent['title'] = _t('_bx_courses_page_title_joined_entries');
-                $this->aCurrent['rss']['link'] = 'modules/?r=courses/rss/' . $sMode . '/' . $oJoinedProfile->id();
+                if(!$this->aCurrent['title'])
+                    $this->aCurrent['title'] = _t('_bx_courses_page_title_joined_entries');
                 break;
-
+  
             case 'connections':
                 if ($this->_setConnectionsConditions($aParams)) {
                     $bProcessConditionsForPrivateContent = false;
@@ -132,10 +119,7 @@ class BxCoursesSearchResult extends BxBaseModGroupsSearchResult
                 break;
 
             case 'favorite':
-                if(!$this->_setFavoriteConditions($sMode, $aParams, $oJoinedProfile)) {
-                    $this->isError = true;
-                    break;
-                }
+                $this->_setFavoriteConditions($sMode, $aParams, $oJoinedProfile);
                 break;
 
             case 'recent':

+ 15 - 44
modules/boonex/events/classes/BxEventsSearchResult.php

@@ -167,64 +167,38 @@ class BxEventsSearchResult extends BxBaseModGroupsSearchResult
 
         switch ($sMode) {
             case 'created_entries':
-                if(!$this->_setAuthorConditions($sMode, $aParams, $oJoinedProfile)) {
-                    $this->isError = true;
-                    break;
-                }
+                $this->_setAuthorConditions($sMode, $aParams, $oJoinedProfile);
                 break;
 
             case 'context':
                 $oProfileAuthor = null;
                 if(!$this->_updateCurrentForContext($sMode, $aParams, $oProfileAuthor))
-                    $this->isError = true;
+                    break;
+
+                if(!$this->aCurrent['title'])
+                    $this->aCurrent['title'] = _t('_bx_events_page_title_browse_by_context');
                 break;
 
             case 'joined_entries':
-                $oJoinedProfile = BxDolProfile::getInstance((int)$aParams['joined_profile']);
-                if (!$oJoinedProfile) {
-                    $this->isError = true;
+                $oJoinedProfile = null;
+                if(!$this->_updateCurrentForJoinedEntries($sMode, $aParams, $oJoinedProfile))
                     break;
-                }
 
                 $bProcessConditionsForPrivateContent = false;
 
-                $this->aCurrent['join']['fans'] = array(
-                    'type' => 'INNER',
-                    'table' => 'bx_events_fans',
-                    'mainField' => 'id',
-                    'onField' => 'content',
-                    'joinFields' => array('initiator'),
-                );
-
-                $this->aCurrent['restriction']['fans'] = array('value' => $oJoinedProfile->id(), 'field' => 'initiator', 'operator' => '=', 'table' => 'bx_events_fans');
-
-                $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_JOINED_ENTRIES'] . '&profile_id={profile_id}';
-                $this->aCurrent['title'] = _t('_bx_events_page_title_joined_entries');
-                $this->aCurrent['rss']['link'] = 'modules/?r=events/rss/' . $sMode . '/' . $oJoinedProfile->id();
+                if(!$this->aCurrent['title'])
+                    $this->aCurrent['title'] = _t('_bx_events_page_title_joined_entries');
                 break;
-                
+
             case 'followed_entries':
-                $oJoinedProfile = BxDolProfile::getInstance((int)$aParams['followed_profile']);
-                if (!$oJoinedProfile) {
-                    $this->isError = true;
+                $oJoinedProfile = null;
+                if(!$this->_updateCurrentForFollowedEntries($sMode, $aParams, $oJoinedProfile))
                     break;
-                }
 
                 $bProcessConditionsForPrivateContent = false;
 
-                $this->aCurrent['join']['followed'] = array(
-                    'type' => 'INNER',
-                    'table' => 'sys_profiles_conn_subscriptions',
-                    'mainField' => 'id',
-                    'onField' => 'content',
-                    'joinFields' => array('initiator'),
-                );
-
-                $this->aCurrent['restriction']['followed'] = array('value' => $oJoinedProfile->id(), 'field' => 'initiator', 'operator' => '=', 'table' => 'sys_profiles_conn_subscriptions');
-
-                $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_FOLLOWED_ENTRIES'] . '&profile_id={profile_id}';
-                $this->aCurrent['title'] = _t('_bx_events_page_title_followed_entries');
-                $this->aCurrent['rss']['link'] = 'modules/?r=events/rss/' . $sMode . '/' . $oJoinedProfile->id();
+                if(!$this->aCurrent['title'])
+                    $this->aCurrent['title'] = _t('_bx_events_page_title_followed_entries');
                 break;
 
             case 'connections':
@@ -243,10 +217,7 @@ class BxEventsSearchResult extends BxBaseModGroupsSearchResult
                 break;
 
             case 'favorite':
-                if(!$this->_setFavoriteConditions($sMode, $aParams, $oJoinedProfile)) {
-                    $this->isError = true;
-                    break;
-                }
+                $this->_setFavoriteConditions($sMode, $aParams, $oJoinedProfile);
                 break;
 
             case 'recent':

+ 18 - 28
modules/boonex/groups/classes/BxGroupsSearchResult.php

@@ -80,20 +80,24 @@ class BxGroupsSearchResult extends BxBaseModGroupsSearchResult
         $bProcessConditionsForPrivateContent = true;
         switch ($sMode) {
             case 'created_entries':
-                if(!$this->_setAuthorConditions($sMode, $aParams, $oJoinedProfile))
-                    $this->isError = true;
+                $this->_setAuthorConditions($sMode, $aParams, $oJoinedProfile);
                 break;
 
             case 'context':
                 $oProfileContext = null;
                 if(!$this->_updateCurrentForContext($sMode, $aParams, $oProfileContext))
-                    $this->isError = true;
+                    break;
+                
+                if(!$this->aCurrent['title'])
+                    $this->aCurrent['title'] = _t('_bx_groups_page_title_browse_by_context');
                 break;
 
             case 'joined_entries':
                 $oJoinedProfile = null;
                 if(!$this->_updateCurrentForJoinedEntries($sMode, $aParams, $oJoinedProfile))
-                    $this->isError = true;
+                    break;
+
+                $bProcessConditionsForPrivateContent = false;
 
                 if(!$this->aCurrent['title'])
                     $this->aCurrent['title'] = _t('_bx_groups_page_title_joined_entries');
@@ -102,11 +106,13 @@ class BxGroupsSearchResult extends BxBaseModGroupsSearchResult
             case 'context_joined_entries':
                 $oProfileContext = null;
                 if(!$this->_updateCurrentForContext('context', $aParams, $oProfileContext))
-                    $this->isError = true;
-                
+                    break;
+
                 $oJoinedProfile = null;
                 if(!$this->_updateCurrentForJoinedEntries('joined_entries', $aParams, $oJoinedProfile))
-                    $this->isError = true;
+                    break;
+
+                $bProcessConditionsForPrivateContent = false;
 
                 $this->sBrowseUrl = '';
                 $this->aCurrent['title'] = '';
@@ -114,27 +120,14 @@ class BxGroupsSearchResult extends BxBaseModGroupsSearchResult
                 break;
 
             case 'followed_entries':
-                $oJoinedProfile = BxDolProfile::getInstance((int)$aParams['followed_profile']);
-                if (!$oJoinedProfile) {
-                    $this->isError = true;
+                $oJoinedProfile = null;
+                if(!$this->_updateCurrentForFollowedEntries($sMode, $aParams, $oJoinedProfile))
                     break;
-                }
 
                 $bProcessConditionsForPrivateContent = false;
 
-                $this->aCurrent['join']['followed'] = array(
-                    'type' => 'INNER',
-                    'table' => 'sys_profiles_conn_subscriptions',
-                    'mainField' => 'id',
-                    'onField' => 'content',
-                    'joinFields' => array('initiator'),
-                );
-
-                $this->aCurrent['restriction']['followed'] = array('value' => $oJoinedProfile->id(), 'field' => 'initiator', 'operator' => '=', 'table' => 'sys_profiles_conn_subscriptions');
-
-                $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_FOLLOWED_ENTRIES'] . '&profile_id={profile_id}';
-                $this->aCurrent['title'] = _t('_bx_groups_page_title_followed_entries');
-                $this->aCurrent['rss']['link'] = 'modules/?r=groups/rss/' . $sMode . '/' . $oJoinedProfile->id();
+                if(!$this->aCurrent['title'])
+                    $this->aCurrent['title'] = _t('_bx_groups_page_title_followed_entries');
                 break;
 
             case 'connections':
@@ -153,10 +146,7 @@ class BxGroupsSearchResult extends BxBaseModGroupsSearchResult
                 break;
 
             case 'favorite':
-                if(!$this->_setFavoriteConditions($sMode, $aParams, $oJoinedProfile)) {
-                    $this->isError = true;
-                    break;
-                }
+                $this->_setFavoriteConditions($sMode, $aParams, $oJoinedProfile);
                 break;
 
             case 'recent':

+ 15 - 43
modules/boonex/jobs/classes/BxJobsSearchResult.php

@@ -80,63 +80,38 @@ class BxJobsSearchResult extends BxBaseModGroupsSearchResult
         $bProcessConditionsForPrivateContent = true;
         switch ($sMode) {
             case 'created_entries':
-                if(!$this->_setAuthorConditions($sMode, $aParams, $oJoinedProfile))
-                    $this->isError = true;
+                $this->_setAuthorConditions($sMode, $aParams, $oJoinedProfile);
                 break;
 
             case 'context':
                 $oProfileContext = null;
                 if(!$this->_updateCurrentForContext($sMode, $aParams, $oProfileContext))
-                    $this->isError = true;
+                    break;
+                
+                if(!$this->aCurrent['title'])
+                    $this->aCurrent['title'] = _t('_bx_jobs_page_title_browse_by_context');
                 break;
 
             case 'joined_entries':
-                $oJoinedProfile = BxDolProfile::getInstance((int)$aParams['joined_profile']);
-                if (!$oJoinedProfile) {
-                    $this->isError = true;
+                $oJoinedProfile = null;
+                if(!$this->_updateCurrentForJoinedEntries($sMode, $aParams, $oJoinedProfile))
                     break;
-                }
 
                 $bProcessConditionsForPrivateContent = false;
 
-                $this->aCurrent['join']['fans'] = array(
-                    'type' => 'INNER',
-                    'table' => 'bx_jobs_fans',
-                    'mainField' => 'id',
-                    'onField' => 'content',
-                    'joinFields' => array('initiator'),
-                );
-
-                $this->aCurrent['restriction']['fans'] = array('value' => $oJoinedProfile->id(), 'field' => 'initiator', 'operator' => '=', 'table' => 'bx_jobs_fans');
-
-                $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_JOINED_ENTRIES'] . '&profile_id={profile_id}';
-                $this->aCurrent['title'] = _t('_bx_jobs_page_title_joined_entries');
-                $this->aCurrent['rss']['link'] = 'modules/?r=jobs/rss/' . $sMode . '/' . $oJoinedProfile->id();
+                if(!$this->aCurrent['title'])
+                    $this->aCurrent['title'] = _t('_bx_jobs_page_title_joined_entries');
                 break;
-                
-                
+
             case 'followed_entries':
-                $oJoinedProfile = BxDolProfile::getInstance((int)$aParams['followed_profile']);
-                if (!$oJoinedProfile) {
-                    $this->isError = true;
+                $oJoinedProfile = null;
+                if(!$this->_updateCurrentForFollowedEntries($sMode, $aParams, $oJoinedProfile))
                     break;
-                }
 
                 $bProcessConditionsForPrivateContent = false;
 
-                $this->aCurrent['join']['followed'] = array(
-                    'type' => 'INNER',
-                    'table' => 'sys_profiles_conn_subscriptions',
-                    'mainField' => 'id',
-                    'onField' => 'content',
-                    'joinFields' => array('initiator'),
-                );
-
-                $this->aCurrent['restriction']['followed'] = array('value' => $oJoinedProfile->id(), 'field' => 'initiator', 'operator' => '=', 'table' => 'sys_profiles_conn_subscriptions');
-
-                $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_FOLLOWED_ENTRIES'] . '&profile_id={profile_id}';
-                $this->aCurrent['title'] = _t('_bx_jobs_page_title_followed_entries');
-                $this->aCurrent['rss']['link'] = 'modules/?r=jobs/rss/' . $sMode . '/' . $oJoinedProfile->id();
+                if(!$this->aCurrent['title'])
+                    $this->aCurrent['title'] = _t('_bx_jobs_page_title_followed_entries');
                 break;
 
             case 'connections':
@@ -155,10 +130,7 @@ class BxJobsSearchResult extends BxBaseModGroupsSearchResult
                 break;
 
             case 'favorite':
-                if(!$this->_setFavoriteConditions($sMode, $aParams, $oJoinedProfile)) {
-                    $this->isError = true;
-                    break;
-                }
+                $this->_setFavoriteConditions($sMode, $aParams, $oJoinedProfile);
                 break;
 
             case 'recent':

+ 6 - 25
modules/boonex/spaces/classes/BxSpacesSearchResult.php

@@ -81,34 +81,18 @@ class BxSpacesSearchResult extends BxBaseModGroupsSearchResult
         $bProcessConditionsForPrivateContent = true;
         switch ($sMode) {
             case 'created_entries':
-                if(!$this->_setAuthorConditions($sMode, $aParams, $oJoinedProfile)) {
-                    $this->isError = true;
-                    break;
-                }
+                $this->_setAuthorConditions($sMode, $aParams, $oJoinedProfile);
                 break;
 
             case 'joined_entries':
-                $oJoinedProfile = BxDolProfile::getInstance((int)$aParams['joined_profile']);
-                if (!$oJoinedProfile) {
-                    $this->isError = true;
+                $oJoinedProfile = null;
+                if(!$this->_updateCurrentForJoinedEntries($sMode, $aParams, $oJoinedProfile))
                     break;
-                }
 
                 $bProcessConditionsForPrivateContent = false;
 
-                $this->aCurrent['join']['fans'] = array(
-                    'type' => 'INNER',
-                    'table' => 'bx_spaces_fans',
-                    'mainField' => 'id',
-                    'onField' => 'content',
-                    'joinFields' => array('initiator'),
-                );
-
-                $this->aCurrent['restriction']['fans'] = array('value' => $oJoinedProfile->id(), 'field' => 'initiator', 'operator' => '=', 'table' => 'bx_spaces_fans');
-
-                $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_JOINED_ENTRIES'] . '&profile_id={profile_id}';
-                $this->aCurrent['title'] = _t('_bx_spaces_page_title_joined_entries');
-                $this->aCurrent['rss']['link'] = 'modules/?r=spaces/rss/' . $sMode . '/' . $oJoinedProfile->id();
+                if(!$this->aCurrent['title'])
+                    $this->aCurrent['title'] = _t('_bx_spaces_page_title_joined_entries');
                 break;
 
             case 'connections':
@@ -127,10 +111,7 @@ class BxSpacesSearchResult extends BxBaseModGroupsSearchResult
                 break;
 
             case 'favorite':
-                if(!$this->_setFavoriteConditions($sMode, $aParams, $oJoinedProfile)) {
-                    $this->isError = true;
-                    break;
-                }
+                $this->_setFavoriteConditions($sMode, $aParams, $oJoinedProfile);
                 break;
 
             case 'recent':