BxBaseStudioDesigner.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  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-alt'),
  64. BX_DOL_STUDIO_DSG_TYPE_ICON => array('icon' => 'far image'),
  65. BX_DOL_STUDIO_DSG_TYPE_COVER => array('icon' => 'far file-image'),
  66. BX_DOL_STUDIO_DSG_TYPE_SPLASH => array('icon' => 'far file-image'),
  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 && strcmp(substr($sIcon, 0, 10), 'data:image') != 0;
  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. $oDbSettings = new BxDolStudioSettingsQuery();
  324. $aFormInputs = array();
  325. $aTmplVarsCovers = array();
  326. foreach($this->aCovers as $sCover => $aCover) {
  327. $aSetting = array();
  328. $oDbSettings->getOptions(array('type' => 'by_name', 'value' => $aCover['setting']), $aSetting, false);
  329. if(empty($aSetting) || !is_array($aSetting))
  330. continue;
  331. $aFormInputs[$sCover] = array(
  332. 'type' => 'files',
  333. 'name' => $sCover,
  334. 'storage_object' => $this->sCoverStorage,
  335. 'images_transcoder' => $this->sCoverTranscoder,
  336. 'uploaders' => array('sys_std_crop_cover'),
  337. 'multiple' => false,
  338. 'content_id' => $aSetting['id'],
  339. 'ghost_template' => BxDolStudioTemplate::getInstance()->parseHtmlByName('uploader_fgt_cover.html', array(
  340. 'name' => $sCover,
  341. )),
  342. 'caption' => _t('_adm_dsg_txt_upload_' . $sCover),
  343. 'db' => array (
  344. 'pass' => 'Int',
  345. )
  346. );
  347. if(($iImageId = (int)getParam($aCover['setting'])) == 0)
  348. continue;
  349. $sImageUrl = BxDolTranscoderImage::getObjectInstance($aCover['transcoder'])->getFileUrl($iImageId);
  350. if($sImageUrl === false) {
  351. setParam($aCover['setting'], 0);
  352. continue;
  353. }
  354. $aTmplVarsCovers[] = array(
  355. 'image_id' => $iImageId,
  356. 'content' => $oTemplate->parseHtmlByName($aCover['template'], array(
  357. 'js_object' => $sJsObject,
  358. 'type' => $sCover,
  359. 'caption' => _t($aCover['title']),
  360. 'image_id' => $iImageId,
  361. 'bx_if:show_bg' => array(
  362. 'condition' => !empty($sImageUrl),
  363. 'content' => array(
  364. 'image_url' => $sImageUrl
  365. )
  366. ),
  367. ))
  368. );
  369. }
  370. $aForm = array(
  371. 'form_attrs' => array(
  372. 'id' => $this->sCoverFormId,
  373. 'name' => $this->sCoverFormId,
  374. 'action' => BX_DOL_URL_STUDIO . 'designer.php',
  375. 'method' => 'post',
  376. 'enctype' => 'multipart/form-data',
  377. 'target' => $this->sCoverIframeId
  378. ),
  379. 'params' => array(
  380. 'db' => array(
  381. 'table' => '',
  382. 'key' => '',
  383. 'uri' => '',
  384. 'uri_title' => '',
  385. 'submit_name' => 'save'
  386. ),
  387. ),
  388. 'inputs' => array(
  389. 'page' => array(
  390. 'type' => 'hidden',
  391. 'name' => 'page',
  392. 'value' => $this->sPage
  393. ),
  394. 'preview' => array(
  395. 'type' => 'custom',
  396. 'name' => 'preview',
  397. 'content' => $oTemplate->parseHtmlByName('dsr_cover_preview.html', array(
  398. 'bx_repeat:covers' => $aTmplVarsCovers
  399. ))
  400. ),
  401. 'save' => array(
  402. 'type' => 'submit',
  403. 'name' => 'save',
  404. 'value' => _t('_adm_btn_designer_submit'),
  405. )
  406. )
  407. );
  408. $aForm['inputs'] = bx_array_insert_after($aFormInputs, $aForm['inputs'], 'preview');
  409. $oForm = new BxTemplStudioFormView($aForm);
  410. $oForm->initChecker();
  411. if($oForm->isSubmittedAndValid()) {
  412. echo $this->submitCover($oForm);
  413. exit;
  414. }
  415. $this->aPageCss[] = 'cover.css';
  416. return $oTemplate->parseHtmlByName('designer.html', array(
  417. 'content' => $this->getBlockCode(array(
  418. 'items' => $oTemplate->parseHtmlByName('dsr_cover.html', array('iframe_id' => $this->sCoverIframeId, 'form' => $oForm->getCode())),
  419. )),
  420. 'js_content' => $this->getPageJsCode()
  421. ));
  422. }
  423. protected function getSplash()
  424. {
  425. $oTemplate = BxDolStudioTemplate::getInstance();
  426. $aForm = array(
  427. 'form_attrs' => array(
  428. 'id' => $this->sSplashFormId,
  429. 'name' => $this->sSplashFormId,
  430. 'action' => BX_DOL_URL_STUDIO . 'designer.php',
  431. 'method' => 'post',
  432. 'enctype' => 'multipart/form-data',
  433. 'target' => $this->sSplashIframeId
  434. ),
  435. 'params' => array(
  436. 'db' => array(
  437. 'table' => '',
  438. 'key' => '',
  439. 'uri' => '',
  440. 'uri_title' => '',
  441. 'submit_name' => 'save'
  442. ),
  443. ),
  444. 'inputs' => array(
  445. 'page' => array(
  446. 'type' => 'hidden',
  447. 'name' => 'page',
  448. 'value' => $this->sPage
  449. ),
  450. 'enabled' => array(
  451. 'type' => 'checkbox',
  452. 'name' => 'enabled',
  453. 'caption' => _t('_adm_dsg_txt_splash_enabled'),
  454. 'value' => 'on',
  455. 'checked' => getParam('sys_site_splash_enabled') == 'on',
  456. 'db' => array (
  457. 'pass' => 'Xss',
  458. ),
  459. ),
  460. 'code' => array(
  461. 'type' => 'textarea',
  462. 'code' => true,
  463. 'name' => 'code',
  464. 'caption' => '',
  465. 'value' => getParam('sys_site_splash_code'),
  466. ),
  467. 'save' => array(
  468. 'type' => 'submit',
  469. 'name' => 'save',
  470. 'value' => _t('_adm_btn_designer_submit'),
  471. )
  472. )
  473. );
  474. $oForm = new BxTemplStudioFormView($aForm, $oTemplate);
  475. $oForm->initChecker();
  476. if($oForm->isSubmittedAndValid()) {
  477. echo $this->submitSplash($oForm);
  478. exit;
  479. }
  480. $oTemplate->addJs(array('codemirror/codemirror.min.js'));
  481. $oTemplate->addCss(BX_DIRECTORY_PATH_PLUGINS_PUBLIC . 'codemirror/|codemirror.css');
  482. return $oTemplate->parseHtmlByName('designer.html', array(
  483. 'content' => $this->getBlockCode(array(
  484. 'items' => $oTemplate->parseHtmlByName('dsr_splash.html', array(
  485. 'warning' => MsgBox(_t('_adm_dsg_dsc_splash_warning')),
  486. 'splash_iframe_id' => $this->sSplashIframeId,
  487. 'form' => $oForm->getCode()
  488. )),
  489. )),
  490. 'js_content' => $this->getPageJsCode(array(
  491. 'sCodeMirror' => 'textarea[name=code]'
  492. )),
  493. ));
  494. }
  495. protected function getInjections()
  496. {
  497. $oTemplate = BxDolStudioTemplate::getInstance();
  498. $aForm = array(
  499. 'form_attrs' => array(
  500. 'id' => $this->sInjectionsFormId,
  501. 'name' => $this->sInjectionsFormId,
  502. 'action' => BX_DOL_URL_STUDIO . 'designer.php',
  503. 'method' => 'post',
  504. 'enctype' => 'multipart/form-data',
  505. 'target' => $this->sInjectionsIframeId
  506. ),
  507. 'params' => array(
  508. 'db' => array(
  509. 'table' => '',
  510. 'key' => '',
  511. 'uri' => '',
  512. 'uri_title' => '',
  513. 'submit_name' => 'save'
  514. ),
  515. ),
  516. 'inputs' => array(
  517. 'page' => array(
  518. 'type' => 'hidden',
  519. 'name' => 'page',
  520. 'value' => $this->sPage
  521. ),
  522. 'sys_head' => array(
  523. 'type' => 'textarea',
  524. 'code' => true,
  525. 'name' => 'sys_head',
  526. 'caption' => _t('_adm_dsg_txt_inj_head'),
  527. 'info' => _t('_adm_dsg_txt_inj_head_inf'),
  528. 'value' => $this->oDb->getOne("SELECT `data` FROM `sys_injections` WHERE `name`='sys_head'"),
  529. ),
  530. 'sys_body' => array(
  531. 'type' => 'textarea',
  532. 'code' => true,
  533. 'name' => 'sys_body',
  534. 'caption' => _t('_adm_dsg_txt_inj_body'),
  535. 'info' => _t('_adm_dsg_txt_inj_body_inf'),
  536. 'value' => $this->oDb->getOne("SELECT `data` FROM `sys_injections` WHERE `name`='sys_body'"),
  537. ),
  538. 'save' => array(
  539. 'type' => 'submit',
  540. 'name' => 'save',
  541. 'value' => _t('_adm_btn_designer_submit'),
  542. )
  543. )
  544. );
  545. $oForm = new BxTemplStudioFormView($aForm, $oTemplate);
  546. $oForm->initChecker();
  547. if($oForm->isSubmittedAndValid()) {
  548. echo $this->submitInjections($oForm);
  549. exit;
  550. }
  551. $oTemplate->addJs(array('codemirror/codemirror.min.js'));
  552. $oTemplate->addCss(BX_DIRECTORY_PATH_PLUGINS_PUBLIC . 'codemirror/|codemirror.css');
  553. return $oTemplate->parseHtmlByName('designer.html', array(
  554. 'content' => $this->getBlockCode(array(
  555. 'items' => $oTemplate->parseHtmlByName('dsr_injections.html', array(
  556. 'warning' => '',
  557. 'splash_iframe_id' => $this->sInjectionsIframeId,
  558. 'form' => $oForm->getCode()
  559. )),
  560. )),
  561. 'js_content' => $this->getPageJsCode(array(
  562. 'sCodeMirror' => 'textarea[name=sys_head],textarea[name=sys_body]'
  563. ))
  564. ));
  565. }
  566. protected function getSettings()
  567. {
  568. $oPage = new BxTemplStudioSettings(BX_DOL_STUDIO_STG_TYPE_SYSTEM, BX_DOL_STUDIO_STG_CATEGORY_TEMPLATES);
  569. return BxDolStudioTemplate::getInstance()->parseHtmlByName('designer.html', array(
  570. 'content' => $oPage->getPageCode(),
  571. 'js_content' => $this->getPageJsCode()
  572. ));
  573. }
  574. }
  575. /** @} */