BxVideosPageEntry.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 Videos Videos
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * Entry create/edit pages
  13. */
  14. class BxVideosPageEntry extends BxBaseModTextPageEntry
  15. {
  16. public function __construct($aObject, $oTemplate = false)
  17. {
  18. $this->MODULE = 'bx_videos';
  19. parent::__construct($aObject, $oTemplate);
  20. }
  21. protected function _setSubmenu($aParams)
  22. {
  23. parent::_setSubmenu(array_merge($aParams, array(
  24. 'icon' => ''
  25. )));
  26. }
  27. protected function _getThumbForMetaObject ()
  28. {
  29. $CNF = &$this->_oModule->_oConfig->CNF;
  30. $sPosterSrc = !empty($CNF['FIELD_POSTER']) ? $CNF['FIELD_POSTER'] : $CNF['FIELD_THUMB'];
  31. if(!empty($sPosterSrc) && !empty($this->_aContentInfo[$sPosterSrc]))
  32. return array('id' => $this->_aContentInfo[$sPosterSrc], 'transcoder' => $CNF['OBJECT_IMAGES_TRANSCODER_POSTER']);
  33. if(!empty($CNF['FIELD_VIDEO']) && !empty($this->_aContentInfo[$CNF['FIELD_VIDEO']]))
  34. return array('id' => $this->_aContentInfo[$CNF['FIELD_VIDEO']], 'transcoder' => $CNF['OBJECT_VIDEOS_TRANSCODERS']['poster']);
  35. return false;
  36. }
  37. }
  38. /** @} */