mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 23:42:11 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
768c02866c
|
@ -2013,7 +2013,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
|||
* @param string $orgFileName original file name
|
||||
* @param string $fileType
|
||||
* @param string $mimeType MimeType of the content
|
||||
* @param integer $version version number of content or 0 if next higher version shall be used.
|
||||
* @param integer $version version number of content or 0 if latest version shall be replaced.
|
||||
* @return bool/array false in case of an error or a result set
|
||||
*/
|
||||
function replaceContent($version, $user, $tmpFile, $orgFileName, $fileType, $mimeType) { /* {{{ */
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<email>uwe@steinmann.cx</email>
|
||||
<active>yes</active>
|
||||
</lead>
|
||||
<date>2021-01-08</date>
|
||||
<date>2021-01-27</date>
|
||||
<time>13:44:55</time>
|
||||
<version>
|
||||
<release>6.0.15</release>
|
||||
|
|
|
@ -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();
|
||||
|
@ -117,15 +146,20 @@ $(document).ready(function() {
|
|||
<input type="hidden" name="documentid" value="<?php echo $document->getId(); ?>" />
|
||||
<textarea id="markdown" name="data" width="100%" rows="20">
|
||||
<?php
|
||||
$luser = $document->getLatestContent()->getUser();
|
||||
echo htmlspecialchars(file_get_contents($dms->contentDir . $version->getPath()), ENT_SUBSTITUTE);
|
||||
?>
|
||||
</textarea>
|
||||
<?php
|
||||
if($accessobject->check_controller_access('EditOnline')) {
|
||||
if($user->getId() == $luser->getId()) {
|
||||
echo $this->warningMsg(getMLText('edit_online_warning'));
|
||||
?>
|
||||
<button id="update" type="submit" class="btn btn-primary"><i class="fa fa-save"></i> <?php printMLText("save"); ?></button>
|
||||
<?php
|
||||
} else {
|
||||
echo $this->errorMsg(getMLText('edit_online_not_allowed'));
|
||||
}
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
|
Loading…
Reference in New Issue
Block a user