fix message editor

This commit is contained in:
Jean-Christian Denis 2023-04-25 21:17:10 +02:00
parent bb69a88a9c
commit 9609e9716e
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
2 changed files with 7 additions and 9 deletions

View file

@ -5,7 +5,6 @@ $(() => {
if (typeof jsToolBar === 'function') {
$('#disclaimer_text').each(function () {
const tbWidgetTextDisclaimer = new jsToolBar(this);
tbWidgetTextDisclaimer.context = 'disclaimer_text';
tbWidgetTextDisclaimer.draw('xhtml');
});
}

View file

@ -14,6 +14,7 @@ declare(strict_types=1);
namespace Dotclear\Plugin\disclaimer;
use ArrayObject;
use dcCore;
use dcPage;
use dcNsProcess;
@ -70,15 +71,13 @@ class Backend extends dcNsProcess
},
'adminBlogPreferencesHeaders' => function (): string {
// nullsafe PHP < 8.0
if (is_null(dcCore::app()->auth)) {
return '';
}
$editor = dcCore::app()->auth->getOption('editor');
return dcPage::jsModuleLoad(My::id() . '/js/backend.js');
},
return
dcCore::app()->callBehavior('adminPostEditor', $editor['xhtml'], 'disclaimer', ['#disclaimer_text'], 'xhtml') .
dcPage::jsModuleLoad(My::id() . '/js/backend.js');
'adminPostEditorTags' => function (string $editor, string $context, ArrayObject $alt_tags, string $format): void {
if ($context == 'blog_desc') {
$alt_tags->append('#disclaimer_text');
}
},
'adminBlogPreferencesFormV2' => function (dcSettings $blog_settings): void {