BxAdsStudioPage.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 Ads Ads
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. define('BX_DOL_STUDIO_MOD_TYPE_CATEGORIES', 'categories');
  12. class BxAdsStudioPage extends BxTemplStudioModule
  13. {
  14. protected $_sModule;
  15. protected $_oModule;
  16. function __construct($sModule, $mixedPageName, $sPage = "")
  17. {
  18. $this->_sModule = 'bx_ads';
  19. $this->_oModule = BxDolModule::getInstance($this->_sModule);
  20. parent::__construct($sModule, $mixedPageName, $sPage);
  21. $this->aMenuItems[BX_DOL_STUDIO_MOD_TYPE_CATEGORIES] = array('name' => BX_DOL_STUDIO_MOD_TYPE_CATEGORIES, 'icon' => 'bars', 'title' => '_bx_ads_menu_item_title_categories');
  22. }
  23. protected function getCategories()
  24. {
  25. $oGrid = BxDolGrid::getObjectInstance($this->_oModule->_oConfig->CNF['OBJECT_GRID_CATEGORIES'], BxDolStudioTemplate::getInstance());
  26. if(!$oGrid)
  27. return '';
  28. $this->_oModule->_oTemplate->addJs('studio');
  29. return $this->_oModule->_oTemplate->getJsCode('studio') . $oGrid->getCode();
  30. }
  31. }
  32. /** @} */