|
|
@@ -100,69 +100,82 @@ class BxBaseStudioPolyglot extends BxDolStudioPolyglot
|
|
|
return $this->getGrid($this->aGridObjects['etemplates']);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * TODO: Remove (after UNA 14) if new version is working fine.
|
|
|
- */
|
|
|
- protected function getEtemplatesHtmlOld()
|
|
|
+ protected function getEtemplatesHtml()
|
|
|
+ {
|
|
|
+ return $this->{'_getEtemplatesHtml' . ($this->isEtEditor() ? 'Editor' : 'Form')}();
|
|
|
+ }
|
|
|
+
|
|
|
+ protected function _getEtemplatesHtmlForm()
|
|
|
{
|
|
|
$oTemplate = BxDolStudioTemplate::getInstance();
|
|
|
|
|
|
$sFormId = 'adm-dsg-et-hf-form';
|
|
|
$sIFrameId = 'adm-dsg-et-hf-iframe';
|
|
|
|
|
|
- $aForm = array(
|
|
|
- 'form_attrs' => array(
|
|
|
+ $aForm = [
|
|
|
+ 'form_attrs' => [
|
|
|
'id' => $sFormId,
|
|
|
'name' => $sFormId,
|
|
|
'action' => BX_DOL_URL_STUDIO . 'polyglot.php',
|
|
|
'method' => 'post',
|
|
|
'enctype' => 'multipart/form-data',
|
|
|
'target' => $sIFrameId
|
|
|
- ),
|
|
|
- 'params' => array(
|
|
|
- 'db' => array(
|
|
|
+ ],
|
|
|
+ 'params' => [
|
|
|
+ 'db' => [
|
|
|
'table' => '',
|
|
|
'key' => '',
|
|
|
'uri' => '',
|
|
|
'uri_title' => '',
|
|
|
'submit_name' => 'save'
|
|
|
- ),
|
|
|
- ),
|
|
|
- 'inputs' => array(
|
|
|
- 'page' => array(
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ 'inputs' => [
|
|
|
+ 'page' => [
|
|
|
'type' => 'hidden',
|
|
|
'name' => 'page',
|
|
|
'value' => $this->sPage
|
|
|
- ),
|
|
|
- 'et_hf_header' => array(
|
|
|
+ ],
|
|
|
+ 'editor' => [
|
|
|
+ 'type' => 'switcher',
|
|
|
+ 'name' => 'editor',
|
|
|
+ 'caption' => _t('_adm_pgt_btn_et_hf_editor'),
|
|
|
+ 'info' => '',
|
|
|
+ 'value' => 'on',
|
|
|
+ 'checked' => $this->isEtEditor(),
|
|
|
+ 'attrs' => [
|
|
|
+ 'onchange' => $this->getPageJsObject() . '.enableEditor(this)'
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ 'et_hf_header' => [
|
|
|
'type' => 'textarea',
|
|
|
'code' => true,
|
|
|
'name' => 'et_hf_header',
|
|
|
'caption' => _t('_adm_stg_cpt_option_site_email_html_template_header'),
|
|
|
'info' => _t('_adm_pgt_txt_et_hf_inf'),
|
|
|
'value' => getParam('site_email_html_template_header'),
|
|
|
- 'db' => array (
|
|
|
+ 'db' => [
|
|
|
'pass' => 'Xss',
|
|
|
- ),
|
|
|
- ),
|
|
|
- 'et_hf_footer' => array(
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ 'et_hf_footer' => [
|
|
|
'type' => 'textarea',
|
|
|
'code' => true,
|
|
|
'name' => 'et_hf_footer',
|
|
|
'caption' => _t('_adm_stg_cpt_option_site_email_html_template_footer'),
|
|
|
'info' => _t('_adm_pgt_txt_et_hf_inf'),
|
|
|
'value' => getParam('site_email_html_template_footer'),
|
|
|
- 'db' => array (
|
|
|
+ 'db' => [
|
|
|
'pass' => 'Xss',
|
|
|
- ),
|
|
|
- ),
|
|
|
- 'save' => array(
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ 'save' => [
|
|
|
'type' => 'submit',
|
|
|
'name' => 'save',
|
|
|
'value' => _t('_adm_pgt_btn_et_hf_submit'),
|
|
|
- )
|
|
|
- )
|
|
|
- );
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ ];
|
|
|
|
|
|
$oForm = new BxTemplStudioFormView($aForm, $oTemplate);
|
|
|
$oForm->initChecker();
|
|
|
@@ -171,10 +184,10 @@ class BxBaseStudioPolyglot extends BxDolStudioPolyglot
|
|
|
echo $this->submitEtemplatesHtmlOld($oForm);
|
|
|
exit;
|
|
|
}
|
|
|
-
|
|
|
+/*
|
|
|
$oTemplate->addJs(array('codemirror/codemirror.min.js'));
|
|
|
$oTemplate->addCss(BX_DIRECTORY_PATH_PLUGINS_PUBLIC . 'codemirror/|codemirror.css');
|
|
|
-
|
|
|
+*/
|
|
|
return $oTemplate->parseHtmlByName('polyglot.html', array(
|
|
|
'content' => $oTemplate->parseHtmlByName('pgt_etemplates_hf.html', array(
|
|
|
'warning' => '',
|
|
|
@@ -187,7 +200,7 @@ class BxBaseStudioPolyglot extends BxDolStudioPolyglot
|
|
|
));
|
|
|
}
|
|
|
|
|
|
- protected function getEtemplatesHtml()
|
|
|
+ protected function _getEtemplatesHtmlEditor()
|
|
|
{
|
|
|
$oTemplate = BxDolStudioTemplate::getInstance();
|
|
|
|
|
|
@@ -223,6 +236,17 @@ class BxBaseStudioPolyglot extends BxDolStudioPolyglot
|
|
|
'name' => 'page',
|
|
|
'value' => $this->sPage
|
|
|
],
|
|
|
+ 'editor' => [
|
|
|
+ 'type' => 'switcher',
|
|
|
+ 'name' => 'editor',
|
|
|
+ 'caption' => _t('_adm_pgt_btn_et_hf_editor'),
|
|
|
+ 'info' => '',
|
|
|
+ 'value' => 'on',
|
|
|
+ 'checked' => $this->isEtEditor(),
|
|
|
+ 'attrs' => [
|
|
|
+ 'onchange' => $this->getPageJsObject() . '.enableEditor(this)'
|
|
|
+ ]
|
|
|
+ ],
|
|
|
'content' => [
|
|
|
'type' => 'custom',
|
|
|
'name' => 'content',
|
|
|
@@ -286,6 +310,11 @@ class BxBaseStudioPolyglot extends BxDolStudioPolyglot
|
|
|
'js_content' => ''
|
|
|
));
|
|
|
}
|
|
|
+
|
|
|
+ protected function isEtEditor()
|
|
|
+ {
|
|
|
+ return getParam($this->sEtSettingEditor) == 'on';
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/** @} */
|