Пример #1
0
        public override string DeleteDirectory(string path)
        {
            try
            {
                string virtualPath = FileSystemValidation.ToVirtualPath(path);

                string returnValue = DNNValidator.OnDeleteFolder(virtualPath);
                if (!(string.IsNullOrEmpty(returnValue)))
                {
                    return(returnValue);
                }

                //Are all items visible to user?
                FolderInfo folder = DNNValidator.GetUserFolder(virtualPath);
                if (!CheckAllChildrenVisible(ref folder))
                {
                    return(DNNValidator.LogDetailError(ErrorCodes.CannotDeleteFolder_ChildrenVisible));
                }


                if (string.IsNullOrEmpty(returnValue))
                {
                    FolderManager.Instance.DeleteFolder(folder);
                }

                return(returnValue);
            }
            catch (Exception ex)
            {
                return(DNNValidator.LogUnknownError(ex, path));
            }
        }