BxAclResponse.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 ACL ACL
  7. * @ingroup TridentModules
  8. *
  9. * @{
  10. */
  11. class BxAclResponse extends BxDolAlertsResponse
  12. {
  13. protected $MODULE;
  14. protected $_oModule;
  15. public function __construct()
  16. {
  17. $this->MODULE = 'bx_acl';
  18. $this->_oModule = BxDolModule::getInstance($this->MODULE);
  19. parent::__construct();
  20. }
  21. /**
  22. * Overwtire the method of parent class.
  23. *
  24. * @param BxDolAlerts $oAlert an instance of alert.
  25. */
  26. public function response($oAlert)
  27. {
  28. if($oAlert->sUnit != 'system' || !in_array($oAlert->sAction, array('page_output_block_acl_level')))
  29. return;
  30. switch($oAlert->sAction) {
  31. case 'page_output_block_acl_level':
  32. $oAlert->aExtras['block_code'] .= $this->_oModule->serviceGetMembershipActions((int)$oAlert->aExtras['block_owner']);
  33. break;
  34. }
  35. }
  36. }
  37. /** @} */