BxBaseModProfilePrivacy.php 1.3 KB

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