diff --git a/src/Backend.php b/src/Backend.php index e85c4a4..0f4a040 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -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'], diff --git a/src/BackendBehaviors.php b/src/BackendBehaviors.php index 07f22d7..9074bfc 100644 --- a/src/BackendBehaviors.php +++ b/src/BackendBehaviors.php @@ -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. *