需要将Elfinder File Manager与CKEditor集成 [英] Need to integrate Elfinder File manager with CKEditor

查看:68
本文介绍了需要将Elfinder File Manager与CKEditor集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在Google上找到如何将Elfinder与CKeditor集成的方法,但无效。
有一条说明
,但是它不起作用。它能够打开elfinder。但是,当我双击图像时,它不会将URL传递给图像字段,而是打开图片查看器。

Trying to find on google how to integrate elfinder with CKeditor, but not works. There is an instruction here but, its not work. It able to open elfinder. but, when i double click on image, it do not pass URL to image filed, but open picture viewer.

再试一次,找到此链接
,但它也无济于事。有人说github上的代码可用于版本1。现在,elfinder使用的是版本2.0 rc1。

Try again and find this link but, its not help too. And some people said that coding at github is usable for version 1. Now, elfinder is using version 2.0 rc1.

所以,有没有人可以帮助我与CKeditor集成?这将会非常棒。
谢谢。

So, is there anyone could help me to integrate with CKeditor? It will be great. Thanks.

推荐答案

替换此代码:

    <!-- elFinder initialization (REQUIRED) -->
    <script type="text/javascript" charset="utf-8">
        $().ready(function() {
            var elf = $('#elfinder').elfinder({
                url : 'php/connector.php'  // connector URL (REQUIRED)
                // lang: 'ru',             // language (OPTIONAL)
            }).elfinder('instance');
        });
    </script>

带有Wiki中的代码:

with code from wiki:

<script type="text/javascript" charset="utf-8">
// Helper function to get parameters from the query string.
function getUrlParam(paramName) {
    var reParam = new RegExp('(?:[\?&]|&amp;)' + paramName + '=([^&]+)', 'i') ;
    var match = window.location.search.match(reParam) ;

    return (match && match.length > 1) ? match[1] : '' ;
}

$().ready(function() {
    var funcNum = getUrlParam('CKEditorFuncNum');

    var elf = $('#elfinder').elfinder({
        url : 'php/connector.php',
        getFileCallback : function(file) {
            window.opener.CKEDITOR.tools.callFunction(funcNum, file);
            window.close();
        },
        resizable: false
    }).elfinder('instance');
});</script>

教程不是很明显,但是可以。.

tutorial is not so obvious but works ok..

这篇关于需要将Elfinder File Manager与CKEditor集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆