在 MOSS (Microsoft Office SharePoint Server) 專案開發資訊發布系統時,需一款支援圖片上傳、易於整合 WebPart 的編輯器。經評估 WebHTMLEditor (收費)、eWebEditor/FreeTextBox (上傳功能受限)、FCKeditor (開源、功能全),最終選用 FCKeditor 2.6.3。
FredCK.FCKeditorV2.dll (來自 FCKeditor.Net) 與 fckeditor 目錄 (來自主包)。private FredCK.FCKeditorV2.FCKeditor fckContent = new FredCK.FCKeditorV2.FCKeditor();
protected override void CreateChildControls()
{
fckContent.BasePath = "/_layouts/fckeditor/";
this.Controls.Add(this.fckContent);
}
protected override void Render(HtmlTextWriter writer)
{
fckContent.RenderControl(writer);
}
fckeditor 整個資料夾複製到 MOSS 站點 _layouts 目錄 (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\template\layouts\)。fckeditor 下建立 userfiles 資料夾,授予上傳用戶寫入權限。fckconfig.js:設定語言 FCKConfig.DefaultLanguage = 'zh-cn';上傳協定 _FileBrowserLanguage = 'aspx'、_QuickUploadLanguage = 'aspx'。fckeditor\editor\filemanager\connectors\aspx\config.ascx:CheckAuthentication() 回傳 true;UserFilesPath = "/_layouts/fckeditor/userfiles/"。BasePath、UserFilesPath 是否為正確相對路徑。/ 開頭)。