BxMarketPageEntry.php 1.2 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 Market Market
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * Entry create/edit pages
  13. */
  14. class BxMarketPageEntry extends BxBaseModTextPageEntry
  15. {
  16. public function __construct($aObject, $oTemplate = false)
  17. {
  18. $this->MODULE = 'bx_market';
  19. parent::__construct($aObject, $oTemplate);
  20. }
  21. public function getCode ()
  22. {
  23. $sResult = parent::getCode();
  24. $sResult .= $this->_oModule->_oTemplate->getJsCode('entry');
  25. $this->_oModule->_oTemplate->addJs(array('fancybox/jquery.fancybox.pack.js', 'entry.js'));
  26. $this->_oModule->_oTemplate->addCss(array(BX_DIRECTORY_PATH_PLUGINS_PUBLIC . 'fancybox/|jquery.fancybox.css', 'entry.css'));
  27. return $sResult;
  28. }
  29. protected function _isAvailablePage($a)
  30. {
  31. if(parent::_isAvailablePage($a))
  32. return true;
  33. $CNF = &$this->_oModule->_oConfig->CNF;
  34. $iProfile = bx_get_logged_profile_id();
  35. if($this->_oModule->_oDb->hasLicense($iProfile, $this->_aContentInfo[$CNF['FIELD_ID']]))
  36. return true;
  37. return false;
  38. }
  39. }
  40. /** @} */