BxBaseModProfilePrivacy.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup BaseProfile Base classes for profile modules
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxBaseModProfilePrivacy extends BxTemplPrivacy
  12. {
  13. protected $MODULE;
  14. protected $_oModule;
  15. protected $_aPrivacyParticallyVisible = array ();
  16. public function __construct($aOptions, $oTemplate = false)
  17. {
  18. parent::__construct($aOptions, $oTemplate);
  19. $this->_oModule = BxDolModule::getInstance($this->MODULE);
  20. $this->_aPrivacyParticallyVisible = array(BX_DOL_PG_FRIENDS);
  21. }
  22. public function isPartiallyVisible ($mixedPrivacy)
  23. {
  24. return in_array($mixedPrivacy, $this->_aPrivacyParticallyVisible);
  25. }
  26. public function getPartiallyVisiblePrivacyGroups ()
  27. {
  28. return $this->_aPrivacyParticallyVisible;
  29. }
  30. protected function getObjectInfo($sAction, $iObjectId)
  31. {
  32. $a = $this->_oDb->getObjectInfo($sAction, $iObjectId);
  33. $oProfile = BxDolProfile::getInstanceByContentAndType($iObjectId, $this->MODULE);
  34. if (!$oProfile)
  35. return false;
  36. $a['owner_id'] = $oProfile->id();
  37. return $a;
  38. }
  39. }
  40. /** @} */