mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 20:51:30 +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 $orgFileName original file name
|
||||||
* @param string $fileType
|
* @param string $fileType
|
||||||
* @param string $mimeType MimeType of the content
|
* @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
|
* @return bool/array false in case of an error or a result set
|
||||||
*/
|
*/
|
||||||
function replaceContent($version, $user, $tmpFile, $orgFileName, $fileType, $mimeType) { /* {{{ */
|
function replaceContent($version, $user, $tmpFile, $orgFileName, $fileType, $mimeType) { /* {{{ */
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<email>uwe@steinmann.cx</email>
|
<email>uwe@steinmann.cx</email>
|
||||||
<active>yes</active>
|
<active>yes</active>
|
||||||
</lead>
|
</lead>
|
||||||
<date>2021-01-08</date>
|
<date>2021-01-27</date>
|
||||||
<time>13:44:55</time>
|
<time>13:44:55</time>
|
||||||
<version>
|
<version>
|
||||||
<release>6.0.15</release>
|
<release>6.0.15</release>
|
||||||
|
|
|
@ -40,8 +40,37 @@ class SeedDMS_View_EditOnline extends SeedDMS_Bootstrap_Style {
|
||||||
$document = $this->params['document'];
|
$document = $this->params['document'];
|
||||||
header('Content-Type: application/javascript; charset=UTF-8');
|
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() {
|
$(document).ready(function() {
|
||||||
$('#markdown').markItUp(mySettings);
|
$('#markdown').markItUp(mySeedSettings);
|
||||||
|
|
||||||
$('#update').click(function(event) {
|
$('#update').click(function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
@ -117,15 +146,20 @@ $(document).ready(function() {
|
||||||
<input type="hidden" name="documentid" value="<?php echo $document->getId(); ?>" />
|
<input type="hidden" name="documentid" value="<?php echo $document->getId(); ?>" />
|
||||||
<textarea id="markdown" name="data" width="100%" rows="20">
|
<textarea id="markdown" name="data" width="100%" rows="20">
|
||||||
<?php
|
<?php
|
||||||
|
$luser = $document->getLatestContent()->getUser();
|
||||||
echo htmlspecialchars(file_get_contents($dms->contentDir . $version->getPath()), ENT_SUBSTITUTE);
|
echo htmlspecialchars(file_get_contents($dms->contentDir . $version->getPath()), ENT_SUBSTITUTE);
|
||||||
?>
|
?>
|
||||||
</textarea>
|
</textarea>
|
||||||
<?php
|
<?php
|
||||||
if($accessobject->check_controller_access('EditOnline')) {
|
if($accessobject->check_controller_access('EditOnline')) {
|
||||||
|
if($user->getId() == $luser->getId()) {
|
||||||
echo $this->warningMsg(getMLText('edit_online_warning'));
|
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>
|
<button id="update" type="submit" class="btn btn-primary"><i class="fa fa-save"></i> <?php printMLText("save"); ?></button>
|
||||||
<?php
|
<?php
|
||||||
|
} else {
|
||||||
|
echo $this->errorMsg(getMLText('edit_online_not_allowed'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user