コード例 #1
0
        private IEnumerable <CategoryDescriptor> GetCategories(IContent content)
        {
            var describeContext = new DescribeElementsContext {
                Content = content
            };
            var elementCategories = _elementManager.GetCategories(describeContext).ToArray();

            return(elementCategories.Where(category => category.Elements.Any(x => !x.IsSystemElement)));
        }
コード例 #2
0
        public ActionResult Browse()
        {
            var categories = RemoveBlueprints(_elementManager.GetCategories(DescribeElementsContext.Empty)).ToArray();
            var viewModel  = new BrowseElementsViewModel {
                Categories = categories
            };

            return(View(viewModel));
        }
コード例 #3
0
        public ActionResult Browse()
        {
            if (!Services.Authorizer.Authorize(Permissions.ManageLayouts, T("Not authorized to manage layouts.")))
            {
                return(new HttpUnauthorizedResult());
            }

            var categories = RemoveBlueprints(_elementManager.GetCategories(DescribeElementsContext.Empty)).ToArray();
            var viewModel  = new BrowseElementsViewModel {
                Categories = categories
            };

            return(View(viewModel));
        }