BxAlbumsMenuView.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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 Albums Albums
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * View entry menu
  13. */
  14. class BxAlbumsMenuView extends BxBaseModTextMenuView
  15. {
  16. public function __construct($aObject, $oTemplate = false)
  17. {
  18. $this->MODULE = 'bx_albums';
  19. parent::__construct($aObject, $oTemplate);
  20. $this->addMarkers(array('js_object' => $this->_oModule->_oConfig->getJsObject('main')));
  21. $sURI = bx_process_input(bx_get('i'));
  22. if ($sURI == 'view-album-media') {
  23. $iMediaId = (int)bx_get('id');
  24. $aMediaInfo = $this->_oModule->_oDb->getMediaInfoById($iMediaId);
  25. $this->addMarkers(array('media_id' => $iMediaId));
  26. $this->_aContentInfo = $aMediaInfo ? $this->_oModule->_oDb->getContentInfoById($aMediaInfo['content_id']) : false;
  27. if ($this->_aContentInfo)
  28. $this->addMarkers(array('content_id' => (int)$aMediaInfo['content_id']));
  29. }
  30. }
  31. }
  32. /** @} */