コード例 #1
0
ファイル: SiteController.cs プロジェクト: QuantumArt/QP
        public JsonResult _FolderPath(int folderId)
        {
            var folder = SiteFolderService.GetById(folderId);

            return(Json(new
            {
                success = true,
                path = folder.PathInfo.Path,
                url = folder.PathInfo.Url,
                libraryPath = folder.OsSpecificPath
            }));
        }
コード例 #2
0
        public JsonResult _FolderPath(int folderId)
        {
            var folder = SiteFolderService.GetById(folderId);

            return(new JsonResult
            {
                Data = new
                {
                    success = true,
                    path = folder.PathInfo.Path,
                    url = folder.PathInfo.Url,
                    libraryPath = folder.Path
                },
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
コード例 #3
0
        /// <summary>
        /// Делает невидимыми некоторые элементы контекстного меню для корневого Site Folder
        /// </summary>
        public static IEnumerable <BackendActionStatus> ResolveStatusesForSiteFolder(this IEnumerable <BackendActionStatus> statuses, int entityId)
        {
            var folder = SiteFolderService.GetById(entityId);

            if (!folder.ParentId.HasValue)
            {
                var codes = new[] { ActionCode.SiteFolderProperties, ActionCode.RemoveSiteFolder };
                foreach (var status in statuses)
                {
                    if (codes.Contains(status.Code))
                    {
                        status.Visible = false;
                    }
                }
            }

            return(statuses);
        }