10
10
11
11
use Craft ;
12
12
use craft \base \Element ;
13
+ use craft \base \Model ;
13
14
use craft \base \Plugin ;
14
15
use craft \elements \actions \Edit ;
15
16
use craft \events \RegisterCpNavItemsEvent ;
16
17
use craft \events \RegisterElementActionsEvent ;
17
18
use craft \events \RegisterUrlRulesEvent ;
19
+ use craft \gatsbyhelper \events \RegisterIgnoredTypesEvent ;
20
+ use craft \gatsbyhelper \services \Deltas ;
18
21
use craft \web \twig \variables \Cp ;
19
22
use craft \web \UrlManager ;
20
23
use ether \tagManager \elements \actions \Delete ;
24
27
use Twig \Error \RuntimeError ;
25
28
use Twig \Error \SyntaxError ;
26
29
use yii \base \Event ;
30
+ use yii \base \Exception ;
27
31
28
32
/**
29
33
* Class Tags
@@ -71,6 +75,14 @@ public function init ()
71
75
[$ this , 'onRegisterCpNavItems ' ]
72
76
);
73
77
78
+ if (class_exists (Deltas::class)) {
79
+ Event::on (
80
+ Deltas::class,
81
+ Deltas::EVENT_REGISTER_IGNORED_TYPES ,
82
+ [$ this , 'onRegisterIgnoredTypes ' ]
83
+ );
84
+ }
85
+
74
86
}
75
87
76
88
// Craft
@@ -86,13 +98,13 @@ public function getCpNavItem ()
86
98
return $ item ;
87
99
}
88
100
89
- protected function createSettingsModel ()
101
+ protected function createSettingsModel (): Settings
90
102
{
91
103
return new Settings ();
92
104
}
93
105
94
106
/**
95
- * @return bool|Settings |null
107
+ * @return bool|Model |null
96
108
*/
97
109
public function getSettings ()
98
110
{
@@ -103,7 +115,7 @@ public function getSettings ()
103
115
* @return string|null
104
116
* @throws LoaderError
105
117
* @throws RuntimeError
106
- * @throws SyntaxError
118
+ * @throws SyntaxError|Exception
107
119
*/
108
120
protected function settingsHtml ()
109
121
{
@@ -162,4 +174,9 @@ public function onRegisterCpNavItems (RegisterCpNavItemsEvent $event)
162
174
$ event ->navItems = $ navItems ;
163
175
}
164
176
177
+ public function onRegisterIgnoredTypes (RegisterIgnoredTypesEvent $ event )
178
+ {
179
+ $ event ->types [] = Tag::class;
180
+ }
181
+
165
182
}
0 commit comments