summaryrefslogtreecommitdiffstats
path: root/lib/public/Files
diff options
context:
space:
mode:
authorElizabeth Danzberger <lizzy7128@tutanota.de>2024-06-27 14:06:32 -0400
committerJulius Härtl <jus@bitgrid.net>2024-07-25 11:11:38 +0200
commitd939858e3dfd398017ae1b47e75508dc1945b817 (patch)
tree80d165d92d31b0d9ea26241797b3d30281cb4864 /lib/public/Files
parentea7eeb28674512921e440a729402fa11da5e5311 (diff)
downloadnextcloud-server-d939858e3dfd398017ae1b47e75508dc1945b817.tar.gz
nextcloud-server-d939858e3dfd398017ae1b47e75508dc1945b817.zip
feat: Template fields
Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de> fix: Composer dump Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de> fix: Add field array to template class Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
Diffstat (limited to 'lib/public/Files')
-rw-r--r--lib/public/Files/Template/Field.php18
-rw-r--r--lib/public/Files/Template/FieldType.php12
-rw-r--r--lib/public/Files/Template/Template.php14
3 files changed, 43 insertions, 1 deletions
diff --git a/lib/public/Files/Template/Field.php b/lib/public/Files/Template/Field.php
new file mode 100644
index 00000000000..35e937da78f
--- /dev/null
+++ b/lib/public/Files/Template/Field.php
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\Files\Template;
+
+use OCP\Files\Template\FieldType;
+
+class Field {
+ public FieldType $type;
+
+ public function __construct(FieldType $type) {
+ $this->type = $type;
+ }
+} \ No newline at end of file
diff --git a/lib/public/Files/Template/FieldType.php b/lib/public/Files/Template/FieldType.php
new file mode 100644
index 00000000000..27873aa9067
--- /dev/null
+++ b/lib/public/Files/Template/FieldType.php
@@ -0,0 +1,12 @@
+<?php
+
+/**
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\Files\Template;
+
+enum FieldType {
+ case PlainText;
+} \ No newline at end of file
diff --git a/lib/public/Files/Template/Template.php b/lib/public/Files/Template/Template.php
index 94f5cec268f..3bebab2c3a8 100644
--- a/lib/public/Files/Template/Template.php
+++ b/lib/public/Files/Template/Template.php
@@ -9,6 +9,8 @@ declare(strict_types=1);
namespace OCP\Files\Template;
use OCP\Files\File;
+use OCP\Files\Template\Field;
+use OCP\Files\Template\FieldType;
/**
* @since 21.0.0
@@ -24,6 +26,8 @@ final class Template implements \JsonSerializable {
private $hasPreview = false;
/** @var string|null */
private $previewUrl = null;
+ /** @var array */
+ private $fields = [];
/**
* @since 21.0.0
@@ -49,6 +53,13 @@ final class Template implements \JsonSerializable {
}
/**
+ * @since 30.0.0
+ */
+ public function setFields(array $fields): void {
+ $this->fields = $fields;
+ }
+
+ /**
* @since 21.0.0
*/
public function jsonSerialize(): array {
@@ -64,7 +75,8 @@ final class Template implements \JsonSerializable {
'size' => $this->file->getSize(),
'type' => $this->file->getType(),
'hasPreview' => $this->hasPreview,
- 'previewUrl' => $this->previewUrl
+ 'previewUrl' => $this->previewUrl,
+ 'fields' => $this->fields
];
}
}