BxWorkspacesAlertsResponse.php 1.2 KB

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 Workspaces Workspaces
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxWorkspacesAlertsResponse extends BxBaseModProfileAlertsResponse
  12. {
  13. public function __construct()
  14. {
  15. $this->MODULE = 'bx_workspaces';
  16. parent::__construct();
  17. }
  18. public function response($oAlert)
  19. {
  20. $sContextModule = getParam('bx_workspaces_context_module');
  21. // TODO: replace 'bx_groups_fans' with proper connection object from $sContextModule
  22. if ($sContextModule && 'system' == $oAlert->sUnit && 'connection_before_add' == $oAlert->sAction && isset($oAlert->aExtras['object_name']) && $oAlert->aExtras['object_name'] == 'bx_groups_fans') {
  23. $this->_oModule->addConnection($sContextModule, $oAlert);
  24. }
  25. if ($sContextModule && 'system' == $oAlert->sUnit && 'connection_removed' == $oAlert->sAction && isset($oAlert->aExtras['object_name']) && $oAlert->aExtras['object_name'] == 'bx_groups_fans') {
  26. $this->_oModule->removeConnection($sContextModule, $oAlert);
  27. }
  28. }
  29. }
  30. /** @} */