From e04638ae4afc7e5f5faa52c008dca64bebdd4f39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Fri, 9 Feb 2024 00:18:19 +0100 Subject: [PATCH 1/2] add ace editor --- admin/template_editor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/template_editor.php b/admin/template_editor.php index 7890092..165865b 100644 --- a/admin/template_editor.php +++ b/admin/template_editor.php @@ -98,7 +98,7 @@ $linkback = ''; $linkback .= $langs->trans("BackToModuleList") . ''; -print load_fiche_titre($langs->trans('EasydocgeneratorConfig'), $linkback, 'tools'); +//print load_fiche_titre($langs->trans('EasydocgeneratorConfig'), $linkback, 'tools'); $head = easydocgeneratorAdminPrepareHead(); @@ -120,7 +120,7 @@ print dol_get_fiche_head($head, 'editor', $langs->trans('Settings'), -1, 'technic'); -$doleditor = new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%', ''); +$doleditor = new DolEditor('editfilecontent', $content, '', '500', 'Full', 'In', true, false, 'ace', 0, '99%', ''); print $doleditor->Create(1, '', false, $langs->trans("File") . ' : ' . $file, (GETPOST('format', 'aZ09') ? GETPOST('format', 'aZ09') : 'html')); print dol_get_fiche_end(); From 04cd748bcece9bb8a0fba07a0c3b3574adedc57c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Fri, 9 Feb 2024 00:23:01 +0100 Subject: [PATCH 2/2] add ace editor --- admin/template_editor.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/admin/template_editor.php b/admin/template_editor.php index 165865b..70e174b 100644 --- a/admin/template_editor.php +++ b/admin/template_editor.php @@ -60,14 +60,14 @@ // Save old version if (dol_is_file($pathoffile)) { - dol_copy($pathoffile, $pathoffile . '.back', 0, 1); + dol_copy($pathoffile, $pathoffile . '.back', 0, 1, 0, 1); } $content = GETPOST('editfilecontent', 'none'); // Save file on disk if ($content) { - dol_delete_file($pathoffile); + dol_delete_file($pathoffile, 0, 0, 0, null, false, 1); $result = file_put_contents($pathoffile, $content); if ($result) { dolChmod($pathoffile, $newmask); @@ -78,8 +78,7 @@ } } else { setEventMessages($langs->trans("ContentCantBeEmpty"), null, 'errors'); - //$action='editfile'; - $error++; + $action = ''; } }