From 6b4349a3d5fc1c75ee3601dcf1bdc8fdfd4f49cd Mon Sep 17 00:00:00 2001 From: Craig Heydenburg Date: Thu, 23 Jul 2020 10:07:57 -0400 Subject: [PATCH] add block fixes and hook for scribite use --- Block/Form/Type/FincludeBlockType.php | 5 -- Block/Form/Type/HtmlBlockType.php | 5 -- Block/Form/Type/TextBlockType.php | 5 -- Block/Form/Type/XsltBlockType.php | 5 -- HookSubscriber/UiHooksSubscriber.php | 60 +++++++++++++++++++++ README.md | 4 ++ Resources/views/Block/html_modify.html.twig | 2 +- composer.json | 2 +- 8 files changed, 66 insertions(+), 22 deletions(-) create mode 100644 HookSubscriber/UiHooksSubscriber.php diff --git a/Block/Form/Type/FincludeBlockType.php b/Block/Form/Type/FincludeBlockType.php index fee70b8..4d37027 100644 --- a/Block/Form/Type/FincludeBlockType.php +++ b/Block/Form/Type/FincludeBlockType.php @@ -59,11 +59,6 @@ public function buildForm(FormBuilderInterface $builder, array $options) ; } - public function getBlockPrefix() - { - return 'zikulablocksmodule_fincludeblock'; - } - public function configureOptions(OptionsResolver $resolver) { // add a constraint to the entire form diff --git a/Block/Form/Type/HtmlBlockType.php b/Block/Form/Type/HtmlBlockType.php index 7b27e87..910f258 100644 --- a/Block/Form/Type/HtmlBlockType.php +++ b/Block/Form/Type/HtmlBlockType.php @@ -30,9 +30,4 @@ public function buildForm(FormBuilderInterface $builder, array $options) ]) ; } - - public function getBlockPrefix() - { - return 'zikulablocksmodule_htmlblock'; - } } diff --git a/Block/Form/Type/TextBlockType.php b/Block/Form/Type/TextBlockType.php index 036e65c..7e7df67 100644 --- a/Block/Form/Type/TextBlockType.php +++ b/Block/Form/Type/TextBlockType.php @@ -42,9 +42,4 @@ static function($submittedDescription) { )) ; } - - public function getBlockPrefix() - { - return 'zikulablocksmodule_textblock'; - } } diff --git a/Block/Form/Type/XsltBlockType.php b/Block/Form/Type/XsltBlockType.php index ad81201..9698374 100644 --- a/Block/Form/Type/XsltBlockType.php +++ b/Block/Form/Type/XsltBlockType.php @@ -75,11 +75,6 @@ public function configureOptions(OptionsResolver $resolver) ]); } - public function getBlockPrefix() - { - return 'zikulablocksmodule_xsltblock'; - } - /** * Validation method for entire form. */ diff --git a/HookSubscriber/UiHooksSubscriber.php b/HookSubscriber/UiHooksSubscriber.php new file mode 100644 index 0000000..0fd645b --- /dev/null +++ b/HookSubscriber/UiHooksSubscriber.php @@ -0,0 +1,60 @@ +translator = $translator; + } + + public function getOwner(): string + { + return 'ZikulaStaticContentModule'; + } + + public function getCategory(): string + { + return UiHooksCategory::NAME; + } + + public function getTitle(): string + { + return $this->translator->trans('HTML Block content hook'); + } + + public function getAreaName(): string + { + return 'subscriber.staticcontentmodule.ui_hooks.htmlblock_content'; + } + + public function getEvents(): array + { + return [ + UiHooksCategory::TYPE_FORM_EDIT => self::HTMLBLOCK_EDIT_FORM + ]; + } +} diff --git a/README.md b/README.md index 16e97db..155f0b1 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,7 @@ as restricted as the use above for full page display. Other blocks are documente In Core 3.0.1 you can use the Routes module to create a custom route to the template. So, instead of `/p/foo` you could use simply `/foo` or `/smile` or anything you like. + +## Changelog +#### 1.0.1 + - added hook for html block diff --git a/Resources/views/Block/html_modify.html.twig b/Resources/views/Block/html_modify.html.twig index 68ec9e1..89d019e 100644 --- a/Resources/views/Block/html_modify.html.twig +++ b/Resources/views/Block/html_modify.html.twig @@ -1,2 +1,2 @@ {{ form_widget(form) }} -{{ notifyDisplayHooks(constant('Zikula\\BlocksModule\\HookSubscriber\\UiHooksSubscriber::HTMLBLOCK_EDIT_FORM'), form.vars.value.bid|default(null)) }} +{{ notifyDisplayHooks(constant('Zikula\\StaticContentModule\\HookSubscriber\\UiHooksSubscriber::HTMLBLOCK_EDIT_FORM'), form.vars.value.bid|default(null)) }} diff --git a/composer.json b/composer.json index 1c9473e..2719890 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "zikula/staticcontent-module", - "version": "1.0.0", + "version": "1.0.1", "description": "Display static content simply.", "type": "zikula-module", "license": "MIT",