@using System.Data @using System.Web @using ZoomLa.Safe @using ZoomLa.Common @using ZoomLa.Components @using ZoomLa.BLL.Helper @model ZoomLa.SQLDAL.SQL.PageSetting @functions{ public string TemplateDir { get { string _tempdir = (SiteConfig.SiteOption.TemplateDir.TrimEnd('/') + "/").ToLower(); string setdir = (Context.Request.Query["setTemplate"]);//指定要跳转到的目录位置,强制限于Template之下 if (string.IsNullOrEmpty(setdir)) { return _tempdir; } else { //从云端模板直接跳转 if (setdir.ToLower().IndexOf("/template/") != 0) { return "/template/" + setdir + "/"; }//点击链接跳转 else { return setdir.TrimEnd('/') + "/"; } } } } public string CurDir { get { return SafeC.PathDeal(DataConverter.CStr(Context.Request.Query["dir"])); } } public string PPathDir { get { return function.VToP(SafeC.PathDeal((TemplateDir + CurDir + "/").Replace("//", "/"))); } } public DataTable GetTemplateDT() { DataTable dt = FileSystemObject.GetDirectoryInfos(PPathDir, FsoMethod.All); dt.DefaultView.RowFilter = "name<>'配置库' and name<>'标签库' and name<>'节点库' and name<>'模型库' and name<>'style' and name<>'.svn' and name<>'Thumbs.db'"; return dt.DefaultView.ToTable(); } //导航路径面包屑 public string GetBread() { string html = ""; string vdir = CurDir; if (string.IsNullOrEmpty(vdir)) { return "全部文件"; } else { string url = "TemplateManage?setTemplate=" + HttpUtility.UrlEncode(TemplateDir) + "&Dir="; string[] dirArr = vdir.Split("/".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); html += "全部文件"; for (int i = 0; i < dirArr.Length; i++) { //上一级目录链接 url += dirArr[i] + "/"; html += " "; if (i == (dirArr.Length - 1)) { html += "" + dirArr[i] + ""; } else { html += "" + dirArr[i] + ""; } //设置返回上一级 if (dirArr.Length == 1) { html = "返回上一级 | " + html; } else if (i == (dirArr.Length - 2)) { html = "返回上一级 | " + html; } } } return html; } public bool IsFolder(DataRow dr) { return DataConverter.CStr(dr["type"]) == "1" ? true : false; } public string GetCurentDir() { string dir = string.IsNullOrEmpty(CurDir) ? "" : CurDir.TrimEnd('/') + " / "; dir = dir.Replace(" ", ""); return dir; } } @{ DataTable dt = GetTemplateDT(); } @section head{@L.模板管理 } @section content{ @Call.SetBread(new Bread[] { new Bread("/{manage}/Main",L.工作台), new Bread("TemplateSet",L.模板风格), new Bread(){url="TemplateManage",text=L.模板列表,addon="["+L.新建模板+"]" } }) )
@Html.Raw(GetBread())
@foreach (DataRow dr in dt.Rows) { }
@L.操作 @L.名称 @L.类型 @L.修改时间
@if (IsFolder(dr)) {@dr["Name"] } else {@dr["Name"]} @(DataConverter.CStr(dr["type"]) == "1" ? "文件夹" : dr["content_type"]) @DateHelper.ToDate(dr["lastWriteTime"])
@*
创建目录
*@ } @section script{ }