2016-04-03 20 views
0

我寫了一個URI結構爲lang/domain/controller/method/id的小框架,現在我想使用與CKEditor集成的CKFinder我無法上傳和瀏覽服務器,因爲地址結構體?我該怎麼辦?瀏覽服務器,它使用:定製CKEditor在框架中使用明確的URL

http://localhost/public/admin/style1/plugins/ckfinder/ckfinder.html?CKEditor=abstraction&CKEditorFuncNum=1&langCode=fa

現在我已經改變了上傳和由這些瀏覽地址:

CKEDITOR.replace('article', 
    { 
     filebrowserBrowseUrl : '/browser/browse.php', 
     filebrowserUploadUrl : '/uploader/upload.php' 
    }); 

它顯示的圖像,但是當我選擇他們並不把它帶到頁並將文件上傳到我的圖像文件夾,但不能添加它們,甚至不能在正文或上傳對話框中預覽它們。我如何使用明確的網址ckeditor?

+0

我徹底失望了,任何意見表示讚賞 – hamid

回答

2

自定義路徑CKFinder

如果你正在做的URL重寫,你希望CKFinder返回自定義路徑,網址,你可以做到以下幾點:

您可以配置CKFinder如何發送網址到CKEditor的中CKFinder的config.php文件中backends部分:

$config['backends'][] = array(
    'name'   => 'default', 
    'adapter'  => 'local', 
    'baseUrl'  => 'http://base/url/ckfinder/will/give/to/ckeditor', 
    'root'   => '/path/to/files/on/disk', 
    'chmodFiles' => 0777, 
    'chmodFolders' => 0755, 
    'filesystemEncoding' => 'UTF-8' 
); 

的文件路徑將附加到所有URL和這種行爲不能被配置來改變uration。

E.g.對於/path/to/files/on/disk/images/picture.png,返回的URL是http://base/url/ckfinder/will/give/to/ckeditor/images/picture.png

或者,您可以將'useProxyCommand' => true添加到後端配置。

這會將所有返回的URL更改爲http://localhost/core/connector/php/connector.php?command=Proxy&lang=en&type=Files&currentFolder=%2F&hash=9fd5e9f22b8dea6a&fileName=picture.png的形式,其中http://localhost/core/connector/php/connector.php是用於請求獲取文件URL的URL。

與文件管理器

如果要實現與文件管理自己的整合檢查從/uploader/upload.php你的迴應定製集成。 CKEditor的期望是這樣的:

<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction(1, 'http://file/url', 'message');</script>` 

你可以找到更多信息的CKEditor的documentation

+0

喜kfazithank你的答案,但它並沒有解決我的問題是什麼shuld?是不是地址?我不知道它必須是文件夾地址?瀏覽圖像文件夾的文件?上傳地址怎麼樣?你能幫我嗎? – hamid