From 072b1d2eb9fbf3ea42e898f05d2d4a5edfc7768b Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 27 Jan 2021 09:54:46 +0100 Subject: [PATCH] check if user creating the version is currently editing --- views/bootstrap/class.EditOnline.php | 40 ++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/views/bootstrap/class.EditOnline.php b/views/bootstrap/class.EditOnline.php index 029604fb6..f366e9131 100644 --- a/views/bootstrap/class.EditOnline.php +++ b/views/bootstrap/class.EditOnline.php @@ -40,8 +40,37 @@ class SeedDMS_View_EditOnline extends SeedDMS_Bootstrap_Style { $document = $this->params['document']; header('Content-Type: application/javascript; charset=UTF-8'); ?> +mySeedSettings = { + nameSpace: 'markdown', // Useful to prevent multi-instances CSS conflict + previewParserPath: '~/sets/markdown/preview.php', + onShiftEnter: {keepDefault:false, openWith:'\n\n'}, + markupSet: [ + {name:'First Level Heading', key:"1", placeHolder:'Your title here...', closeWith:function(markItUp) { return miu.markdownTitle(markItUp, '=') } }, + {name:'Second Level Heading', key:"2", placeHolder:'Your title here...', closeWith:function(markItUp) { return miu.markdownTitle(markItUp, '-') } }, + {name:'Heading 3', key:"3", openWith:'### ', placeHolder:'Your title here...' }, + {name:'Heading 4', key:"4", openWith:'#### ', placeHolder:'Your title here...' }, + {name:'Heading 5', key:"5", openWith:'##### ', placeHolder:'Your title here...' }, + {name:'Heading 6', key:"6", openWith:'###### ', placeHolder:'Your title here...' }, + {separator:'---------------' }, + {name:'Bold', key:"B", openWith:'**', closeWith:'**'}, + {name:'Italic', key:"I", openWith:'_', closeWith:'_'}, + {separator:'---------------' }, + {name:'Bulleted List', openWith:'- ' }, + {name:'Numeric List', openWith:function(markItUp) { + return markItUp.line+'. '; + }}, + {separator:'---------------' }, + {name:'Picture', key:"P", replaceWith:'![[![Alternative text]!]]([![Url:!:http://]!] "[![Title]!]")'}, + {name:'Link', key:"L", openWith:'[', closeWith:']([![Url:!:http://]!] "[![Title]!]")', placeHolder:'Your text to link here...' }, + {separator:'---------------'}, + {name:'Quotes', openWith:'> '}, + {name:'Code Block / Code', openWith:'(!(\t|!|`)!)', closeWith:'(!(`)!)'}, +// {separator:'---------------'}, +// {name:'Preview', call:'preview', className:"preview"} + ] +} $(document).ready(function() { - $('#markdown').markItUp(mySettings); + $('#markdown').markItUp(mySeedSettings); $('#update').click(function(event) { event.preventDefault(); @@ -116,13 +145,20 @@ $(document).ready(function() { warningMsg(getMLText('edit_online_warning')); + if($user->getId() == $luser->getId()) { + echo $this->warningMsg(getMLText('edit_online_warning')); ?> +errorMsg(getMLText('edit_online_not_allowed')); + } +?> columnEnd();