From 85979e78995438eedc1a47d1d7b63e77dc326a05 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 17 Nov 2025 07:06:27 +0100 Subject: [PATCH 01/12] add better command help --- utils/Commands/RepositoryextensionCommand.php | 2 +- utils/Commands/UpdateextensionCommand.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/Commands/RepositoryextensionCommand.php b/utils/Commands/RepositoryextensionCommand.php index f50e5d247..b1f4805a0 100644 --- a/utils/Commands/RepositoryextensionCommand.php +++ b/utils/Commands/RepositoryextensionCommand.php @@ -41,7 +41,7 @@ class RepositoryextensionCommand extends Command { $this->setName('ext:repository') ->setDescription('Get list of extensions from repository') - ->setHelp('') + ->setHelp('Retrieves the list of extensions from the repository and checks which of them can be updated or installed. If --url is not set, the repository url from the SeedDMS configuraton is used.') ->addOption('url', '', InputOption::VALUE_REQUIRED, 'Url of repository.', null) ; } diff --git a/utils/Commands/UpdateextensionCommand.php b/utils/Commands/UpdateextensionCommand.php index e73e4afc1..ca15cbf9c 100644 --- a/utils/Commands/UpdateextensionCommand.php +++ b/utils/Commands/UpdateextensionCommand.php @@ -41,7 +41,7 @@ class UpdateextensionCommand extends Command { $this->setName('ext:update') ->setDescription('Check for extension upates') - ->setHelp('') + ->setHelp('Retrieves the list of extensions from the repository and offers to either update or install those extension, which met the dependencies. If --url is not set, the repository url from the SeedDMS configuraton is used.') ->addOption('url', '', InputOption::VALUE_REQUIRED, 'Url of repository.', null) ; } @@ -106,7 +106,7 @@ class UpdateextensionCommand extends Command $output->writeln(sprintf("Update extension '%s' to version %s.", $extname, $answer)); if ($tmpfile = $extmgr->getExtensionFromRepository($update[$answer]['filename'])) { - if (0&&!$extmgr->updateExtension($tmpfile)) { + if (!$extmgr->updateExtension($tmpfile)) { foreach ($extmgr->getErrorMsgs() as $msg) { $output->writeln(sprintf("%s", $msg)); } @@ -135,7 +135,7 @@ class UpdateextensionCommand extends Command $output->writeln(sprintf("Install extension '%s' to version %s.", $extname, $answer)); if ($tmpfile = $extmgr->getExtensionFromRepository($install[$answer]['filename'])) { - if (0&&!$extmgr->updateExtension($tmpfile)) { + if (!$extmgr->updateExtension($tmpfile)) { foreach ($extmgr->getErrorMsgs() as $msg) { $output->writeln(sprintf("%s", $msg)); } From 3d9bdb02a09761b844d88c1ca9a15f2cd7507c91 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 17 Nov 2025 07:06:45 +0100 Subject: [PATCH 02/12] create extension configuration after updating an extension --- inc/inc.ClassExtensionMgr.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inc/inc.ClassExtensionMgr.php b/inc/inc.ClassExtensionMgr.php index e83b2f928..3f7a3577e 100644 --- a/inc/inc.ClassExtensionMgr.php +++ b/inc/inc.ClassExtensionMgr.php @@ -591,6 +591,11 @@ $EXT_CONF = '.var_export($EXT_CONF, true).';'); return false; } + if (!$this->createExtensionConf()) { +// $this->errmsgs[] = "Cannot update extension configuration"; +// return false; + } + return true; } /* }}} */ From 2f968f90e0fec387471463855570293e52224e90 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 17 Nov 2025 14:24:30 +0100 Subject: [PATCH 03/12] add ClassExtensionMgr and ClassExtBase to classmap --- composer-dist.json | 28 +++++++++++++++------------- composer.json | 4 +++- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/composer-dist.json b/composer-dist.json index ef9159626..43c57b780 100644 --- a/composer-dist.json +++ b/composer-dist.json @@ -19,19 +19,21 @@ } }, "autoload": { - "psr-4": { - "SeedDMS\\Console\\": "seeddms/utils" - }, - "classmap": [ - "seeddms/inc/inc.ClassTranslator.php", - "seeddms/inc/inc.ClassSettings.php", - "seeddms/inc/inc.Version.php", - "seeddms/inc/inc.ClassViewCommon.php", - "seeddms/inc/inc.ClassControllerCommon.php", - "seeddms/inc/inc.ClassController.php", - "seeddms/inc/inc.ClassSession.php", - "seeddms/inc/inc.ClassUtilities.php" - ] + "psr-4": { + "SeedDMS\\Console\\": "seeddms/utils" + }, + "classmap": [ + "seeddms/inc/inc.ClassTranslator.php", + "seeddms/inc/inc.ClassSettings.php", + "seeddms/inc/inc.Version.php", + "seeddms/inc/inc.ClassViewCommon.php", + "seeddms/inc/inc.ClassControllerCommon.php", + "seeddms/inc/inc.ClassController.php", + "seeddms/inc/inc.ClassSession.php", + "seeddms/inc/inc.ClassUtilities.php", + "seeddms/inc/inc.ClassExtensionMgr.php", + "seeddms/inc/inc.ClassExtBase.php" + ] }, "require": { "pear/http_request2": "^2", diff --git a/composer.json b/composer.json index 97335a73e..91a5712e9 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,9 @@ "inc/inc.ClassControllerCommon.php", "inc/inc.ClassController.php", "inc/inc.ClassSession.php", - "inc/inc.ClassUtilities.php" + "inc/inc.ClassUtilities.php", + "inc/inc.ClassExtensionMgr.php", + "inc/inc.ClassExtBase.php" ] }, "require": { From 32351d6179a363c9f978e38d53105714fcedf7d5 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 17 Nov 2025 14:25:58 +0100 Subject: [PATCH 04/12] move classes into namespace Seeddms\Seeddms, add aliases for previous class names --- inc/inc.ClassExtBase.php | 6 ++++-- inc/inc.ClassExtensionMgr.php | 2 -- inc/inc.Extension.php | 16 +++++++++++++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/inc/inc.ClassExtBase.php b/inc/inc.ClassExtBase.php index 0ae1fd952..316ae52a6 100644 --- a/inc/inc.ClassExtBase.php +++ b/inc/inc.ClassExtBase.php @@ -22,18 +22,20 @@ * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ +namespace Seeddms\Seeddms; + /** * Base class for extensions * * @author Uwe Steinmann * @package SeedDMS */ -class SeedDMS_ExtBase { +class ExtensionBase { var $settings; var $dms; var $logger; - public function __construct($settings, $dms, $logger) { + public function __construct(Settings $settings, $dms, $logger) { $this->settings = $settings; $this->dms = $dms; $this->logger = $logger; diff --git a/inc/inc.ClassExtensionMgr.php b/inc/inc.ClassExtensionMgr.php index 3f7a3577e..be648449f 100644 --- a/inc/inc.ClassExtensionMgr.php +++ b/inc/inc.ClassExtensionMgr.php @@ -750,5 +750,3 @@ $EXT_CONF = '.var_export($EXT_CONF, true).';'); return $this->errmsgs; } /* }}} */ } - -class_alias('Seeddms\Seeddms\ExtensionMgr', 'SeedDMS_Extension_Mgr'); diff --git a/inc/inc.Extension.php b/inc/inc.Extension.php index c3a0b43e0..e0558f4e0 100644 --- a/inc/inc.Extension.php +++ b/inc/inc.Extension.php @@ -11,10 +11,20 @@ * @version Release: @package_version@ */ -require "inc.ClassExtensionMgr.php"; -require_once "inc.ClassExtBase.php"; +//require_once "inc.ClassExtensionMgr.php"; +//require_once "inc.ClassExtBase.php"; -$extmgr = new SeedDMS_Extension_Mgr($settings->_rootDir."/ext", $settings->_cacheDir, $settings->_repositoryUrl, $settings->_proxyUrl, $settings->_proxyUser, $settings->_proxyPassword); +// Do not set a namespace until all extensions use that namespace +// or set the class name in the conf file to '\xxxx' +//namespace Seeddms\Seeddms; + +use Seeddms\Seeddms\ExtensionMgr; + +class_alias('Seeddms\Seeddms\ExtensionMgr', 'SeedDMS_Extension_Mgr'); +/* Declare an alias as long as it used by extensions */ +class_alias('Seeddms\Seeddms\ExtensionBase', 'SeedDMS_ExtBase'); + +$extmgr = new \Seeddms\Seeddms\ExtensionMgr($settings->_rootDir."/ext", $settings->_cacheDir, $settings->_repositoryUrl, $settings->_proxyUrl, $settings->_proxyUser, $settings->_proxyPassword); foreach($extmgr->getExtensionConfiguration() as $extname=>$extconf) { if($extconf['disable']) { From ac7128b8d34cdda493022878bd3665e3f13a35d9 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 17 Nov 2025 14:27:59 +0100 Subject: [PATCH 05/12] only check if config is writeable if a change is required --- utils/Commands/ConfigureextensionCommand.php | 24 +++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/utils/Commands/ConfigureextensionCommand.php b/utils/Commands/ConfigureextensionCommand.php index 6358d1554..61db46d3d 100644 --- a/utils/Commands/ConfigureextensionCommand.php +++ b/utils/Commands/ConfigureextensionCommand.php @@ -55,7 +55,7 @@ class ConfigureextensionCommand extends Command $output->writeln("Using configuration from '".$settings->_configFilePath."'.", OutputInterface::VERBOSITY_VERBOSE); - if (!is_writable($settings->_configFilePath)) { + if (($input->getOption('enable') || $input->getOption('disable')) && !is_writable($settings->_configFilePath)) { $output->writeln(sprintf("The configuration file '%s' is not writable by the system user running this script.", $settings->_configFilePath)); return Command::FAILURE; } @@ -69,23 +69,31 @@ class ConfigureextensionCommand extends Command if ($input->getOption('enable')) { if ($settings->extensionIsDisabled($extname)) { $settings->enableExtension($extname); + if (false === $settings->save()) { + $output->writeln(sprintf("Could not write configuration.", $extname)); + return Command::FAILURE; + } else { + $output->writeln(sprintf("Extension is %s.", $settings->extensionIsDisabled($extname) ? 'disabled' : 'enabled')); + } } else { - $output->writeln(sprintf("Extension already enabled.")); - return Command::SUCCESS; + $output->writeln(sprintf("Extension already enabled.")); } } elseif ($input->getOption('disable')) { if (!$settings->extensionIsDisabled($extname)) { $settings->disableExtension($extname); + if (false === $settings->save()) { + $output->writeln(sprintf("Could not write configuration.", $extname)); + return Command::FAILURE; + } else { + $output->writeln(sprintf("Extension is %s.", $settings->extensionIsDisabled($extname) ? 'disabled' : 'enabled')); + } } else { - $output->writeln(sprintf("Extension already disabled.")); - return Command::SUCCESS; + $output->writeln(sprintf("Extension already disabled.")); } } else { - $output->writeln(sprintf("Missing option --enable or --disable")); - return Command::FAILURE; + $output->writeln(sprintf("Extension is %s.", $settings->extensionIsDisabled($extname) ? 'disabled' : 'enabled')); } - $settings->save(); return Command::SUCCESS; } } From 4e236cf896b3f8f4b4738eb79cec3584690dd342 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 17 Nov 2025 15:35:31 +0100 Subject: [PATCH 06/12] include inc.ClassExtensionMgr.php and inc.ClassExtBase.php because the console tool needs them --- inc/inc.Extension.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/inc.Extension.php b/inc/inc.Extension.php index e0558f4e0..3c776a9c4 100644 --- a/inc/inc.Extension.php +++ b/inc/inc.Extension.php @@ -11,8 +11,8 @@ * @version Release: @package_version@ */ -//require_once "inc.ClassExtensionMgr.php"; -//require_once "inc.ClassExtBase.php"; +require_once "inc.ClassExtensionMgr.php"; +require_once "inc.ClassExtBase.php"; // Do not set a namespace until all extensions use that namespace // or set the class name in the conf file to '\xxxx' @@ -24,7 +24,7 @@ class_alias('Seeddms\Seeddms\ExtensionMgr', 'SeedDMS_Extension_Mgr'); /* Declare an alias as long as it used by extensions */ class_alias('Seeddms\Seeddms\ExtensionBase', 'SeedDMS_ExtBase'); -$extmgr = new \Seeddms\Seeddms\ExtensionMgr($settings->_rootDir."/ext", $settings->_cacheDir, $settings->_repositoryUrl, $settings->_proxyUrl, $settings->_proxyUser, $settings->_proxyPassword); +$extmgr = new ExtensionMgr($settings->_rootDir."/ext", $settings->_cacheDir, $settings->_repositoryUrl, $settings->_proxyUrl, $settings->_proxyUser, $settings->_proxyPassword); foreach($extmgr->getExtensionConfiguration() as $extname=>$extconf) { if($extconf['disable']) { From b647e6e0006ff4ea959d4afa94875224879bdf7b Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 17 Nov 2025 15:36:13 +0100 Subject: [PATCH 07/12] running hooks can be prevented by setting env var SEEDDMS_NO_EXTENSION_HOOKS --- utils/console | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/utils/console b/utils/console index ed7d3c0d8..b7aae03f2 100755 --- a/utils/console +++ b/utils/console @@ -62,12 +62,26 @@ $application->add(new RepositoryextensionCommand($settings, $logger, $translator $application->add(new UpdateextensionCommand($settings, $logger, $translator, $extmgr)); $application->add(new DownloadextensionCommand($settings, $logger, $translator, $extmgr)); -if(isset($GLOBALS['SEEDDMS_HOOKS']['console'])) { - foreach($GLOBALS['SEEDDMS_HOOKS']['console'] as $hookObj) { - if (method_exists($hookObj, 'addCommand')) { - $hookObj->addCommand($application, ['settings'=>$settings, 'logger'=>$logger, 'translator'=>$translator, 'extmgr'=>$extmgr]); +/* If extension are not compatible with the current version of + * SeedDMS anymore, calling the hooks may fail and exit this + * script. Hence there no change to even disable an extension with + * `utils/console ext:configure --name --disable` + * In such a case the last resort is to set the environment variable + * SEEDDMS_NO_EXTENSION_HOOKS to any value, which will prevent calling + * any hooks. + */ +if (false === getenv('SEEDDMS_NO_EXTENSION_HOOKS')) { + if (isset($GLOBALS['SEEDDMS_HOOKS']['console'])) { + foreach ($GLOBALS['SEEDDMS_HOOKS']['console'] as $hookObj) { + if (method_exists($hookObj, 'addCommand')) { + $hookObj->addCommand($application, ['settings'=>$settings, 'logger'=>$logger, 'translator'=>$translator, 'extmgr'=>$extmgr]); + } } } +} else { + echo "NOT RUNNING HOOKS\n\n"; } $application->run(); + +// vim: ts=4 sw=4 expandtab From bc034900495ed766b3adc4a64121bd8939b3ac6d Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 17 Nov 2025 20:09:13 +0100 Subject: [PATCH 08/12] ensure user has write access on cache, because the extensions' config will be updated --- utils/Commands/RepositoryextensionCommand.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/Commands/RepositoryextensionCommand.php b/utils/Commands/RepositoryextensionCommand.php index b1f4805a0..b06fc957b 100644 --- a/utils/Commands/RepositoryextensionCommand.php +++ b/utils/Commands/RepositoryextensionCommand.php @@ -55,6 +55,11 @@ class RepositoryextensionCommand extends Command $output->writeln("Using configuration from '".$settings->_configFilePath."'.", OutputInterface::VERBOSITY_VERBOSE); + if (!is_writable($settings->_cacheDir)) { + $output->writeln(sprintf("The cache dir '%s' is not writable for the system user running this script.", $settings->_cacheDir)); + return Command::FAILURE; + } + $reposurl = $input->getOption('url'); if($reposurl) $extmgr->setRepositoryUrl($reposurl); From d8812eebd77376e11cd43bd63d2c65b9021b3580 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 18 Nov 2025 14:16:06 +0100 Subject: [PATCH 09/12] install editor.md --- Gruntfile.js | 21 +++++++++++++++++++++ package.json | 1 + 2 files changed, 22 insertions(+) diff --git a/Gruntfile.js b/Gruntfile.js index 99a691676..dece42804 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -221,6 +221,27 @@ module.exports = function (grunt) { ], dest: bootstrapDir + '/jquery-lazy', flatten: true + },{ + expand: true, + src: [ + nodeDir + '/editor.md/editormd.min.js' + ], + dest: bootstrapDir + '/editor.md', + flatten: true + },{ + expand: true, + cwd: nodeDir + '/editor.md/', + src: [ + 'lib/*', + 'languages/*', + 'images/*', + 'fonts/*', + 'plugins/*', + 'lib/codemirror/**', + 'css/*' + ], + dest: bootstrapDir + '/editor.md', + flatten: false },{ expand: true, src: [ diff --git a/package.json b/package.json index 791ec9f2b..024433998 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "chartjs": "^0.3.24", "cytoscape": "^3.16.2", "cytoscape-grid-guide": "^2.3.2", + "editor.md": "^1.5.0", "fine-uploader": "^5.16.2", "flag-icon-css": "^3.5.0", "flot": "^4.2.2", From 6b40e9103aa8cd102c148b572fc60fc414a37d43 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 18 Nov 2025 14:17:16 +0100 Subject: [PATCH 10/12] add javascript based editor (only bootstrap4 theme) --- out/out.EditMarkdown.php | 100 ++++++++++++++++++++ views/bootstrap/class.EditMarkdown.php | 122 +++++++++++++++++++++++++ 2 files changed, 222 insertions(+) create mode 100644 out/out.EditMarkdown.php create mode 100644 views/bootstrap/class.EditMarkdown.php diff --git a/out/out.EditMarkdown.php b/out/out.EditMarkdown.php new file mode 100644 index 000000000..2ba54550d --- /dev/null +++ b/out/out.EditMarkdown.php @@ -0,0 +1,100 @@ +$dms, 'user'=>$user)); + +$documentid = $_GET["documentid"]; +if (!isset($documentid) || !is_numeric($documentid) || intval($documentid)<1) { + UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id")); +} + +$document = $dms->getDocument($documentid); + +if (!is_object($document)) { + UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id")); +} + +if ($document->getAccessMode($user) < M_READWRITE) { + UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied")); +} + +if(isset($_GET["version"])) { + $version = $_GET["version"]; + + if (!is_numeric($version)) { + UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version")); + } + + $content = $document->getContentByVersion($version); + $lc = $document->getLatestContent(); + +} else { + $version = 0; + $content = $document->getLatestContent(); + $lc = $document->getLatestContent(); +} + +if (!is_object($content)) { + UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version")); +} + +/* Only the latest version may be edited */ +if($content->getVersion() != $lc->getVersion()) { + UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version")); +} + +/* +if (!isset($settings->_editOnlineFileTypes) || !is_array($settings->_editOnlineFileTypes) || !in_array(strtolower($content->getFileType()), $settings->_editOnlineFileTypes)) { + UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version")); +} + */ + +/* Create object for checking access to certain operations */ +$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings); +if(!$accessop->mayEditVersion($version)) { + UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied")); +} + +$folder = $document->getFolder(); + +if($view) { + $view->setParam('document', $document); + $view->setParam('version', $content); + $view->setParam('folder', $folder); + $view->setParam('accessobject', $accessop); + $view->setParam('cachedir', $settings->_cacheDir); + $view->setParam('previewWidthList', $settings->_previewWidthList); + $view->setParam('previewWidthDetail', $settings->_previewWidthDetail); + $view->setParam('timeout', $settings->_cmdTimeout); + $view($_GET); + exit; +} diff --git a/views/bootstrap/class.EditMarkdown.php b/views/bootstrap/class.EditMarkdown.php new file mode 100644 index 000000000..e6c88a0ff --- /dev/null +++ b/views/bootstrap/class.EditMarkdown.php @@ -0,0 +1,122 @@ + + * @copyright Copyright (C) 2002-2005 Markus Westphal, + * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, + * 2010-2012 Uwe Steinmann + * @version Release: @package_version@ + */ + +/** + * Include parent class + */ +//require_once("class.Bootstrap.php"); + +/** + * Class which outputs the html page for EditOnline view + * + * @category DMS + * @package SeedDMS + * @author Markus Westphal, Malcolm Cowe, Uwe Steinmann + * @copyright Copyright (C) 2002-2005 Markus Westphal, + * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, + * 2010-2012 Uwe Steinmann + * @version Release: @package_version@ + */ +class SeedDMS_View_EditMarkdown extends SeedDMS_Theme_Style { + var $dms; + var $folder_count; + var $document_count; + var $file_count; + var $storage_size; + + function js() { /* {{{ */ + $document = $this->params['document']; + header('Content-Type: application/javascript; charset=UTF-8'); +?> + var editor; + $(function() { + editor = editormd("editor", { + // width: "100%", + height: 560, + // markdown: "xxxx", // dynamic set Markdown text + path : "/views/bootstrap4/vendors/editor.md/lib/" // Autoload modules mode, codemirror, marked... dependents libs path + }); + }); + $(document).ready(function() { + $('#update').click(function(event) { + event.preventDefault(); +// alert(editor.getMarkdown()); + $.post("../op/op.EditOnline.php", $('#form1').serialize(), function(response) { + noty({ + text: response.message, + type: response.success === true ? 'success' : 'error', + dismissQueue: true, + layout: 'topRight', + theme: 'defaultTheme', + timeout: 1500, + }); + }, "json"); + return false; + }); + }); + +params['dms']; + $user = $this->params['user']; + $document = $this->params['document']; + $version = $this->params['version']; + $cachedir = $this->params['cachedir']; + $previewwidthlist = $this->params['previewWidthList']; + $previewwidthdetail = $this->params['previewWidthDetail']; + + $set = 'markdown'; //default or markdown + $skin = 'simple'; // simple or markitup + $this->htmlAddHeader(''); + $this->htmlAddHeader(''); + $this->htmlAddHeader(''); + + $this->htmlStartPage(getMLText("edit_online")); + $this->globalNavigation(); + $this->contentStart(); + $folder = $document->getFolder(); + $this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document); + $this->rowStart(); + $this->columnStart(12); +?> +
+ +
+ +
+getId() == $luser->getId()) { + echo $this->warningMsg(getMLText('edit_online_warning')); + $this->formSubmit(' '.getMLText('save'),'update','','primary'); + } else { + echo $this->errorMsg(getMLText('edit_online_not_allowed')); + } +?> +
+columnEnd(); + $this->rowEnd(); + $this->contentContainerEnd(); + $this->contentEnd(); + $this->htmlEndPage(); + } /* }}} */ +} From 5cf859becfb21f95144a80e7c75ff36378d5d1de Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 18 Nov 2025 14:17:40 +0100 Subject: [PATCH 11/12] use editor.md for editing online --- views/bootstrap/class.ViewDocument.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index caae6a61f..c650418a7 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -831,7 +831,10 @@ $(document).ready( function() { $items = array(); if ($file_exists){ if($islatest && $accessobject->mayEditVersion()) { - $items[] = array('link'=>$this->html_url('EditOnline', array('documentid'=>$latestContent->getDocument()->getId(), 'version'=>$latestContent->getVersion())), 'icon'=>'edit', 'label'=>'edit_version'); + if($this->theme == 'bootstrap4') + $items[] = array('link'=>$this->html_url('EditMarkdown', array('documentid'=>$latestContent->getDocument()->getId(), 'version'=>$latestContent->getVersion())), 'icon'=>'edit', 'label'=>'edit_version'); + else + $items[] = array('link'=>$this->html_url('EditOnline', array('documentid'=>$latestContent->getDocument()->getId(), 'version'=>$latestContent->getVersion())), 'icon'=>'edit', 'label'=>'edit_version'); } } /* Only admin has the right to remove version in any case or a regular From 9bff901c29602ad966ca2e6086743353c193e0bc Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 18 Nov 2025 14:19:17 +0100 Subject: [PATCH 12/12] add changes for 5.1.43 --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 2d6784242..464dba212 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,7 @@ - rest api endpoint 'statstotal' returns number of groups and categories - add new command line program utils/console - major code polishing +- add markdown editor editor.md -------------------------------------------------------------------------------- Changes in version 5.1.42