BxDecorousStudioPage.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 Decorous Decorous template
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. define('BX_DECOROUS_STUDIO_TEMPL_TYPE_STYLES', 'styles');
  12. class BxDecorousStudioPage extends BxTemplStudioDesign
  13. {
  14. function __construct($sModule, $mixedPageName, $sPage = "")
  15. {
  16. $this->MODULE = 'bx_decorous';
  17. parent::__construct($sModule, $mixedPageName, $sPage);
  18. $this->aMenuItems[BX_DECOROUS_STUDIO_TEMPL_TYPE_STYLES] = array('title' => '_bx_decorous_lmi_cpt_styles', 'icon' => 'paint-brush');
  19. unset($this->aMenuItems[BX_DOL_STUDIO_TEMPL_TYPE_LOGO]);
  20. }
  21. protected function getSettings($mixedCategory = '', $sMix = '')
  22. {
  23. return parent::getSettings('bx_decorous_system', $sMix);
  24. }
  25. protected function getStyles($sMix = '')
  26. {
  27. $oTemplate = BxDolStudioTemplate::getInstance();
  28. $sPrefix = $this->MODULE;
  29. $aCategories = array(
  30. $sPrefix . '_styles_general',
  31. $sPrefix . '_styles_header',
  32. $sPrefix . '_styles_footer',
  33. $sPrefix . '_styles_body',
  34. $sPrefix . '_styles_cover',
  35. $sPrefix . '_styles_block',
  36. $sPrefix . '_styles_card',
  37. $sPrefix . '_styles_popup',
  38. $sPrefix . '_styles_menu_main',
  39. $sPrefix . '_styles_menu_account',
  40. $sPrefix . '_styles_menu_add',
  41. $sPrefix . '_styles_menu_page',
  42. $sPrefix . '_styles_menu_slide',
  43. $sPrefix . '_styles_form',
  44. $sPrefix . '_styles_large_button',
  45. $sPrefix . '_styles_small_button',
  46. $sPrefix . '_styles_font',
  47. $sPrefix . '_styles_custom',
  48. $sPrefix . '_viewport_tablet',
  49. $sPrefix . '_viewport_mobile'
  50. );
  51. $oPage = new BxTemplStudioSettings($this->sModule, $aCategories, $sMix);
  52. $oPage->enableReadOnly(true);
  53. $oPage->enableMixes(true);
  54. $oTemplate->addJs(array('codemirror/codemirror.min.js'));
  55. $oTemplate->addCss(BX_DIRECTORY_PATH_PLUGINS_PUBLIC . 'codemirror/|codemirror.css');
  56. return BxDolStudioTemplate::getInstance()->parseHtmlByName('design.html', array(
  57. 'content' => $oPage->getPageCode(),
  58. 'js_content' => $this->getPageJsCode(array(
  59. 'sCodeMirror' => "textarea[name='" . $sPrefix . "_styles_custom']"
  60. ))
  61. ));
  62. }
  63. }
  64. /** @} */