webdav portal filter + detail view added
This commit is contained in:
parent
280628e362
commit
51d432fd2e
156 changed files with 32494 additions and 260 deletions
|
@ -4,6 +4,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using System.Xml.Serialization;
|
||||
using log4net;
|
||||
|
@ -74,7 +75,7 @@ namespace WebsitePanel.WebDav.Core.Managers
|
|||
_currentFolder = _webDavSession.OpenFolder(string.Format("{0}{1}/{2}", WebDavAppConfigManager.Instance.WebdavRoot, WspContext.User.OrganizationId, pathPart.TrimStart('/')));
|
||||
}
|
||||
|
||||
children = _currentFolder.GetChildren().Where(x => !WebDavAppConfigManager.Instance.ElementsRendering.ElementsToIgnore.Contains(x.DisplayName.Trim('/'))).ToArray();
|
||||
children = FilterResult(_currentFolder.GetChildren()).ToArray();
|
||||
}
|
||||
|
||||
List<IHierarchyItem> sortedChildren = children.Where(x => x.ItemType == ItemType.Folder).OrderBy(x => x.DisplayName).ToList();
|
||||
|
@ -352,7 +353,31 @@ namespace WebsitePanel.WebDav.Core.Managers
|
|||
}
|
||||
|
||||
return path.Split('/').Last(); ;
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<IHierarchyItem> FilterResult(IEnumerable<IHierarchyItem> items)
|
||||
{
|
||||
var result = items.ToList();
|
||||
|
||||
foreach (var item in items)
|
||||
{
|
||||
foreach (var itemToIgnore in WebDavAppConfigManager.Instance.FilesToIgnore)
|
||||
{
|
||||
var regex = new Regex(itemToIgnore.Regex);
|
||||
|
||||
Match match = regex.Match(item.DisplayName.Trim('/'));
|
||||
|
||||
if (match.Success && result.Contains(item))
|
||||
{
|
||||
result.Remove(item);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue