BxPostsTemplate.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. * Module representation.
  13. */
  14. class BxPostsTemplate extends BxBaseModTextTemplate
  15. {
  16. /**
  17. * Constructor
  18. */
  19. function __construct(&$oConfig, &$oDb)
  20. {
  21. $this->MODULE = 'bx_posts';
  22. parent::__construct($oConfig, $oDb);
  23. }
  24. /**
  25. * Use Gallery image for both because currently there is no Unit types with small thumbnails.
  26. */
  27. protected function getUnitThumbAndGallery ($aData)
  28. {
  29. list($sPhotoThumb, $sPhotoGallery) = parent::getUnitThumbAndGallery($aData);
  30. return array($sPhotoGallery, $sPhotoGallery);
  31. }
  32. protected function getAttachmentsImagesTranscoders ()
  33. {
  34. $CNF = &$this->getModule()->_oConfig->CNF;
  35. $oTranscoder = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW_PHOTOS']);
  36. return array($oTranscoder, null);
  37. }
  38. function entryAttachments ($aData, $aParams = array())
  39. {
  40. return $this->entryAttachmentsByStorage($this->getModule()->_oConfig->CNF['OBJECT_STORAGE_PHOTOS'], $aData, $aParams);
  41. }
  42. }
  43. /** @} */