phpcms v9更换Ueditor编辑器教程
首先,在文件phpcms/libs/classes/form.class.php,中替换editor方法,代码如下:
public static function editor($textareaid = 'content', $toolbar = 'basic', $module = '', $catid = '', $color = '', $allowupload = 0, $allowbrowser = 1,$alowuploadexts = '',$height = 200,$disabled_page = 0, $allowuploadnum = '10') {
$str ='';
if(!defined('EDITOR_INIT')) {
$str .= '<script type="text/javascript" src="'.JS_PATH.'ueditor/ueditor.config.js"></script>';
$str .= '<script type="text/javascript" src="'.JS_PATH.'ueditor/ueditor.all.js"></script>';
define('EDITOR_INIT', 1);
}
//$str .= '<script id="container" name="content" type="text/plain"></script>';
$str .= '<script type="text/javascript">var ue = UE.getEditor("content",{autoHeightEnabled:false,initialFrameWidth:950,initialFrameHeight:400,zIndex:0});</script><br>';
//$str .= '<style>#edui1{width:720px;}</style>';
return $str;
}
其次,将压缩包解压,放入statics/js/目录中,压缩包下载地址:https://www.niuqm.cn/fujian/Ueditor.rar
最后,更新全站缓存即可使用了
1