diff options
author | Julius Härtl <jus@bitgrid.net> | 2021-01-19 13:20:50 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2021-01-28 14:00:20 +0300 |
commit | 7e6d69d166cbc92fb457fc72efc9abe850a0bbe4 (patch) | |
tree | 54328a78dbbd8b4570d7e6913ce4c8291a451a36 /lib/public | |
parent | 66fa3fca8323fe763e4177cc31d3f535802e976a (diff) |
Add templatedirectory config value to let admins have their custom templates by default
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/Files/Template/ITemplateManager.php | 5 | ||||
-rw-r--r-- | lib/public/Files/Template/Template.php | 15 |
2 files changed, 18 insertions, 2 deletions
diff --git a/lib/public/Files/Template/ITemplateManager.php b/lib/public/Files/Template/ITemplateManager.php index 94545c17b41..28d57a8b94c 100644 --- a/lib/public/Files/Template/ITemplateManager.php +++ b/lib/public/Files/Template/ITemplateManager.php @@ -78,10 +78,11 @@ interface ITemplateManager { public function getTemplatePath(): string; /** - * @param string $path + * @param string|null $path + * @param string|null $userId * @since 21.0.0 */ - public function initializeTemplateDirectory(string $path): void; + public function initializeTemplateDirectory(string $path = null, string $userId = null): void; /** * @param string $filePath diff --git a/lib/public/Files/Template/Template.php b/lib/public/Files/Template/Template.php index b5b90e01f89..28fd00d0f83 100644 --- a/lib/public/Files/Template/Template.php +++ b/lib/public/Files/Template/Template.php @@ -28,6 +28,9 @@ namespace OCP\Files\Template; use OCP\Files\File; +/** + * @since 21.0.0 + */ class Template implements \JsonSerializable { protected $templateType; protected $templateId; @@ -35,20 +38,32 @@ class Template implements \JsonSerializable { protected $hasPreview = false; protected $previewUrl; + /** + * @since 21.0.0 + */ final public function __construct(string $templateType, string $templateId, File $file) { $this->templateType = $templateType; $this->templateId = $templateId; $this->file = $file; } + /** + * @since 21.0.0 + */ final public function setCustomPreviewUrl(string $previewUrl): void { $this->previewUrl = $previewUrl; } + /** + * @since 21.0.0 + */ final public function setHasPreview(bool $hasPreview): void { $this->hasPreview = $hasPreview; } + /** + * @since 21.0.0 + */ final public function jsonSerialize() { return [ 'templateType' => $this->templateType, |