Esempio n. 1
0
        public void BuildNavigation(string name, NavigationBuilder builder)
        {
            if (!String.Equals(name, "admin", StringComparison.OrdinalIgnoreCase))
            {
                return;
            }

            builder
                .Add(T["Demo"], "10", themes => themes
                    .AddClass("demo")
                    .Add(T["This Menu Item 1.1"], "0", installed => installed
                        .Add(T["This is Menu Item 1.1"])
                        .Add(T["This is Menu Item 1.2"])
                        .Add(T["This is Menu Item 1.2"])
                    )
                    .Add(T["This Menu Item 2.1"], "0", installed => installed
                        .Add(T["This is Menu Item 2.1"])
                        .Add(T["This is Menu Item 2.2"])
                        .Add(T["This is Menu Item 3.2"])
                    )
                    .Add(T["This Menu Item 3.1"], "0", installed => installed
                        .Add(T["This is Menu Item 3.1"])
                        .Add(T["This is Menu Item 3.2"])
                    )
                );
        }
Esempio n. 2
0
        public void BuildNavigation(string name, NavigationBuilder builder)
        {
            if (!String.Equals(name, "admin", StringComparison.OrdinalIgnoreCase))
            {
                return;
            }

            var contentTypeDefinitions = _contentDefinitionManager.ListTypeDefinitions().OrderBy(d => d.Name);

            builder.Add(T["Content"], "1.4", content => content
                .Permission(Permissions.EditOwnContent)
                .AddClass("content")
                .Add(T["Content Items"], "1", contentItems => contentItems
                    .Action("List", "Admin", new { area = "Orchard.Contents", id = "" })
                    .LocalNav())
                );

            var contentTypes = contentTypeDefinitions.Where(ctd => ctd.Settings.ToObject<ContentTypeSettings>().Creatable).OrderBy(ctd => ctd.DisplayName);
            if (contentTypes.Any()) {
                builder.Add(T["New"], "-1", newMenu =>
                {
                    newMenu.LinkToFirstChild(false).AddClass("new");
                    foreach (var contentTypeDefinition in contentTypes)
                    {
                        var ci = _contentManager.New(contentTypeDefinition.Name);
                        var cim = _contentManager.GetItemMetadata(ci);
                        var createRouteValues = cim.CreateRouteValues;
                        if (createRouteValues.Any())
                            newMenu.Add(new LocalizedString(contentTypeDefinition.DisplayName, contentTypeDefinition.DisplayName), "5", item => item
                                .Action(cim.CreateRouteValues["Action"] as string, cim.CreateRouteValues["Controller"] as string, cim.CreateRouteValues)
                                // Apply "PublishOwn" permission for the content type
                                //.Permission(DynamicPermissions.CreateDynamicPermission(DynamicPermissions.PermissionTemplates[Permissions.PublishOwnContent.Name], contentTypeDefinition)
                                );
                    }
                });
            }
        }
Esempio n. 3
0
        public void BuildNavigation(string name, NavigationBuilder builder)
        {
            if (!String.Equals(name, "admin", StringComparison.OrdinalIgnoreCase))
            {
                return;
            }

            builder
                .Add(T["Content"], content => content
                    .Add(T["Roles"], "5", installed => installed
                        .Action("Index", "Admin", "Orchard.Roles")
                        .Permission(Permissions.ManageRoles)
                        .LocalNav()
                    )
                );
        }
Esempio n. 4
0
        public void BuildNavigation(string name, NavigationBuilder builder)
        {
            if (!String.Equals(name, "admin", StringComparison.OrdinalIgnoreCase))
            {
                return;
            }

            builder
                .Add(T["Themes"], "10", themes => themes
                    .AddClass("themes")
                    .Permission(Permissions.ApplyTheme)
                    .Add(T["Active Themes"], "0", installed => installed
                        .Action("Index", "Admin", new { area = "Orchard.Themes" })
                        .Permission(Permissions.ApplyTheme)
                        .LocalNav()
                    )
                );
        }
Esempio n. 5
0
        public void BuildNavigation(string name, NavigationBuilder builder)
        {
            if (!String.Equals(name, "admin", StringComparison.OrdinalIgnoreCase))
            {
                return;
            }

            builder.Add(T["Content Definition"], "1", contentDefinition => contentDefinition
                .LinkToFirstChild(true)
                    .Add(T["Content Types"], "1", contentTypes => contentTypes
                        .Action("List", "Admin", new { area = "Orchard.ContentTypes" })
                        .Permission(Permissions.ViewContentTypes)
                        .LocalNav())
                    .Add(T["Content Parts"], "2", contentParts => contentParts
                        .Action("ListParts", "Admin", new { area = "Orchard.ContentTypes" })
                        .Permission(Permissions.ViewContentTypes)
                        .LocalNav())
                    );
        }