BxDirFormsEntryHelper.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 Directory Directory
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * Entry forms helper functions
  13. */
  14. class BxDirFormsEntryHelper extends BxBaseModTextFormsEntryHelper
  15. {
  16. public function __construct($oModule)
  17. {
  18. parent::__construct($oModule);
  19. }
  20. public function onDataAddAfter($iAccountId, $iContentId)
  21. {
  22. $s = parent::onDataAddAfter($iAccountId, $iContentId);
  23. if(!empty($s))
  24. return $s;
  25. $this->_oModule->serviceUpdateCategoriesStats();
  26. return '';
  27. }
  28. public function onDataEditAfter($iContentId, $aContentInfo, $aTrackTextFieldsChanges, $oProfile, $oForm)
  29. {
  30. $s = parent::onDataEditAfter($iContentId, $aContentInfo, $aTrackTextFieldsChanges, $oProfile, $oForm);
  31. if(!empty($s))
  32. return $s;
  33. $this->_oModule->serviceUpdateCategoriesStats();
  34. return '';
  35. }
  36. public function onDataDeleteAfter ($iContentId, $aContentInfo, $oProfile)
  37. {
  38. $s = parent::onDataDeleteAfter ($iContentId, $aContentInfo, $oProfile);
  39. if(!empty($s))
  40. return $s;
  41. $this->_oModule->serviceUpdateCategoriesStats();
  42. return '';
  43. }
  44. }
  45. /** @} */