CKFinder命令擴充套件

2021-08-30 07:20:25 字數 2468 閱讀 3590

ckfinder命令擴充套件

1. ckfinder命令的擴充套件,在此以「新建 xml檔案」為例講述命令擴充套件的方法。

2. 在ckfinder_connector_core_connector 類的executecommand()方法下(大概 83-91之間任意位置)新增 「createfile」命令。

注意:新增命令一定要分析出其新增的位置,不同的命令新增的位置可能不同,但都是在executecommand()方法下新增。

ckfinder_connector_core_connector 類的實際儲存位置為:

core\connector\php\php5\core\connector.php

3. 再在core\connnector\php\php5\commandhandler資料夾下新增createfile.php檔案。

由於新建檔案的操作和 新建資料夾的操作是類似的,所以新createfolder.php中的**拷貝到createfile.php中。

4. 修改createfile.php中的**:

(1) 修改類名:將ckfinder_connector_commandhandler_createfolder 改為

ckfinder_connector_commandhandler_createfile

(2) 再將 40行的 private $command = "createfolder"; 改為

private $command = "createfile";

(3) 最後修改 buildxml()方法中的內容。新建資料夾和新建檔案的操作類似,

大體方法不用改,只要改具體的細節即可。

例:新建資料夾操作將buildxml方法改為:

protected function buildxml()

//判斷 filename是否設定

if (!isset($_get["filename"]))

//將filename進行轉碼

$sfilename = ckfinder_connector_utils_filesystem::converttofilesystemencoding($_get["filename"]);

//判斷副檔名是否合法

$resourcetypeinfo = $this->_currentfolder->getresourcetypeconfig();

if (!$resourcetypeinfo->checkextension($sfilename))

// 檢查檔名稱是否合法,或 是否已有此名稱的隱藏檔案

if (!ckfinder_connector_utils_filesystem::checkfilename($sfilename) || $resourcetypeinfo->checkishiddenfile($sfilename))

//組合路徑

$sserverdir = ckfinder_connector_utils_filesystem::combinepaths($this->_currentfolder->getserverpath(), $sfilename);

//檢查檔案是否已在存在

if (file_exists($sserverdir))

if (!is_writeable($this->_currentfolder->getserverpath())) $_resourcetypeconfig = $this->_currentfolder->getresourcetypeconfig();

//判斷 filename是否已經存在

if (!isset($_get["filename"]))

//將filename進行轉碼

$sfilename = ckfinder_connector_utils_filesystem::converttofilesystemencoding(

$_get["filename"]);

// 檢查檔案或資料夾名稱是否合法

if (!ckfinder_connector_utils_filesystem::checkfilename($sfilename) ||

$_resourcetypeconfig->checkishiddenfolder($sfilename))

//組合路徑

$sserverdir = ckfinder_connector_utils_filesystem::combinepaths(

$this->_currentfolder->getserverpath(), $sfilename);

if (!is_writeable($this->_currentfolder->getserverpath()))

//建立標誌

$bcreated = false;

if ($perms = $_config->getchmodfolders()) else

if (!$bcreated) else

}

CKEditor與CKFinder的配置

ckeditor與ckfinder的配置使用 一 將ckeditor 與 ckfinder 的包含在專案中 在需要富文字編輯器的頁面新增js引用 在需要富文字編輯器的頁面新增js引用,ckeidtor.js與ckfinder.js 初始化富文字編輯器 新增js指令碼,將需要替換的文字框替換為cked...

ckeditor與ckfinder組合配置

一 ckeditor 1.在需要新增編輯器的頁面引出ckeditor.js檔案 2.替換,即在裡面新增 class ckeditor 即可,不必replace什麼的,太麻煩 3.重新整理該頁面即可看到。二 ckfinder 1.不需要引入js檔案,但是需要在ckeditor的配置檔案進行ckfind...

將CKfinder 整合進 CKEditor3 0

由於本次ckeditor全新改版,沒有提供檔案上傳功能,所以選擇整合ckfinder是個不錯的選擇 需要修改一下ckeditor外掛程式資料夾下的js原始碼,以image外掛程式為例 flash及files同理 code 將下邊的 做一些修改 2009 07 13 將瀏覽伺服器按鈕置為顯示狀態 hi...