File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 431431 'OCP \\Files \\Template \\FileCreatedFromTemplateEvent ' => $ baseDir . '/lib/public/Files/Template/FileCreatedFromTemplateEvent.php ' ,
432432 'OCP \\Files \\Template \\ICustomTemplateProvider ' => $ baseDir . '/lib/public/Files/Template/ICustomTemplateProvider.php ' ,
433433 'OCP \\Files \\Template \\ITemplateManager ' => $ baseDir . '/lib/public/Files/Template/ITemplateManager.php ' ,
434+ 'OCP \\Files \\Template \\RegisterTemplateCreatorEvent ' => $ baseDir . '/lib/public/Files/Template/RegisterTemplateCreatorEvent.php ' ,
434435 'OCP \\Files \\Template \\Template ' => $ baseDir . '/lib/public/Files/Template/Template.php ' ,
435436 'OCP \\Files \\Template \\TemplateFileCreator ' => $ baseDir . '/lib/public/Files/Template/TemplateFileCreator.php ' ,
436437 'OCP \\Files \\UnseekableException ' => $ baseDir . '/lib/public/Files/UnseekableException.php ' ,
Original file line number Diff line number Diff line change @@ -464,6 +464,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
464464 'OCP \\Files \\Template \\FileCreatedFromTemplateEvent ' => __DIR__ . '/../../.. ' . '/lib/public/Files/Template/FileCreatedFromTemplateEvent.php ' ,
465465 'OCP \\Files \\Template \\ICustomTemplateProvider ' => __DIR__ . '/../../.. ' . '/lib/public/Files/Template/ICustomTemplateProvider.php ' ,
466466 'OCP \\Files \\Template \\ITemplateManager ' => __DIR__ . '/../../.. ' . '/lib/public/Files/Template/ITemplateManager.php ' ,
467+ 'OCP \\Files \\Template \\RegisterTemplateCreatorEvent ' => __DIR__ . '/../../.. ' . '/lib/public/Files/Template/RegisterTemplateCreatorEvent.php ' ,
467468 'OCP \\Files \\Template \\Template ' => __DIR__ . '/../../.. ' . '/lib/public/Files/Template/Template.php ' ,
468469 'OCP \\Files \\Template \\TemplateFileCreator ' => __DIR__ . '/../../.. ' . '/lib/public/Files/Template/TemplateFileCreator.php ' ,
469470 'OCP \\Files \\UnseekableException ' => __DIR__ . '/../../.. ' . '/lib/public/Files/UnseekableException.php ' ,
Original file line number Diff line number Diff line change 4040use OCP \Files \Template \FileCreatedFromTemplateEvent ;
4141use OCP \Files \Template \ICustomTemplateProvider ;
4242use OCP \Files \Template \ITemplateManager ;
43+ use OCP \Files \Template \RegisterTemplateCreatorEvent ;
4344use OCP \Files \Template \Template ;
4445use OCP \Files \Template \TemplateFileCreator ;
4546use OCP \IConfig ;
@@ -119,6 +120,7 @@ public function getTypes(): array {
119120 if (!empty ($ this ->types )) {
120121 return $ this ->types ;
121122 }
123+ $ this ->eventDispatcher ->dispatchTyped (new RegisterTemplateCreatorEvent ($ this ));
122124 foreach ($ this ->registeredTypes as $ registeredType ) {
123125 $ this ->types [] = $ registeredType ();
124126 }
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * @copyright Copyright (c) 2024 Julius Härtl <jus@bitgrid.net>
4+ *
5+ * @author Julius Härtl <jus@bitgrid.net>
6+ *
7+ * @license GNU AGPL version 3 or any later version
8+ *
9+ * This program is free software: you can redistribute it and/or modify
10+ * it under the terms of the GNU Affero General Public License as
11+ * published by the Free Software Foundation, either version 3 of the
12+ * License, or (at your option) any later version.
13+ *
14+ * This program is distributed in the hope that it will be useful,
15+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+ * GNU Affero General Public License for more details.
18+ *
19+ * You should have received a copy of the GNU Affero General Public License
20+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21+ */
22+
23+ namespace OCP \Files \Template ;
24+
25+ use OCP \EventDispatcher \Event ;
26+
27+ /**
28+ * @since 30.0.0
29+ */
30+ class RegisterTemplateCreatorEvent extends Event {
31+
32+ /**
33+ * @since 30.0.0
34+ */
35+ public function __construct (
36+ private ITemplateManager $ templateManager
37+ ) {
38+ }
39+
40+ /**
41+ * @since 30.0.0
42+ */
43+ public function getTemplateManager (): ITemplateManager {
44+ return $ this ->templateManager ;
45+ }
46+ }
You can’t perform that action at this time.
0 commit comments