BxBaseModProfileSearchResult.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup BaseText Base classes for text modules
  7. * @ingroup TridentModules
  8. *
  9. * @{
  10. */
  11. bx_import('BxBaseModGeneralSearchResult');
  12. class BxBaseModProfileSearchResult extends BxBaseModGeneralSearchResult
  13. {
  14. public function __construct($sMode = '', $aParams = array())
  15. {
  16. parent::__construct($sMode, $aParams);
  17. $this->sCenterContentUnitSelector = '.bx-base-pofile-unit';
  18. }
  19. protected function _setConnectionsConditions ($aParams)
  20. {
  21. bx_import('BxDolConnection');
  22. $oConnection = isset($aParams['object']) ? BxDolConnection::getObjectInstance($aParams['object']) : false;
  23. if (!$oConnection || !isset($aParams['profile']) || !(int)$aParams['profile'])
  24. return false;
  25. $sContentType = isset($aParams['type']) ? $aParams['type'] : BX_CONNECTIONS_CONTENT_TYPE_CONTENT;
  26. $isMutual = isset($aParams['mutual']) ? $aParams['mutual'] : false;
  27. $a = $oConnection->getConnectionsAsCondition ($sContentType, 'id', (int)$aParams['profile'], (int)$aParams['profile2'], $isMutual);
  28. $this->aCurrent['restriction'] = array_merge($this->aCurrent['restriction'], $a['restriction']);
  29. $this->aCurrent['join'] = array_merge($this->aCurrent['join'], $a['join']);
  30. return true;
  31. }
  32. }
  33. /** @} */