Skip to content
This repository was archived by the owner on Aug 18, 2022. It is now read-only.

Commit 6b4349a

Browse files
committed
add block fixes and hook for scribite use
1 parent 4e660e0 commit 6b4349a

File tree

8 files changed

+66
-22
lines changed

8 files changed

+66
-22
lines changed

Block/Form/Type/FincludeBlockType.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
5959
;
6060
}
6161

62-
public function getBlockPrefix()
63-
{
64-
return 'zikulablocksmodule_fincludeblock';
65-
}
66-
6762
public function configureOptions(OptionsResolver $resolver)
6863
{
6964
// add a constraint to the entire form

Block/Form/Type/HtmlBlockType.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,4 @@ public function buildForm(FormBuilderInterface $builder, array $options)
3030
])
3131
;
3232
}
33-
34-
public function getBlockPrefix()
35-
{
36-
return 'zikulablocksmodule_htmlblock';
37-
}
3833
}

Block/Form/Type/TextBlockType.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,4 @@ static function($submittedDescription) {
4242
))
4343
;
4444
}
45-
46-
public function getBlockPrefix()
47-
{
48-
return 'zikulablocksmodule_textblock';
49-
}
5045
}

Block/Form/Type/XsltBlockType.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ public function configureOptions(OptionsResolver $resolver)
7575
]);
7676
}
7777

78-
public function getBlockPrefix()
79-
{
80-
return 'zikulablocksmodule_xsltblock';
81-
}
82-
8378
/**
8479
* Validation method for entire form.
8580
*/
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the ZikulaModules\StaticContentModule package.
7+
*
8+
* Copyright Zikula - https://ziku.la/
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
14+
namespace Zikula\StaticContentModule\HookSubscriber;
15+
16+
use Symfony\Contracts\Translation\TranslatorInterface;
17+
use Zikula\Bundle\HookBundle\Category\UiHooksCategory;
18+
use Zikula\Bundle\HookBundle\HookSubscriberInterface;
19+
20+
class UiHooksSubscriber implements HookSubscriberInterface
21+
{
22+
public const HTMLBLOCK_EDIT_FORM = 'staticcontent.ui_hooks.htmlblock.content.form_edit';
23+
24+
/**
25+
* @var TranslatorInterface
26+
*/
27+
private $translator;
28+
29+
public function __construct(TranslatorInterface $translator)
30+
{
31+
$this->translator = $translator;
32+
}
33+
34+
public function getOwner(): string
35+
{
36+
return 'ZikulaStaticContentModule';
37+
}
38+
39+
public function getCategory(): string
40+
{
41+
return UiHooksCategory::NAME;
42+
}
43+
44+
public function getTitle(): string
45+
{
46+
return $this->translator->trans('HTML Block content hook');
47+
}
48+
49+
public function getAreaName(): string
50+
{
51+
return 'subscriber.staticcontentmodule.ui_hooks.htmlblock_content';
52+
}
53+
54+
public function getEvents(): array
55+
{
56+
return [
57+
UiHooksCategory::TYPE_FORM_EDIT => self::HTMLBLOCK_EDIT_FORM
58+
];
59+
}
60+
}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ as restricted as the use above for full page display. Other blocks are documente
2121

2222
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
2323
use simply `/foo` or `/smile` or anything you like.
24+
25+
## Changelog
26+
#### 1.0.1
27+
- added hook for html block
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
{{ form_widget(form) }}
2-
{{ notifyDisplayHooks(constant('Zikula\\BlocksModule\\HookSubscriber\\UiHooksSubscriber::HTMLBLOCK_EDIT_FORM'), form.vars.value.bid|default(null)) }}
2+
{{ notifyDisplayHooks(constant('Zikula\\StaticContentModule\\HookSubscriber\\UiHooksSubscriber::HTMLBLOCK_EDIT_FORM'), form.vars.value.bid|default(null)) }}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zikula/staticcontent-module",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Display static content simply.",
55
"type": "zikula-module",
66
"license": "MIT",

0 commit comments

Comments
 (0)