File tree Expand file tree Collapse file tree 3 files changed +3
-19
lines changed Expand file tree Collapse file tree 3 files changed +3
-19
lines changed Original file line number Diff line number Diff line change @@ -49,14 +49,6 @@ public function renderView(array $parameters): string
49
49
);
50
50
}
51
51
52
- /**
53
- * @param array<string, mixed> $parameters
54
- */
55
- public function isEnabled (array $ parameters ): bool
56
- {
57
- return true ;
58
- }
59
-
60
52
abstract public function getTemplate (): string ;
61
53
62
54
/**
Original file line number Diff line number Diff line change 13
13
use Ibexa \AdminUi \Tab \Event \TabGroupEvent ;
14
14
use Ibexa \AdminUi \Tab \TabGroup ;
15
15
use Ibexa \Contracts \AdminUi \Component \Renderable ;
16
- use Ibexa \Contracts \AdminUi \Tab \AbstractEventDispatchingTab ;
17
16
use Ibexa \Contracts \AdminUi \Tab \TabInterface ;
18
17
use Symfony \Contracts \EventDispatcher \EventDispatcherInterface ;
19
18
use Twig \Environment ;
@@ -65,14 +64,6 @@ public function render(array $parameters = []): string
65
64
foreach ($ tabGroupEvent ->getData ()->getTabs () as $ tab ) {
66
65
$ tabEvent = $ this ->dispatchTabPreRenderEvent ($ tab , $ parameters );
67
66
$ parameters = array_merge ($ parameters , $ tabGroupEvent ->getParameters (), $ tabEvent ->getParameters ());
68
- // BC Safe: @todo move AbstractEventDispatchingTab::isEnabled to TabInterface
69
- $ isEnabled = $ tab instanceof AbstractEventDispatchingTab
70
- ? $ tab ->isEnabled ($ parameters )
71
- : true ;
72
-
73
- if ($ isEnabled ) {
74
- $ tabs [] = $ this ->composeTabParameters ($ tabEvent ->getData (), $ parameters );
75
- }
76
67
}
77
68
78
69
return $ this ->twig ->render (
Original file line number Diff line number Diff line change 9
9
namespace Ibexa \AdminUi \Tab \LocationView ;
10
10
11
11
use Ibexa \Contracts \AdminUi \Tab \AbstractEventDispatchingTab ;
12
+ use Ibexa \Contracts \AdminUi \Tab \ConditionalTabInterface ;
12
13
use Ibexa \Contracts \AdminUi \Tab \OrderedTabInterface ;
13
14
use Ibexa \Contracts \Core \Repository \LocationService ;
14
15
use JMS \TranslationBundle \Annotation \Desc ;
15
16
use Symfony \Component \EventDispatcher \EventDispatcherInterface ;
16
17
use Symfony \Contracts \Translation \TranslatorInterface ;
17
18
use Twig \Environment ;
18
19
19
- class SubItemsTab extends AbstractEventDispatchingTab implements OrderedTabInterface
20
+ class SubItemsTab extends AbstractEventDispatchingTab implements OrderedTabInterface, ConditionalTabInterface
20
21
{
21
22
private LocationService $ locationService ;
22
23
@@ -54,7 +55,7 @@ public function getTemplate(): string
54
55
return '@ibexadesign/content/tab/sub_items.html.twig ' ;
55
56
}
56
57
57
- public function isEnabled (array $ parameters ): bool
58
+ public function evaluate (array $ parameters ): bool
58
59
{
59
60
/** @var \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType $contentType */
60
61
$ contentType = $ parameters ['contentType ' ];
You can’t perform that action at this time.
0 commit comments