BxMessengerJotVoteReactions.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 Messenger Messenger
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * For API only.
  13. */
  14. class BxMessengerJotVoteReactions extends BxTemplVoteReactions
  15. {
  16. protected $_sModule;
  17. protected $_oModule;
  18. public function __construct($sSystem, $iId, $iInit = 1)
  19. {
  20. parent::__construct($sSystem, $iId, $iInit);
  21. $this->_sModule = 'bx_messenger';
  22. $this->_oModule = BxDolModule::getInstance($this->_sModule);
  23. }
  24. protected function _isAllowedVoteByObject($aObject)
  25. {
  26. $CNF = &$this->_oModule->_oConfig->CNF;
  27. $aLot = $this->_oModule->_oDb->getLotInfoById($aObject[$CNF['FIELD_MESSAGE_FK']]);
  28. if(empty($aLot) || !is_array($aLot))
  29. return false;
  30. return bx_srv($this->_aSystem['module'], 'check_allowed_view_for_profile', [$aLot]) === CHECK_ACTION_RESULT_ALLOWED;
  31. }
  32. }
  33. /** @} */