BxCnvCmts.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup Convos Convos
  7. * @ingroup DolphinModules
  8. *
  9. * @{
  10. */
  11. bx_import('BxTemplCmts');
  12. class BxCnvCmts extends BxTemplCmts
  13. {
  14. /**
  15. * Comments are enabled for collaborators only
  16. */
  17. public function isEnabled ()
  18. {
  19. if (!parent::isEnabled ())
  20. return false;
  21. bx_import('BxDolModule');
  22. $oModule = BxDolModule::getInstance('bx_convos');
  23. if (!($aContentInfo = $oModule->_oDb->getContentInfoById((int)$this->getId())))
  24. return false;
  25. $aCollaborators = $oModule->_oDb->getCollaborators((int)$this->getId());
  26. if (!isset($aCollaborators[bx_get_logged_profile_id()]))
  27. return false;
  28. return true;
  29. }
  30. public function isRemoveAllowed ($aCmt, $isPerformAction = false)
  31. {
  32. if (isAdmin())
  33. return true;
  34. return false;
  35. }
  36. public function msgErrRemoveAllowed ()
  37. {
  38. return _t('_sys_txt_access_denied');
  39. }
  40. }
  41. /** @} */