1.把elfinder 中的目錄複製到 elrte中,並覆蓋之。
2.將以下語法貼到檔案中:
<!-- elfinder -->
<link rel="stylesheet" href="css/elfinder.css" type="text/css" media="screen" title="no title" charset="utf-8">
<script src="js/elfinder.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/i18n/elfinder.zh_TW.js" type="text/javascript" charset="utf-8"></script>
3.修改 elrte 的 js 設定:
<script type="text/javascript" charset="utf-8">
$().ready(function() {
var opts = {
cssClass : 'el-rte',
lang : 'zh_TW',
width : 640,
height : 200,
toolbar : 'complete',
cssfiles : ['css/elrte-inner.css'],
fmOpen : function(callback) {
$('<div id="myelfinder" />').elfinder({
url : 'connectors/php/connector.php',
lang : 'zh_TW',
dialog : { width : 900, modal : true, title : 'Files' }, // open in dialog window
closeOnEditorCallback : true, // close after file select
editorCallback : callback // pass callback to file manager
})
}
}
$('#editor').elrte(opts);
})
</script>
4.修改connectors/php/connector.php:(32行)
'URL' => 'http://localhost/files/', // root directory URL