国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > 軟件應用 > 正文

FCKEditor 自定義用戶目錄的修改步驟 (附源碼)

2024-09-06 19:16:43
字體:
來源:轉載
供稿:網友

由于我這邊的網絡原因,沒用從FCK的官網下載到源碼...
這套源碼是FCK2.2版反編譯出來的
源碼:點此下載 源碼中主要修改的地方做了注釋
大致的修改如下 :
獲取用戶目錄的源碼: FileWorkerBase.cs
這里主要是做了一些注釋
在程序中可以直接在用戶登錄的時候指定
這個方案只是方便多用戶使用的時候為用戶指定不同的文件目錄
Session["FCKeditor:UserFilesPath"]="用戶文件相對目錄";

復制代碼 代碼如下:

/// <summary>
/// 用戶文件目錄
/// </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))
{
//從站點配置文件讀取
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;
}
}

這樣指定了之后會發現 FCK需要有Image,Files等文件夾
修改這個文件:Uploader .cs (下載地址)
修改過的上傳文件操作類在這里:(如果你要修改原版的不必去把這個類文件搞到你的Web程序目錄中來,我這里只是為了方便使用我項目中的APP_Code中的方法,下同不再贅述!)
Fckeditor/editor/filemanager/upload/aspx/upload.aspx.cs
修改的時候忘了做記錄..這里貌似沒改什么內容 只是做了點注釋
呃找到了在這里 FileBrowserConnector
Fckeditor/editor/filemanager/browser/default/connectors/aspx/connector.aspx.cs(修改后的地址)
復制代碼 代碼如下:

/// <summary>
/// 根據文件類型選擇文件夾
/// </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[] { '/' }));
}

這里直接把那個resourceType給排除掉了(去掉判斷文件類型)
這個方法將影響選定圖片后的圖片路徑
復制代碼 代碼如下:

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("http://","/");//新增
return (p);//新增
}

然后在其他的HTML文件中也修改有部分代碼
1.翻譯了提示信息
這東西就不說了..很簡單你也可以根據提示信息全文搜索...
2.修改選定圖片后的示例文本為中文
文件位于: 第52行
Fckeditor/editor/dialog/fck_image/fck_image_preview.html
3.修改文件瀏覽器增加了文件預覽 (效果很粗糙)
高手們修改好看了還望能給小弟發一份兒..
文件位于:
Fckeditor/editor/filemanager/browser/default/frmresourceslist.html
我這里修改了第63行的js 顯示預覽效果
當然還有自定義表情之類的玩意兒..
但因為目前項目需要的就這么點兒東西.所以也懶得去搞了...
源碼:點此下載
轉載請注明出處:http://Qbit.cnblogs.com

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 吴江市| 拉孜县| 两当县| 库尔勒市| 陕西省| 甘谷县| 弥勒县| 甘肃省| 金乡县| 新干县| 石渠县| 抚州市| 五大连池市| 临猗县| 建德市| 新化县| 通城县| 禹州市| 高尔夫| 普兰县| 安庆市| 宽城| 荆州市| 四平市| 揭西县| 安顺市| 曲阳县| 宣汉县| 河东区| 洛扎县| 白水县| 化隆| 彰化市| 松桃| 萨嘎县| 仙游县| 银川市| 交口县| 武汉市| 苗栗市| 山东|