BxPostsFormsEntryHelper.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 Posts Posts
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * Entry forms helper functions
  13. */
  14. class BxPostsFormsEntryHelper extends BxBaseModTextFormsEntryHelper
  15. {
  16. public function __construct($oModule)
  17. {
  18. parent::__construct($oModule);
  19. }
  20. protected function _alertAfterAdd($aContentInfo)
  21. {
  22. $CNF = &$this->_oModule->_oConfig->CNF;
  23. $iId = (int)$aContentInfo[$CNF['FIELD_ID']];
  24. $iAuthorId = (int)$aContentInfo[$CNF['FIELD_AUTHOR']];
  25. $aParams = array('object_author_id' => $iAuthorId);
  26. if(isset($aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']]))
  27. $aParams['privacy_view'] = $aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']];
  28. if(!empty($CNF['OBJECT_METATAGS']))
  29. $aParams['timeline_group'] = array(
  30. 'by' => $this->_oModule->_oConfig->getName() . '_' . $iAuthorId . '_' . $iId,
  31. 'field' => 'owner_id'
  32. );
  33. bx_alert($this->_oModule->getName(), ($aContentInfo[$CNF['FIELD_STATUS']] == 'awaiting' ? 'scheduled' : 'added'), $iId, $iAuthorId, $aParams);
  34. }
  35. }
  36. /** @} */