BxForumPageEntry.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 Forum Forum
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * Entry create/edit pages
  13. */
  14. class BxForumPageEntry extends BxBaseModTextPageEntry
  15. {
  16. public function __construct($aObject, $oTemplate = false)
  17. {
  18. $this->MODULE = 'bx_forum';
  19. parent::__construct($aObject, $oTemplate);
  20. $this->_oModule->_oTemplate->addJs(array('main.js', 'entry.js'));
  21. $this->_oModule->_oTemplate->addCss(array('main-media-phone.css', 'main-media-tablet.css', 'main-media-desktop.css'));
  22. }
  23. public function getCode()
  24. {
  25. $CNF = &$this->_oModule->_oConfig->CNF;
  26. $aCategory = $this->_oModule->_oDb->getCategories(array('type' => 'by_category', 'category' => $this->_aContentInfo[$CNF['FIELD_CATEGORY']]));
  27. if(!empty($aCategory['visible_for_levels']) && !BxDolAcl::getInstance()->isMemberLevelInSet($aCategory['visible_for_levels']))
  28. return $this->_oTemplate->displayAccessDenied();
  29. return $this->_oModule->_oTemplate->getJsCode('entry') . parent::getCode();
  30. }
  31. }
  32. /** @} */