use new behaviors adminPostEditorTags

This commit is contained in:
Jean-Christian Denis 2023-04-25 20:59:59 +02:00
parent 4c6eef040f
commit 0cf94448ea
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
2 changed files with 17 additions and 1 deletions

View file

@ -67,6 +67,7 @@ class Backend extends dcNsProcess
'adminBeforeBlogSettingsUpdate' => [BackendBehaviors::class, 'adminBeforeBlogSettingsUpdate'],
// post
'adminPostHeaders' => [BackendBehaviors::class, 'adminPostHeaders'],
'adminPostEditorTags' => [BackendBehaviors::class, 'adminPostEditorTags'],
'adminPostFormItems' => [BackendBehaviors::class, 'adminPostFormItems'],
'adminAfterPostUpdate' => [BackendBehaviors::class, 'adminAfterPostSave'],
'adminAfterPostCreate' => [BackendBehaviors::class, 'adminAfterPostSave'],

View file

@ -156,10 +156,25 @@ class BackendBehaviors
$editor = dcCore::app()->auth->getOption('editor');
return
dcCore::app()->callBehavior('adminPostEditor', $editor['xhtml'], 'pwt', ['#post_wtext'], 'xhtml') .
//dcCore::app()->callBehavior('adminPostEditor', $editor['xhtml'], 'pwt', ['#post_wtext'], 'xhtml') .
dcPage::jsModuleLoad(My::id() . '/js/backend.js');
}
/**
* Add editor to post tags.
*
* @param string $editor The editor name (ie dcCKEditor)
* @param string $context The editor context (ie post)
* @param ArrayObject $alt_tags The editor target (ie textarea id)
* @param string $format The editor format (ie xhtml)
*/
public static function adminPostEditorTags(string $editor, string $context, ArrayObject $alt_tags, string $format): void
{
if ($context == 'post') {
$alltgas[] = '#post_wtext';
}
}
/**
* Add widget text form to post edition page.
*