由于我這邊的網(wǎng)絡(luò)原因,沒(méi)用從FCK的官網(wǎng)下載到源碼...
這套源碼是FCK2.2版反編譯出來(lái)的
源碼:點(diǎn)此下載 源碼中主要修改的地方做了注釋
大致的修改如下 :
獲取用戶(hù)目錄的源碼: FileWorkerBase.cs
這里主要是做了一些注釋
在程序中可以直接在用戶(hù)登錄的時(shí)候指定
這個(gè)方案只是方便多用戶(hù)使用的時(shí)候?yàn)橛脩?hù)指定不同的文件目錄
Session["FCKeditor:UserFilesPath"]="用戶(hù)文件相對(duì)目錄";
/// <summary>
/// 用戶(hù)文件目錄
/// </summary>
protected string UserFilesPath
{
get
{
if (this.sUserFilesPath == null)
{
//從APPlictaion 讀取
this.sUserFilesPath = (string)base.Application["FCKeditor:UserFilesPath"];
if ((this.sUserFilesPath == null) || (this.sUserFilesPath.Length == 0))
{
//從Session讀取
this.sUserFilesPath = (string)this.Session["FCKeditor:UserFilesPath"];
if ((this.sUserFilesPath == null) || (this.sUserFilesPath.Length == 0))
{
//從站點(diǎn)配置文件讀取
this.sUserFilesPath = ConfigurationSettings.AppSettings["FCKeditor:UserFilesPath"];
if ((this.sUserFilesPath == null) || (this.sUserFilesPath.Length == 0))
{
this.sUserFilesPath = "/UpLoadFiles/";
}
if ((this.sUserFilesPath == null) || (this.sUserFilesPath.Length == 0))
{
//從URL讀取
this.sUserFilesPath = base.Request.QueryString["ServerPath"];
}
}
}
if (!this.sUserFilesPath.EndsWith("/"))
{
this.sUserFilesPath = this.sUserFilesPath + "/";
}
}
return this.sUserFilesPath;
}
}
這樣指定了之后會(huì)發(fā)現(xiàn) FCK需要有Image,Files等文件夾
修改這個(gè)文件:Uploader .cs (下載地址)
修改過(guò)的上傳文件操作類(lèi)在這里:(如果你要修改原版的不必去把這個(gè)類(lèi)文件搞到你的Web程序目錄中來(lái),我這里只是為了方便使用我項(xiàng)目中的APP_Code中的方法,下同不再贅述!)
Fckeditor/editor/filemanager/upload/aspx/upload.aspx.cs
修改的時(shí)候忘了做記錄..這里貌似沒(méi)改什么內(nèi)容 只是做了點(diǎn)注釋
呃找到了在這里 FileBrowserConnector
Fckeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx.cs(修改后的地址)
/// <summary>
/// 根據(jù)文件類(lèi)型選擇文件夾
/// </summary>
/// <param name="resourceType"></param>
/// <param name="folderPath"></param>
/// <returns></returns>
private string ServerMapFolder(string resourceType, string folderPath)
{
//2010-3-29 14:00:56
//string path = Path.Combine(base.UserFilesDirectory, resourceType);
string path = base.UserFilesDirectory;
Util.CreateDirectory(path);
return Path.Combine(path, folderPath.TrimStart(new char[] { '/' }));
}
這里直接把那個(gè)resourceType給排除掉了(去掉判斷文件類(lèi)型)
這個(gè)方法將影響選定圖片后的圖片路徑
private string GetUrlFromPath(string resourceType, string folderPath)
{
if ((resourceType == null) || (resourceType.Length == 0))
{
return (base.UserFilesPath.TrimEnd(new char[] { '/' }) + folderPath);
}
//2010-3-29 14:00:20 HYZ
//return (base.UserFilesPath + resourceType + folderPath);
string p=base.UserFilesPath + folderPath;//新增
p=p.Replace("//","/");//新增
return (p);//新增
}
然后在其他的HTML文件中也修改有部分代碼
1.翻譯了提示信息
這東西就不說(shuō)了..很簡(jiǎn)單你也可以根據(jù)提示信息全文搜索...
2.修改選定圖片后的示例文本為中文
文件位于: 第52行
Fckeditor/editor/dialog/fck_image/fck_image_preview.html
3.修改文件瀏覽器增加了文件預(yù)覽 (效果很粗糙)
高手們修改好看了還望能給小弟發(fā)一份兒..
文件位于:
Fckeditor/editor/filemanager/browser/default/frmresourceslist.html
我這里修改了第63行的js 顯示預(yù)覽效果
當(dāng)然還有自定義表情之類(lèi)的玩意兒..
但因?yàn)槟壳绊?xiàng)目需要的就這么點(diǎn)兒東西.所以也懶得去搞了...
源碼:點(diǎn)此下載
轉(zhuǎn)載請(qǐng)注明出處:http://Qbit.cnblogs.com