aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Files/Template
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/Files/Template')
-rw-r--r--lib/public/Files/Template/BeforeGetTemplatesEvent.php14
-rw-r--r--lib/public/Files/Template/ITemplateManager.php9
-rw-r--r--lib/public/Files/Template/RegisterTemplateCreatorEvent.php1
3 files changed, 23 insertions, 1 deletions
diff --git a/lib/public/Files/Template/BeforeGetTemplatesEvent.php b/lib/public/Files/Template/BeforeGetTemplatesEvent.php
index 006163c5f7f..9fb7453a50c 100644
--- a/lib/public/Files/Template/BeforeGetTemplatesEvent.php
+++ b/lib/public/Files/Template/BeforeGetTemplatesEvent.php
@@ -17,16 +17,19 @@ use OCP\EventDispatcher\Event;
class BeforeGetTemplatesEvent extends Event {
/** @var array<Template> */
private array $templates;
+ /** @var bool */
+ private bool $withFields;
/**
* @param array<Template> $templates
*
* @since 30.0.0
*/
- public function __construct(array $templates) {
+ public function __construct(array $templates, bool $withFields = false) {
parent::__construct();
$this->templates = $templates;
+ $this->withFields = $withFields;
}
/**
@@ -37,4 +40,13 @@ class BeforeGetTemplatesEvent extends Event {
public function getTemplates(): array {
return $this->templates;
}
+
+ /**
+ * @return bool
+ *
+ * @since 32.0.0
+ */
+ public function shouldGetFields(): bool {
+ return $this->withFields;
+ }
}
diff --git a/lib/public/Files/Template/ITemplateManager.php b/lib/public/Files/Template/ITemplateManager.php
index 9a81aa51ceb..df81bc5604e 100644
--- a/lib/public/Files/Template/ITemplateManager.php
+++ b/lib/public/Files/Template/ITemplateManager.php
@@ -39,6 +39,15 @@ interface ITemplateManager {
public function listTemplates(): array;
/**
+ * Get the fields for a given template
+ *
+ * @param int $fileId
+ * @return array
+ * @since 32.0.0
+ */
+ public function listTemplateFields(int $fileId): array;
+
+ /**
* @return bool
* @since 21.0.0
*/
diff --git a/lib/public/Files/Template/RegisterTemplateCreatorEvent.php b/lib/public/Files/Template/RegisterTemplateCreatorEvent.php
index c931f3e2a78..a9e7fa01252 100644
--- a/lib/public/Files/Template/RegisterTemplateCreatorEvent.php
+++ b/lib/public/Files/Template/RegisterTemplateCreatorEvent.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later