BxBaseModGroupsMenuViewActionsAll.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 BaseGroups Base classes for groups modules
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * View entry all actions menu
  13. */
  14. class BxBaseModGroupsMenuViewActionsAll extends BxBaseModProfileMenuViewActionsAll
  15. {
  16. public function __construct($aObject, $oTemplate = false)
  17. {
  18. parent::__construct($aObject, $oTemplate);
  19. $CNF = &$this->_oModule->_oConfig->CNF;
  20. if(isset($CNF['OBJECT_CONNECTIONS']))
  21. $this->_aConnectionToFunctionCheck[$CNF['OBJECT_CONNECTIONS']] = [
  22. 'add' => 'checkAllowedFanAdd',
  23. 'remove' => 'checkAllowedFanRemove'
  24. ];
  25. }
  26. protected function _getMenuItemProfileFanAdd($aItem)
  27. {
  28. $CNF = &$this->_oModule->_oConfig->CNF;
  29. if($this->_bIsApi && $CNF['OBJECT_CONNECTIONS'])
  30. return $this->_getMenuItemConnectionApi($CNF['OBJECT_CONNECTIONS'], 'add', $aItem);
  31. return $this->_getMenuItemByNameActions($aItem);
  32. }
  33. protected function _getMenuItemProfileFanAddPaid($aItem)
  34. {
  35. return $this->_getMenuItemByNameActions($aItem);
  36. }
  37. protected function _getMenuItemProfileFanRemove($aItem)
  38. {
  39. $CNF = &$this->_oModule->_oConfig->CNF;
  40. if($this->_bIsApi && $CNF['OBJECT_CONNECTIONS'])
  41. return $this->_getMenuItemConnectionApi($CNF['OBJECT_CONNECTIONS'], 'remove', $aItem);
  42. return $this->_getMenuItemByNameActionsMore($aItem);
  43. }
  44. }
  45. /** @} */