mirror of
https://github.com/itflow-org/itflow
synced 2026-12-02 00:59:03 +00:00
Documents in Markdown: a document can be written in Markdown with Write and Preview or in the rich text editor and switched either way, pictures pasted or dropped into the Markdown are kept as files, New Document starts in the way last used, Import Markdown Files beside Upload makes a document from each .md file, a Markdown button beside PDF downloads a document as a .md file, and Markdown pasted into a document's rich text editor goes in as formatting; versions, restore, copy and the API carry the Markdown, and the API's document create and update no longer escape values twice; database 4.2.3 adds documents.document_markdown and document_versions.document_version_markdown, and league/commonmark 2.10 and league/html-to-markdown 5.2 are added to libs/vendor through composer; 26.12.3 changelog entries
This commit is contained in:
@@ -16,7 +16,7 @@ enforceUserPermission('module_support', 2);
|
||||
$document_id = intval($_GET['document_id'] ?? 0);
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT document_client_visible, document_content, document_description, document_folder_id,
|
||||
document_name, document_archived_at FROM documents WHERE document_client_id = $client_id AND document_id = $document_id LIMIT 1"));
|
||||
document_name, document_archived_at, " . documentMarkdownSql() . " FROM documents WHERE document_client_id = $client_id AND document_id = $document_id LIMIT 1"));
|
||||
|
||||
if (!$row || !empty($row['document_archived_at'])) {
|
||||
echo "<div class='text-center'><h1 class='text-secondary mt-5'>Nothing to edit here</h1><a class='btn btn-lg btn-secondary mt-3' href='files.php?client_id=$client_id'><i class='fas fa-fw fa-arrow-left me-2'></i>Back to files</a></div>";
|
||||
@@ -28,6 +28,7 @@ $document_form_mode = 'edit';
|
||||
$document_name = escapeHtml($row['document_name']);
|
||||
$document_description = escapeHtml($row['document_description']);
|
||||
$document_content = escapeHtml($row['document_content']);
|
||||
$document_markdown = $row['document_markdown']; // raw - null for a document in the rich text editor
|
||||
$document_folder_id = intval($row['document_folder_id']);
|
||||
$document_client_visible = intval($row['document_client_visible']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user