BxMessengerFormEntry.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 Messenger Messenger
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * Create/Edit entry form
  13. */
  14. class BxMessengerFormEntry extends BxBaseModTextFormEntry
  15. {
  16. public function __construct($aInfo, $oTemplate = false)
  17. {
  18. $this->MODULE = 'bx_messenger';
  19. parent::__construct($aInfo, $oTemplate);
  20. $CNF = &$this->_oModule->_oConfig->CNF;
  21. if(isset($this->aInputs['submit'])) {
  22. $this->aInputs['submit']['icon'] = 'contact';
  23. $this->aInputs['submit']['icon_only'] = true;
  24. $this->aInputs['submit']['variant'] = 'text';
  25. }
  26. if(isset($this->aInputs['message'])) {
  27. $this->aInputs['message']['autoheight'] = true;
  28. $this->aInputs['message']['numLines'] = 1;
  29. }
  30. $sFieldName = 'files';
  31. if(isset($this->aInputs[$sFieldName])) {
  32. $this->aInputs[$sFieldName]['storage_object'] = $CNF['OBJECT_STORAGE'];
  33. $this->aInputs[$sFieldName]['uploaders'] = !empty($this->aInputs[$sFieldName]['value']) ? unserialize($this->aInputs[$sFieldName]['value']) : $CNF['OBJECT_UPLOADERS'];
  34. $this->aInputs[$sFieldName]['images_transcoder'] = $CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW'];
  35. $this->aInputs[$sFieldName]['storage_private'] = 0;
  36. $this->aInputs[$sFieldName]['multiple'] = true;
  37. $this->aInputs[$sFieldName]['content_id'] = 0;
  38. $this->aInputs[$sFieldName]['ghost_template'] = '';
  39. }
  40. }
  41. }
  42. /** @} */