1
0

BxBaseModProfilePrivacy.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. if(!$oTemplate)
  21. $oTemplate = $this->_oModule->_oTemplate;
  22. $this->_aPrivacyParticallyVisible = array(BX_DOL_PG_FRIENDS);
  23. }
  24. public function isPartiallyVisible ($mixedPrivacy)
  25. {
  26. return in_array($mixedPrivacy, $this->_aPrivacyParticallyVisible);
  27. }
  28. public function getPartiallyVisiblePrivacyGroups ()
  29. {
  30. return $this->_aPrivacyParticallyVisible;
  31. }
  32. protected function getObjectInfo($sAction, $iObjectId)
  33. {
  34. $a = $this->_oDb->getObjectInfo($sAction, $iObjectId);
  35. $oProfile = BxDolProfile::getInstanceByContentAndType($iObjectId, $this->MODULE);
  36. if (!$oProfile)
  37. return false;
  38. $a['owner_id'] = $oProfile->id();
  39. return $a;
  40. }
  41. }
  42. /** @} */