BxOrgsFavorite.php 917 B

123456789101112131415161718192021222324252627282930313233343536
  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 Organizations Organizations
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxOrgsFavorite extends BxTemplFavorite
  12. {
  13. protected $MODULE;
  14. protected $_oModule;
  15. function __construct($aOptions, $oTemplate = false)
  16. {
  17. $this->MODULE = 'bx_organizations';
  18. parent::__construct($aOptions, $oTemplate);
  19. $this->_oModule = BxDolModule::getInstance($this->MODULE);
  20. }
  21. public function isAllowedFavorite($isPerformAction = false)
  22. {
  23. $oProfile = BxDolProfile::getInstanceByContentAndType($this->getId(), $this->_oModule->getName());
  24. if($oProfile && $oProfile->id() == bx_get_logged_profile_id())
  25. return false;
  26. return parent::isAllowedFavorite($isPerformAction);
  27. }
  28. }
  29. /** @} */