mirror of
https://github.com/Karaka-Management/oms-Editor.git
synced 2026-01-11 09:08:42 +00:00
Went through todos
This commit is contained in:
parent
e3aa0edec8
commit
cdb9bb90d5
|
|
@ -111,6 +111,11 @@
|
|||
"name": "editor_doc_visible",
|
||||
"type": "TINYINT",
|
||||
"null": false
|
||||
},
|
||||
"editor_doc_encrypted": {
|
||||
"name": "editor_doc_encrypted",
|
||||
"type": "TINYINT",
|
||||
"null": false
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ use phpOMS\Message\Http\RequestStatusCode;
|
|||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\Model\Html\Head;
|
||||
use phpOMS\Security\EncryptionHelper;
|
||||
use phpOMS\System\MimeType;
|
||||
use phpOMS\Utils\Parser\Markdown\Markdown;
|
||||
use phpOMS\Views\View;
|
||||
|
|
@ -196,6 +197,15 @@ final class ApiController extends Controller
|
|||
$doc->createdBy = new NullAccount($request->header->account);
|
||||
$doc->version = $request->getDataString('version') ?? '';
|
||||
$doc->setVirtualPath($request->getDataString('virtualpath') ?? '/');
|
||||
$doc->isEncrypted = $request->getDataBool('isencrypted') ?? false;
|
||||
$doc->isVisible = $request->getDataBool('isvisible') ?? true;
|
||||
|
||||
if ($request->getDataBool('isencrypted')
|
||||
&& !empty($_SERVER['OMS_PRIVATE_KEY_I'] ?? '')
|
||||
) {
|
||||
$doc->plain = EncryptionHelper::encryptShared($doc->plain, $_SERVER['OMS_PRIVATE_KEY_I']);
|
||||
$doc->content = EncryptionHelper::encryptShared($doc->content, $_SERVER['OMS_PRIVATE_KEY_I']);
|
||||
}
|
||||
|
||||
if ($request->hasData('tags')) {
|
||||
$doc->tags = $this->app->moduleManager->get('Tag', 'Api')->createTagsFromRequest($request);
|
||||
|
|
|
|||
|
|
@ -93,6 +93,14 @@ class EditorDoc implements \JsonSerializable
|
|||
*/
|
||||
public bool $isVisible = true;
|
||||
|
||||
/**
|
||||
* Doc is encrypted.
|
||||
*
|
||||
* @var bool
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public bool $isEncrypted = false;
|
||||
|
||||
/**
|
||||
* Created.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ final class EditorDocMapper extends DataMapperFactory
|
|||
'editor_doc_created_at' => ['name' => 'editor_doc_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt'],
|
||||
'editor_doc_created_by' => ['name' => 'editor_doc_created_by', 'type' => 'int', 'internal' => 'createdBy'],
|
||||
'editor_doc_visible' => ['name' => 'editor_doc_visible', 'type' => 'bool', 'internal' => 'isVisible'],
|
||||
'editor_doc_encrypted' => ['name' => 'editor_doc_encrypted', 'type' => 'bool', 'internal' => 'isEncrypted'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Editor
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*
|
||||
* @todo Create immediate text preview similar to a rich text editor or Typora
|
||||
* https://github.com/Karaka-Management/oms-Editor/issues/4
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
?>
|
||||
<div id="<?= $this->renderId(); ?>" class="tabview tab-2 m-editor wf-100">
|
||||
<ul class="tab-links">
|
||||
<li><label tabindex="0" for="<?= $this->renderId(); ?>-c-tab-1"><?= $this->getHtml('Text', 'Editor'); ?></label>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user