BxMassMailerFormsEntryHelper.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 MassMailer Mass Mailer
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * Entry forms helper functions
  13. */
  14. class BxMassMailerFormsEntryHelper extends BxBaseModTextFormsEntryHelper
  15. {
  16. public function __construct($oModule)
  17. {
  18. parent::__construct($oModule);
  19. }
  20. public function editDataForm ($iContentId, $sDisplay = false, $sCheckFunction = false, $bErrorMsg = true)
  21. {
  22. $CNF = &$this->_oModule->_oConfig->CNF;
  23. $CNF['TABLE_ENTRIES'] = $CNF['TABLE_CAMPAIGNS'];
  24. return parent::editDataForm($iContentId, $CNF['OBJECT_FORM_ENTRY_DISPLAY_EDIT'], $sCheckFunction, $bErrorMsg);
  25. }
  26. public function onDataEditAfter($iContentId, $aContentInfo, $aTrackTextFieldsChanges, $oProfile, $oForm)
  27. {
  28. if($this->_bIsApi)
  29. return '';
  30. $CNF = &$this->_oModule->_oConfig->CNF;
  31. $this->_redirectAndExit('page.php?i=' . $CNF['URI_MANAGE_CAMPAIGNS']);
  32. }
  33. public function onDataAddAfter($iAccountId, $iContentId)
  34. {
  35. if($this->_bIsApi)
  36. return '';
  37. $CNF = &$this->_oModule->_oConfig->CNF;
  38. $this->_redirectAndExit('page.php?i=' . $CNF['URI_MANAGE_CAMPAIGNS']);
  39. }
  40. public function redirectAfterAdd($aContentInfo, $sUrl = '')
  41. {
  42. if($this->_bIsApi)
  43. return [];
  44. return parent::redirectAfterAdd($aContentInfo, $sUrl);
  45. }
  46. protected function redirectAfterEdit($aContentInfo, $sUrl = '')
  47. {
  48. if($this->_bIsApi)
  49. return [];
  50. return parent::redirectAfterEdit($aContentInfo, $sUrl);
  51. }
  52. }
  53. /** @} */