1
0

BxBaseStudioDesigner.php 21 KB

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