| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php defined('BX_DOL') or die('hack attempt');
- /**
- * Copyright (c) UNA, Inc - https://una.io
- * MIT License - https://opensource.org/licenses/MIT
- *
- * @defgroup BaseGroups Base classes for groups modules
- * @ingroup UnaModules
- *
- * @{
- */
- class BxBaseModGroupsSearchResult extends BxBaseModProfileSearchResult
- {
- public function __construct($sMode = '', $aParams = array())
- {
- parent::__construct($sMode, $aParams);
- }
- protected function _setFavoriteConditions($sMode, $aParams, &$oProfileAuthor)
- {
- $CNF = &$this->oModule->_oConfig->CNF;
- $oProfileAuthor = BxDolProfile::getInstance((int)$aParams['user']);
- if (!$oProfileAuthor)
- return false;
- $iProfileAuthor = $oProfileAuthor->id();
- $oFavorite = $this->oModule->getObjectFavorite();
- if(!$oFavorite->isPublic() && $iProfileAuthor != bx_get_logged_profile_id())
- return false;
- $aConditions = $oFavorite->getConditionsTrack($CNF['TABLE_ENTRIES'], 'id', $iProfileAuthor);
- if(!empty($aConditions) && is_array($aConditions)) {
- if(empty($this->aCurrent['restriction']) || !is_array($this->aCurrent['restriction']))
- $this->aCurrent['restriction'] = array();
- $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'] = array_merge($this->aCurrent['join'], $aConditions['join']);
- }
- $this->sBrowseUrl = 'page.php?i=' . $CNF['URI_JOINED_ENTRIES'] . '&profile_id={profile_id}';
- $this->aCurrent['title'] = _t($CNF['T']['txt_all_entries_by_author']);
- $this->aCurrent['rss']['link'] = 'modules/?r=' . $this->oModule->_oConfig->getUri() . '/rss/' . $sMode . '/' . $iProfileAuthor;
- return true;
- }
- }
- /** @} */
|