BxBaseStudioDesigner.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  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 UnaView UNA Studio Representation classes
  7. * @ingroup UnaStudio
  8. * @{
  9. */
  10. class BxBaseStudioDesigner extends BxDolStudioDesigner
  11. {
  12. protected $sLogoFormId = 'adm-dsg-logo-form';
  13. protected $sLogoIframeId = 'adm-dsg-logo-iframe';
  14. protected $sIconFormId = 'adm-dsg-icon-form';
  15. protected $sIconIframeId = 'adm-dsg-icon-iframe';
  16. protected $sCoverFormId = 'adm-dsg-cover-form';
  17. protected $sCoverIframeId = 'adm-dsg-cover-iframe';
  18. protected $sCoverStorage = BX_DOL_STORAGE_OBJ_IMAGES;
  19. protected $sCoverTranscoder = 'sys_cover_preview';
  20. protected $sSplashFormId = 'adm-dsg-splash-form';
  21. protected $sSplashIframeId = 'adm-dsg-splash-iframe';
  22. protected $sSplashEditorId = 'adm-dsg-splash-editor';
  23. protected $sInjectionsFormId = 'adm-dsg-injections-form';
  24. protected $sInjectionsIframeId = 'adm-dsg-injections-iframe';
  25. protected $sInjectionsEditorId = 'adm-dsg-injections-editor';
  26. public function __construct($sPage = '')
  27. {
  28. parent::__construct($sPage);
  29. $this->aPageCss = array_merge($this->aPageCss, ['forms.css', 'designer.css']);
  30. $this->aPageJs = array_merge($this->aPageJs, ['designer.js']);
  31. $this->sPageJsClass = 'BxDolStudioDesigner';
  32. $this->sPageJsObject = 'oBxDolStudioDesigner';
  33. }
  34. public function getPageJsCode($aOptions = array(), $bWrap = true)
  35. {
  36. $aOptions = array_merge([
  37. 'sActionUrl' => $this->sManageUrl,
  38. 'sParamPrefix' => $this->sParamPrefix
  39. ], $aOptions);
  40. return parent::getPageJsCode($aOptions, $bWrap);
  41. }
  42. public function getPageMenu($aMenu = array(), $aMarkers = array())
  43. {
  44. $sJsObject = $this->getPageJsObject();
  45. $aMenu = array();
  46. $aMenuItems = array(
  47. BX_DOL_STUDIO_DSG_TYPE_GENERAL => array('icon' => 'globe'),
  48. BX_DOL_STUDIO_DSG_TYPE_LOGO => array('icon' => 'pencil-alt'),
  49. BX_DOL_STUDIO_DSG_TYPE_ICON => array('icon' => 'far image'),
  50. BX_DOL_STUDIO_DSG_TYPE_COVER => array('icon' => 'far file-image'),
  51. BX_DOL_STUDIO_DSG_TYPE_SPLASH => array('icon' => 'far file-image'),
  52. BX_DOL_STUDIO_DSG_TYPE_INJECTIONS => array('icon' => 'object-group'),
  53. BX_DOL_STUDIO_DSG_TYPE_SETTINGS => array('icon' => 'cogs'),
  54. );
  55. foreach($aMenuItems as $sMenuItem => $aItem)
  56. $aMenu[] = array(
  57. 'name' => $sMenuItem,
  58. 'icon' => $aItem['icon'],
  59. 'link' => BX_DOL_URL_STUDIO . 'designer.php?page=' . $sMenuItem,
  60. 'title' => _t('_adm_lmi_cpt_' . $sMenuItem),
  61. 'selected' => $sMenuItem == $this->sPage
  62. );
  63. return parent::getPageMenu($aMenu);
  64. }
  65. protected function getGeneral()
  66. {
  67. $sJsObject = $this->getPageJsObject();
  68. $oTemplate = BxDolStudioTemplate::getInstance();
  69. $sResult = '';
  70. $sTemplate = getParam('template');
  71. $aTemplates = get_templates_array(true, false);
  72. $aTmplVarsTemplates = array ();
  73. foreach($aTemplates as $sUri => $aTemplate) {
  74. $sIcon = $this->getModuleIcon($aTemplate, 'store');
  75. $bIcon = strpos($sIcon, '.') === false && strcmp(substr($sIcon, 0, 10), 'data:image') != 0;
  76. $aTmplVarsTemplates[] = array(
  77. 'uri' => $sUri,
  78. 'title' => htmlspecialchars_adv($aTemplate['title']),
  79. 'version' => htmlspecialchars_adv($aTemplate['version']),
  80. 'vendor' => htmlspecialchars_adv($aTemplate['vendor']),
  81. 'bx_if:icon' => array (
  82. 'condition' => $bIcon,
  83. 'content' => array('icon' => $sIcon),
  84. ),
  85. 'bx_if:image' => array (
  86. 'condition' => !$bIcon,
  87. 'content' => array('icon_url' => $sIcon),
  88. ),
  89. 'bx_if:default' => array (
  90. 'condition' => $sUri == $sTemplate,
  91. 'content' => array (),
  92. ),
  93. 'bx_if:make_default' => array (
  94. 'condition' => $sUri != $sTemplate,
  95. 'content' => array(
  96. 'js_object' => $sJsObject,
  97. 'uri' => $sUri
  98. ),
  99. )
  100. );
  101. }
  102. $sContent = $sResult ? MsgBox($sResult, 10) : '';
  103. $sContent .= $oTemplate->parseHtmlByName('templates.html', array(
  104. 'bx_repeat:templates' => $aTmplVarsTemplates,
  105. ));
  106. return $oTemplate->parseHtmlByName('designer.html', array(
  107. 'content' => $sContent,
  108. 'js_content' => $this->getPageJsCode()
  109. ));
  110. }
  111. protected function getLogo()
  112. {
  113. $oTemplate = BxDolStudioTemplate::getInstance();
  114. $aForm = array(
  115. 'form_attrs' => array(
  116. 'id' => $this->sLogoFormId,
  117. 'name' => $this->sLogoFormId,
  118. 'action' => $this->sManageUrl,
  119. 'method' => 'post',
  120. 'enctype' => 'multipart/form-data',
  121. 'target' => $this->sLogoIframeId
  122. ),
  123. 'params' => array(
  124. 'db' => array(
  125. 'table' => '',
  126. 'key' => '',
  127. 'uri' => '',
  128. 'uri_title' => '',
  129. 'submit_name' => 'save'
  130. ),
  131. ),
  132. 'inputs' => array(
  133. 'page' => array(
  134. 'type' => 'hidden',
  135. 'name' => 'page',
  136. 'value' => $this->sPage
  137. ),
  138. 'image' => array(
  139. 'type' => 'image_uploader',
  140. 'name' => 'image',
  141. 'caption' => _t('_adm_dsg_txt_upload_image'),
  142. 'caption_preview' => _t('_adm_dsg_txt_upload_image_preview'),
  143. 'ajax_action_delete' => $this->getPageJsObject() . '.deleteLogo()',
  144. 'storage_object' => 'sys_images_custom',
  145. 'transcoder_object' => 'sys_custom_images',
  146. 'transcoder_image_width' => (int)getParam($this->sParamLogoWidth),
  147. 'transcoder_image_height' => (int)getParam($this->sParamLogoHeight),
  148. 'value' => (int)getParam($this->sParamLogo),
  149. ),
  150. 'width' => array(
  151. 'type' => 'text',
  152. 'name' => 'width',
  153. 'caption' => _t('_adm_stg_cpt_option_sys_site_logo_width'),
  154. 'value' => (int)getParam($this->sParamLogoWidth),
  155. 'db' => array (
  156. 'pass' => 'Int',
  157. ),
  158. ),
  159. 'height' => array(
  160. 'type' => 'text',
  161. 'name' => 'height',
  162. 'caption' => _t('_adm_stg_cpt_option_sys_site_logo_height'),
  163. 'value' => (int)getParam($this->sParamLogoHeight),
  164. 'db' => array (
  165. 'pass' => 'Int',
  166. ),
  167. ),
  168. 'alt' => array(
  169. 'type' => 'text',
  170. 'name' => 'alt',
  171. 'caption' => _t('_adm_dsg_txt_alt_text'),
  172. 'info' => _t('_adm_dsg_dsc_alt_text'),
  173. 'value' => getParam($this->sParamLogoAlt),
  174. 'checker' => array(
  175. 'func' => '',
  176. 'params' => array(),
  177. 'error' => ''
  178. ),
  179. 'db' => array (
  180. 'pass' => 'Xss',
  181. ),
  182. ),
  183. 'save' => array(
  184. 'type' => 'submit',
  185. 'name' => 'save',
  186. 'value' => _t('_adm_btn_designer_submit'),
  187. )
  188. )
  189. );
  190. $oForm = new BxTemplStudioFormView($aForm);
  191. $oForm->initChecker();
  192. if($oForm->isSubmittedAndValid()) {
  193. echo $this->submitLogo($oForm);
  194. exit;
  195. }
  196. return MsgBox(_t('_adm_dsg_txt_logo_redefinition')) . $oTemplate->parseHtmlByName('designer.html', array(
  197. 'content' => $oTemplate->parseHtmlByName('dsr_logo.html', array('logo_iframe_id' => $this->sLogoIframeId, 'form' => $oForm->getCode())),
  198. 'js_content' => $this->getPageJsCode()
  199. ));
  200. }
  201. protected function getIcon()
  202. {
  203. $oTemplate = BxDolStudioTemplate::getInstance();
  204. $sPreview = "";
  205. $aTmplVars = array('bx_repeat:images' => array());
  206. if(($iId = (int)getParam('sys_site_icon')) != 0) {
  207. $aTranscoders = array(
  208. BX_DOL_TRANSCODER_OBJ_ICON_APPLE => '_adm_dsg_txt_icon_apple',
  209. BX_DOL_TRANSCODER_OBJ_ICON_FACEBOOK => '_adm_dsg_txt_icon_facebook',
  210. BX_DOL_TRANSCODER_OBJ_ICON_FAVICON => '_adm_dsg_txt_icon_favicon'
  211. );
  212. foreach($aTranscoders as $sTranscoder => $sTitle) {
  213. $oTranscoder = BxDolTranscoderImage::getObjectInstance($sTranscoder);
  214. $sImageUrl = $oTranscoder->getFileUrl($iId);
  215. if($sImageUrl === false) {
  216. setParam('sys_site_icon', 0);
  217. break;
  218. }
  219. $aFilterParams = $oTranscoder->getFilterParams('Resize');
  220. $bFilterWidth = !empty($aFilterParams['w']);
  221. $bFilterHeight = !empty($aFilterParams['h']);
  222. $aTmplVars['bx_repeat:images'][] = array(
  223. 'caption' => _t($sTitle),
  224. 'url' => $sImageUrl,
  225. 'bx_if:show_width' => array(
  226. 'condition' => $bFilterWidth,
  227. 'content' => array(
  228. 'width' => $bFilterWidth ? (int)$aFilterParams['w'] : 0
  229. )
  230. ),
  231. 'bx_if:show_height' => array(
  232. 'condition' => $bFilterHeight,
  233. 'content' => array(
  234. 'height' => $bFilterHeight ? (int)$aFilterParams['h'] : 0
  235. )
  236. ),
  237. );
  238. }
  239. $sPreview = $oTemplate->parseHtmlByName('dsr_icon_preview.html', $aTmplVars);
  240. }
  241. $aForm = array(
  242. 'form_attrs' => array(
  243. 'id' => $this->sIconFormId,
  244. 'name' => $this->sIconFormId,
  245. 'action' => BX_DOL_URL_STUDIO . 'designer.php',
  246. 'method' => 'post',
  247. 'enctype' => 'multipart/form-data',
  248. 'target' => $this->sIconIframeId
  249. ),
  250. 'params' => array(
  251. 'db' => array(
  252. 'table' => '',
  253. 'key' => '',
  254. 'uri' => '',
  255. 'uri_title' => '',
  256. 'submit_name' => 'save'
  257. ),
  258. ),
  259. 'inputs' => array(
  260. 'page' => array(
  261. 'type' => 'hidden',
  262. 'name' => 'page',
  263. 'value' => $this->sPage
  264. ),
  265. 'preview' => array(
  266. 'type' => 'custom',
  267. 'name' => 'preview',
  268. 'content' => $sPreview
  269. ),
  270. 'image' => array(
  271. 'type' => 'file',
  272. 'name' => 'image',
  273. 'caption' => _t('_adm_dsg_txt_upload_icon')
  274. ),
  275. 'save' => array(
  276. 'type' => 'submit',
  277. 'name' => 'save',
  278. 'value' => _t('_adm_btn_designer_submit'),
  279. )
  280. )
  281. );
  282. $oForm = new BxTemplStudioFormView($aForm);
  283. $oForm->initChecker();
  284. if($oForm->isSubmittedAndValid()) {
  285. echo $this->submitIcon($oForm);
  286. exit;
  287. }
  288. return $oTemplate->parseHtmlByName('designer.html', array(
  289. 'content' => $oTemplate->parseHtmlByName('dsr_icon.html', array('icon_iframe_id' => $this->sIconIframeId, 'form' => $oForm->getCode())),
  290. 'js_content' => $this->getPageJsCode()
  291. ));
  292. }
  293. protected function getCover()
  294. {
  295. $sJsObject = $this->getPageJsObject();
  296. $oTemplate = BxDolStudioTemplate::getInstance();
  297. $oDbSettings = new BxDolStudioSettingsQuery();
  298. $aFormInputs = array();
  299. $aTmplVarsCovers = array();
  300. foreach($this->aCovers as $sCover => $aCover) {
  301. $aSetting = array();
  302. $oDbSettings->getOptions(array('type' => 'by_name', 'value' => $aCover['setting']), $aSetting, false);
  303. if(empty($aSetting) || !is_array($aSetting))
  304. continue;
  305. $aFormInputs[$sCover] = array(
  306. 'type' => 'files',
  307. 'name' => $sCover,
  308. 'storage_object' => $this->sCoverStorage,
  309. 'images_transcoder' => $this->sCoverTranscoder,
  310. 'uploaders' => array('sys_std_crop_cover'),
  311. 'multiple' => false,
  312. 'content_id' => $aSetting['id'],
  313. 'ghost_template' => BxDolStudioTemplate::getInstance()->parseHtmlByName('uploader_fgt_cover.html', array(
  314. 'name' => $sCover,
  315. )),
  316. 'caption' => _t('_adm_dsg_txt_upload_' . $sCover),
  317. 'db' => array (
  318. 'pass' => 'Int',
  319. )
  320. );
  321. if(($iImageId = (int)getParam($aCover['setting'])) == 0)
  322. continue;
  323. $sImageUrl = BxDolTranscoderImage::getObjectInstance($aCover['transcoder'])->getFileUrl($iImageId);
  324. if($sImageUrl === false) {
  325. setParam($aCover['setting'], 0);
  326. continue;
  327. }
  328. $aTmplVarsCovers[] = array(
  329. 'image_id' => $iImageId,
  330. 'content' => $oTemplate->parseHtmlByName($aCover['template'], array(
  331. 'js_object' => $sJsObject,
  332. 'type' => $sCover,
  333. 'caption' => _t($aCover['title']),
  334. 'image_id' => $iImageId,
  335. 'bx_if:show_bg' => array(
  336. 'condition' => !empty($sImageUrl),
  337. 'content' => array(
  338. 'image_url' => $sImageUrl
  339. )
  340. ),
  341. ))
  342. );
  343. }
  344. $aForm = array(
  345. 'form_attrs' => array(
  346. 'id' => $this->sCoverFormId,
  347. 'name' => $this->sCoverFormId,
  348. 'action' => BX_DOL_URL_STUDIO . 'designer.php',
  349. 'method' => 'post',
  350. 'enctype' => 'multipart/form-data',
  351. 'target' => $this->sCoverIframeId
  352. ),
  353. 'params' => array(
  354. 'db' => array(
  355. 'table' => '',
  356. 'key' => '',
  357. 'uri' => '',
  358. 'uri_title' => '',
  359. 'submit_name' => 'save'
  360. ),
  361. ),
  362. 'inputs' => array(
  363. 'page' => array(
  364. 'type' => 'hidden',
  365. 'name' => 'page',
  366. 'value' => $this->sPage
  367. ),
  368. 'disabled' => array(
  369. 'type' => 'checkbox',
  370. 'name' => 'enabled',
  371. 'caption' => _t('_adm_dsg_txt_cover_disabled'),
  372. 'value' => 'on',
  373. 'checked' => getParam('sys_site_cover_disabled') == 'on',
  374. 'db' => array (
  375. 'pass' => 'Xss',
  376. ),
  377. ),
  378. 'preview' => array(
  379. 'type' => 'custom',
  380. 'name' => 'preview',
  381. 'content' => $oTemplate->parseHtmlByName('dsr_cover_preview.html', array(
  382. 'bx_repeat:covers' => $aTmplVarsCovers
  383. ))
  384. ),
  385. 'save' => array(
  386. 'type' => 'submit',
  387. 'name' => 'save',
  388. 'value' => _t('_adm_btn_designer_submit'),
  389. )
  390. )
  391. );
  392. $aForm['inputs'] = bx_array_insert_after($aFormInputs, $aForm['inputs'], 'preview');
  393. $oForm = new BxTemplStudioFormView($aForm);
  394. $oForm->initChecker();
  395. if($oForm->isSubmittedAndValid()) {
  396. echo $this->submitCover($oForm);
  397. exit;
  398. }
  399. $this->aPageCss[] = 'cover.css';
  400. return $oTemplate->parseHtmlByName('designer.html', array(
  401. 'content' => $oTemplate->parseHtmlByName('dsr_cover.html', array('iframe_id' => $this->sCoverIframeId, 'form' => $oForm->getCode())),
  402. 'js_content' => $this->getPageJsCode()
  403. ));
  404. }
  405. protected function getSplash()
  406. {
  407. $oTemplate = BxDolStudioTemplate::getInstance();
  408. $aForm = array(
  409. 'form_attrs' => array(
  410. 'id' => $this->sSplashFormId,
  411. 'name' => $this->sSplashFormId,
  412. 'action' => BX_DOL_URL_STUDIO . 'designer.php',
  413. 'method' => 'post',
  414. 'enctype' => 'multipart/form-data',
  415. 'target' => $this->sSplashIframeId
  416. ),
  417. 'params' => array(
  418. 'db' => array(
  419. 'table' => '',
  420. 'key' => '',
  421. 'uri' => '',
  422. 'uri_title' => '',
  423. 'submit_name' => 'save'
  424. ),
  425. ),
  426. 'inputs' => array(
  427. 'page' => array(
  428. 'type' => 'hidden',
  429. 'name' => 'page',
  430. 'value' => $this->sPage
  431. ),
  432. 'enabled' => array(
  433. 'type' => 'checkbox',
  434. 'name' => 'enabled',
  435. 'caption' => _t('_adm_dsg_txt_splash_enabled'),
  436. 'value' => 'on',
  437. 'checked' => getParam('sys_site_splash_enabled') == 'on',
  438. 'db' => array (
  439. 'pass' => 'Xss',
  440. ),
  441. ),
  442. 'code' => array(
  443. 'type' => 'textarea',
  444. 'code' => true,
  445. 'name' => 'code',
  446. 'caption' => '',
  447. 'value' => getParam('sys_site_splash_code'),
  448. ),
  449. 'save' => array(
  450. 'type' => 'submit',
  451. 'name' => 'save',
  452. 'value' => _t('_adm_btn_designer_submit'),
  453. )
  454. )
  455. );
  456. $oForm = new BxTemplStudioFormView($aForm, $oTemplate);
  457. $oForm->initChecker();
  458. if($oForm->isSubmittedAndValid()) {
  459. echo $this->submitSplash($oForm);
  460. exit;
  461. }
  462. $oTemplate->addJs(array('codemirror/codemirror.min.js'));
  463. $oTemplate->addCss(BX_DIRECTORY_PATH_PLUGINS_PUBLIC . 'codemirror/|codemirror.css');
  464. return $oTemplate->parseHtmlByName('designer.html', array(
  465. 'content' => $oTemplate->parseHtmlByName('dsr_splash.html', array(
  466. 'warning' => MsgBox(_t('_adm_dsg_dsc_splash_warning')),
  467. 'splash_iframe_id' => $this->sSplashIframeId,
  468. 'form' => $oForm->getCode()
  469. )),
  470. 'js_content' => $this->getPageJsCode(array(
  471. 'sCodeMirror' => 'textarea[name=code]'
  472. )),
  473. ));
  474. }
  475. protected function getInjections()
  476. {
  477. $oTemplate = BxDolStudioTemplate::getInstance();
  478. $aForm = array(
  479. 'form_attrs' => array(
  480. 'id' => $this->sInjectionsFormId,
  481. 'name' => $this->sInjectionsFormId,
  482. 'action' => BX_DOL_URL_STUDIO . 'designer.php',
  483. 'method' => 'post',
  484. 'enctype' => 'multipart/form-data',
  485. 'target' => $this->sInjectionsIframeId
  486. ),
  487. 'params' => array(
  488. 'db' => array(
  489. 'table' => '',
  490. 'key' => '',
  491. 'uri' => '',
  492. 'uri_title' => '',
  493. 'submit_name' => 'save'
  494. ),
  495. ),
  496. 'inputs' => array(
  497. 'page' => array(
  498. 'type' => 'hidden',
  499. 'name' => 'page',
  500. 'value' => $this->sPage
  501. ),
  502. 'sys_head' => array(
  503. 'type' => 'textarea',
  504. 'code' => true,
  505. 'name' => 'sys_head',
  506. 'caption' => _t('_adm_dsg_txt_inj_head'),
  507. 'info' => _t('_adm_dsg_txt_inj_head_inf'),
  508. 'value' => $this->oDb->getOne("SELECT `data` FROM `sys_injections` WHERE `name`='sys_head'"),
  509. ),
  510. 'sys_body' => array(
  511. 'type' => 'textarea',
  512. 'code' => true,
  513. 'name' => 'sys_body',
  514. 'caption' => _t('_adm_dsg_txt_inj_body'),
  515. 'info' => _t('_adm_dsg_txt_inj_body_inf'),
  516. 'value' => $this->oDb->getOne("SELECT `data` FROM `sys_injections` WHERE `name`='sys_body'"),
  517. ),
  518. 'save' => array(
  519. 'type' => 'submit',
  520. 'name' => 'save',
  521. 'value' => _t('_adm_btn_designer_submit'),
  522. )
  523. )
  524. );
  525. $oForm = new BxTemplStudioFormView($aForm, $oTemplate);
  526. $oForm->initChecker();
  527. if($oForm->isSubmittedAndValid()) {
  528. echo $this->submitInjections($oForm);
  529. exit;
  530. }
  531. $oTemplate->addJs(array('codemirror/codemirror.min.js'));
  532. $oTemplate->addCss(BX_DIRECTORY_PATH_PLUGINS_PUBLIC . 'codemirror/|codemirror.css');
  533. return $oTemplate->parseHtmlByName('designer.html', array(
  534. 'content' => $oTemplate->parseHtmlByName('dsr_injections.html', array(
  535. 'warning' => '',
  536. 'splash_iframe_id' => $this->sInjectionsIframeId,
  537. 'form' => $oForm->getCode()
  538. )),
  539. 'js_content' => $this->getPageJsCode(array(
  540. 'sCodeMirror' => 'textarea[name=sys_head],textarea[name=sys_body]'
  541. ))
  542. ));
  543. }
  544. protected function getSettings()
  545. {
  546. $oOptions = new BxTemplStudioOptions(BX_DOL_STUDIO_STG_TYPE_SYSTEM, BX_DOL_STUDIO_STG_CATEGORY_TEMPLATES);
  547. $this->aPageCss = array_merge($this->aPageCss, $oOptions->getCss());
  548. $this->aPageJs = array_merge($this->aPageJs, $oOptions->getJs());
  549. return BxDolStudioTemplate::getInstance()->parseHtmlByName('designer.html', array(
  550. 'content' => $oOptions->getCode(),
  551. 'js_content' => $this->getPageJsCode()
  552. ));
  553. }
  554. }
  555. /** @} */