diff --git a/Module.php b/Module.php index 992b16c..04e6632 100644 --- a/Module.php +++ b/Module.php @@ -12,6 +12,8 @@ class Module extends \humhub\components\Module { + public $resourcesPath = 'resources'; + /** * @var array Allowed text extensions with mime types */ diff --git a/controllers/EditController.php b/controllers/EditController.php index 9123f59..8e4ac80 100644 --- a/controllers/EditController.php +++ b/controllers/EditController.php @@ -41,6 +41,7 @@ public function actionIndex() return $this->renderAjax('index', [ 'fileUpdate' => $fileUpdate, + 'file' => $file ]); } diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index f0d3ff7..c7f0e57 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,7 +1,7 @@ Changelog ========= -0.0.1 - Unreleased +1.0.0 - Unreleased ------------------------- - Init: Initialize Module "Text editor" - Fix #5: Position of "Edit" Handler diff --git a/docs/README.md b/docs/README.md index 4c80f6d..7541791 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,3 +1,5 @@ # Text editor -File handler for edit text files with extensions `txt`, `log`, `xml`. +A simple plain text editor module. Text files can be created, edited or viewed. + +Especially useful in combination with the Files module. Here also a versioning of the text files is supported. diff --git a/module.json b/module.json index 82aac1f..843ccb9 100644 --- a/module.json +++ b/module.json @@ -1,9 +1,9 @@ { "id": "text-editor", "name": "Text editor", - "description": "Text editor.", - "keywords": ["text editor"], - "version": "0.0.1", + "description": "A simple plain text file editor for the File module.", + "keywords": ["text editor", "text", "editor", "filehandler"], + "version": "1.0.0", "humhub": { "minVersion": "1.10" } diff --git a/views/edit/index.php b/views/edit/index.php index fa5e59d..b3086d0 100644 --- a/views/edit/index.php +++ b/views/edit/index.php @@ -13,21 +13,19 @@ use humhub\widgets\ModalDialog; /* @var $fileUpdate FileUpdate */ +/* @var $file \humhub\modules\file\models\File */ Assets::register($this); ?> Yii::t('TextEditorModule.base', 'Edit file', ['fileName' => Html::encode($fileUpdate->file->file_name)]), + 'header' => Yii::t('TextEditorModule.base', 'Edit file: {fileName}', ['fileName' => Html::encode($file->file_name)]), 'options' => ['style' => 'width:95%'], ]) ?>
'post', 'acknowledge' => true]) ?>