Skip to content

Commit

Permalink
Merge pull request #45 from frederic34/dev
Browse files Browse the repository at this point in the history
ace editor
  • Loading branch information
frederic34 authored Feb 8, 2024
2 parents 545b140 + 04cd748 commit 93de5e7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions admin/template_editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -78,8 +78,7 @@
}
} else {
setEventMessages($langs->trans("ContentCantBeEmpty"), null, 'errors');
//$action='editfile';
$error++;
$action = '';
}
}

Expand All @@ -98,7 +97,7 @@

$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">';
$linkback .= $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans('EasydocgeneratorConfig'), $linkback, 'tools');
//print load_fiche_titre($langs->trans('EasydocgeneratorConfig'), $linkback, 'tools');

$head = easydocgeneratorAdminPrepareHead();

Expand All @@ -120,7 +119,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();
Expand Down

0 comments on commit 93de5e7

Please sign in to comment.