BxDevTemplate.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 Developer Developer
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxDevTemplate extends BxDolModuleTemplate
  12. {
  13. function __construct(&$oConfig, &$oDb)
  14. {
  15. parent::__construct($oConfig, $oDb);
  16. $this->addStudioCss(array('main.css'));
  17. }
  18. function displayPageContent($sPage, &$oContent)
  19. {
  20. $this->addStudioCss($oContent->getPageCss(), false, false);
  21. $this->addStudioJs($oContent->getPageJs(), false, false);
  22. $sMenu = $oContent->getPageMenu();
  23. $sContent = $oContent->getPageJsCode() . $oContent->getPageCode();
  24. if(in_array($sPage, array(BX_DEV_TOOLS_SETTINGS)) || empty($sMenu)) {
  25. $this->addStudioInjection('injection_body_style', 'text', ' bx-dev-page-body-single');
  26. return $sContent;
  27. }
  28. $this->addStudioInjection('injection_body_style', 'text', ' bx-dev-page-body-columns');
  29. return $this->parseHtmlByName('page_content.html', array(
  30. 'page_menu_code' => $sMenu,
  31. 'page_main_code' => $sContent
  32. ));
  33. }
  34. }
  35. /** @} */