Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-11-29 22:13:39 +0300
committerJulius Härtl <jus@bitgrid.net>2019-12-02 14:28:31 +0300
commitc87396aa85c09c2344c3982f87a4e28ea4b7f273 (patch)
tree9ccc8797e3f6c37f1fdbe500d69560c08e0c96b8 /lib
parentc1e009c77b87e0d4caaf1628e5e7a12b99cacde9 (diff)
Remove template creator
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/DirectEditing/TextDirectEditor.php2
-rw-r--r--lib/DirectEditing/TextDocumentCreator.php5
-rw-r--r--lib/DirectEditing/TextDocumentTemplateCreator.php82
3 files changed, 0 insertions, 89 deletions
diff --git a/lib/DirectEditing/TextDirectEditor.php b/lib/DirectEditing/TextDirectEditor.php
index cb6e06879..6bf4026b2 100644
--- a/lib/DirectEditing/TextDirectEditor.php
+++ b/lib/DirectEditing/TextDirectEditor.php
@@ -23,7 +23,6 @@
namespace OCA\Text\DirectEditing;
-use OCA\Files\Controller\ApiController;
use OCA\Text\AppInfo\Application;
use OCA\Text\Service\ApiService;
use OCP\AppFramework\Http\NotFoundResponse;
@@ -106,7 +105,6 @@ class TextDirectEditor implements IEditor {
public function getCreators(): array {
return [
new TextDocumentCreator($this->l10n),
- new TextDocumentTemplateCreator($this->l10n)
];
}
diff --git a/lib/DirectEditing/TextDocumentCreator.php b/lib/DirectEditing/TextDocumentCreator.php
index 2fa1b5472..a8976aa8c 100644
--- a/lib/DirectEditing/TextDocumentCreator.php
+++ b/lib/DirectEditing/TextDocumentCreator.php
@@ -55,9 +55,4 @@ class TextDocumentCreator extends ACreateEmpty {
return 'text/markdown';
}
- public function create(File $file, string $creatorId = null, string $templateId = null): void {
- parent::create($file, $creatorId, $templateId); // TODO: Change the autogenerated stub
-
- $file->putContent('## Empty document with Nextcloud Text');
- }
}
diff --git a/lib/DirectEditing/TextDocumentTemplateCreator.php b/lib/DirectEditing/TextDocumentTemplateCreator.php
deleted file mode 100644
index 6e5668bb7..000000000
--- a/lib/DirectEditing/TextDocumentTemplateCreator.php
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-/**
- * @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net>
- *
- * @author Julius Härtl <jus@bitgrid.net>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-namespace OCA\Text\DirectEditing;
-
-
-use OCP\DirectEditing\ACreateFromTemplate;
-use OCP\Files\File;
-use OCP\IL10N;
-
-class TextDocumentTemplateCreator extends ACreateFromTemplate {
-
- const TEMPLATES = [
- '1' => [
- 'id' => '1',
- 'extension' => 'md',
- 'name' => 'Weekly ToDo',
- 'preview' => 'https://cloud.bitgrid.net/apps/richdocuments/template/preview/832537'
- ],
- '2' => [
- 'id' => '2',
- 'extension' => 'md',
- 'name' => 'Meeting notes',
- 'preview' => 'https://cloud.bitgrid.net/apps/richdocuments/template/preview/832537'
- ]
- ];
-
- /**
- * @var IL10N
- */
- private $l10n;
-
- public function __construct(IL10N $l10n) {
- $this->l10n = $l10n;
- }
-
- public function getId(): string {
- return 'textdocumenttemplate';
- }
-
- public function getName(): string {
- return $this->l10n->t('New text document from template');
- }
-
- public function getExtension(): string {
- return '.md';
- }
-
- public function getTemplates(): array {
- return self::TEMPLATES;
- }
-
- public function getMimetype(): string {
- return 'text/markdown';
- }
-
- public function create(File $file, string $creatorId = null, string $templateId = null): void {
- $template = self::TEMPLATES[$templateId];
- $file->putContent('## ' . $template['name'] . '\n\n' . 'Created from a template with Nextcloud text');
- }
-
-}