| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php defined('BX_DOL') or die('hack attempt');
- /**
- * Copyright (c) UNA, Inc - https://una.io
- * MIT License - https://opensource.org/licenses/MIT
- *
- * @defgroup Developer Developer
- * @ingroup UnaModules
- *
- * @{
- */
- class BxDevTemplate extends BxBaseModGeneralTemplate
- {
- function __construct(&$oConfig, &$oDb)
- {
- parent::__construct($oConfig, $oDb);
- $this->addStudioCss(['main.css']);
- $this->addStudioJs(['main.js']);
- }
- public function getJsCode($sType, $aParams = [], $mixedWrap = true)
- {
- if(empty($aParams) || !is_array($aParams))
- $aParams = [];
- return parent::getJsCode($sType, array_merge($aParams, [
- 'sTxtExportType' => bx_js_string(_t('_bx_dev_txt_export_type')),
- 'sTxtBasic' => bx_js_string(_t('_bx_dev_btn_basic')),
- 'sTxtFull' => bx_js_string(_t('_bx_dev_btn_full'))
- ]), $mixedWrap);
- }
- function displayPageSettings($sPage, $oContent, $sGetPageCodeMethod = 'getPageCode')
- {
- $this->addStudioCss($oContent->getCss(), false, false);
- $this->addStudioJs($oContent->getJs(), false, false);
- $this->addStudioInjection('injection_body_style', 'text', ' bx-dev-page-body-single');
- return $oContent->getCode();
- }
- function displayPageContent($sPage, $oContent, $sGetPageCodeMethod = 'getPageCode')
- {
- $this->addStudioCss($oContent->getPageCss(), false, false);
- $this->addStudioJs($oContent->getPageJs(), false, false);
- $sMenu = $oContent->getPageMenu();
- $sContent = $oContent->getPageJsCode() . $oContent->$sGetPageCodeMethod();
- if(empty($sMenu)) {
- $this->addStudioInjection('injection_body_style', 'text', ' bx-dev-page-body-single');
- return $sContent;
- }
- $this->addStudioInjection('injection_body_style', 'text', ' bx-dev-page-body-columns');
- return $this->parseHtmlByName('page_content.html', [
- 'page_menu_code' => $sMenu,
- 'page_main_code' => $sContent
- ]);
- }
- }
- /** @} */
|