首页 > 代码库 > dedecms织梦富文本编辑器更换为kindeditor
dedecms织梦富文本编辑器更换为kindeditor
本站所有附件均为UTF-8版本,GBK版本的童学请自行转码。
最终效果
首先,当然是先在kindeditor官方下载最新版本的kindeditor编辑器
目前最新版本是 KindEditor 4.1.10,下载解压,只要下面几个文件就行了,在你的dedecms程序include文件夹下,建个kindeditor文件夹,然后把解压出来的这几个文件放进去,最终结果是:
2、增加kindeitor图片上传处理文件到 include/dialog
百度盘 密码: v9a5
3、打开include/inc/inc_fun_funAdmin.php 这个是dedecms创建编辑器文件
找到
else if($GLOBALS[‘cfg_html_editor‘]==‘ckeditor‘) { 中间代码省略... }
在它们的下面加入
else if($GLOBALS[‘cfg_html_editor‘]==‘kindeditor‘) { $fvalue =http://www.mamicode.com/htmlspecialchars($fvalue);"/include/dialog/kindeditor_post.php"; $fileManagerJson = $GLOBALS[‘cfg_cmspath‘]."/include/dialog/kindeditor_manager.php"; $allowFileManager = ‘true‘; $extendconfig = ‘‘; if($etype == ‘Member‘ || $etype == ‘MemberLit‘ || $etype == ‘Diy‘ || $etype == ‘Feedback‘) { $uploadJson = ""; $fileManagerJson = ""; $allowFileManager = ‘false‘; $extendconfig = ‘allowImageUpload : false,‘; $extendconfig .= ‘allowFlashUpload : false,‘; $extendconfig .= ‘allowMediaUpload : false,‘; $extendconfig .= ‘allowFileUpload : false,‘; } $items[‘Member‘] = "[ ‘source‘, ‘|‘, ‘undo‘, ‘redo‘, ‘|‘, ‘preview‘, ‘print‘, ‘template‘, ‘cut‘, ‘copy‘, ‘paste‘, ‘plainpaste‘, ‘wordpaste‘, ‘|‘, ‘justifyleft‘, ‘justifycenter‘, ‘justifyright‘, ‘justifyfull‘, ‘insertorderedlist‘, ‘insertunorderedlist‘, ‘indent‘, ‘outdent‘, ‘subscript‘, ‘superscript‘, ‘clearhtml‘, ‘quickformat‘, ‘selectall‘, ‘|‘, ‘fullscreen‘, ‘/‘, ‘formatblock‘, ‘fontname‘, ‘fontsize‘, ‘|‘, ‘forecolor‘, ‘hilitecolor‘, ‘bold‘, ‘italic‘, ‘underline‘, ‘strikethrough‘, ‘lineheight‘, ‘removeformat‘, ‘|‘, ‘image‘, ‘flash‘, ‘media‘, ‘insertfile‘, ‘table‘, ‘hr‘, ‘emoticons‘, ‘map‘, ‘pagebreak‘, ‘link‘, ‘unlink‘, ‘|‘, ‘about‘]"; $items[‘Small‘] = $items[‘MemberLit‘] = $items[‘Diy‘] = "[ ‘fontname‘, ‘fontsize‘, ‘|‘, ‘forecolor‘, ‘hilitecolor‘, ‘bold‘, ‘italic‘, ‘underline‘, ‘removeformat‘, ‘|‘, ‘justifyleft‘, ‘justifycenter‘, ‘justifyright‘, ‘insertorderedlist‘, ‘insertunorderedlist‘, ‘|‘, ‘emoticons‘, ‘image‘, ‘link‘]"; $items[‘Feedback‘]= "[ ‘fontname‘, ‘fontsize‘, ‘|‘, ‘forecolor‘, ‘hilitecolor‘, ‘bold‘, ‘italic‘, ‘underline‘, ‘removeformat‘, ‘|‘, ‘justifyleft‘, ‘justifycenter‘, ‘justifyright‘, ‘insertorderedlist‘, ‘insertunorderedlist‘, ‘|‘, ‘emoticons‘]"; $itemconfig = ‘‘; if(isset($items[$etype])) { $itemconfig = "items :{$items[$etype]},"; } $session_id = session_id(); $code = <<<HTML <link rel="stylesheet" href="http://www.mamicode.com/{$GLOBALS[‘cfg_cmspath‘]}/include/kindeditor/themes/default/default.css" /> <link rel="stylesheet" href="http://www.mamicode.com/{$GLOBALS[‘cfg_cmspath‘]}/include/kindeditor/plugins/code/prettify.css" /> <script src="http://www.mamicode.com/{$GLOBALS[‘cfg_cmspath‘]}/include/kindeditor/kindeditor-min.js"></script> <script src="http://www.mamicode.com/{$GLOBALS[‘cfg_cmspath‘]}/include/kindeditor/lang/zh_CN.js"></script> <script src="http://www.mamicode.com/{$GLOBALS[‘cfg_cmspath‘]}/include/kindeditor/plugins/code/prettify.js"></script> <script type="text/javascript"> KindEditor.ready(function(K) { var editor1 = K.create(‘textarea[name="{$fname}"]‘, { cssPath : ‘{$GLOBALS[‘cfg_cmspath‘]}/include/kindeditor/plugins/code/prettify.css‘, uploadJson : ‘$uploadJson‘, fileManagerJson : ‘$fileManagerJson‘, filterMode: false,//是否开启过滤模式 extraFileUploadParams: { PHPSESSID : ‘{$session_id}‘ }, $extendconfig $itemconfig allowFileManager : {$allowFileManager}, afterBlur: function(){this.sync();} }); prettyPrint(); }); </script> <textarea name="{$fname}" style="height:{$nheight}px;visibility:hidden;width: 100%;">{$fvalue}</textarea> HTML; if($gtype=="print") { echo $code; } else { return $code; } }
最后,后台-系统-系统基本参数-核心设置-Html编辑器 ,填写kindeditor
ps
■修复了已知问题session
■dedediy kineditor增加QQ图标
■dedediy kineditor增加百度地图动态
dedecms织梦富文本编辑器更换为kindeditor
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。