protected override void GetItemMetadata(GetContentItemMetadataContext context)
        {
            var hotel = context.ContentItem.As<HotelPart>();

            if (hotel == null) return;

            context.Metadata.CreateRouteValues = new RouteValueDictionary
                {
                    { "Area", "Summit.Core" },
                    { "Controller", "HotelAdmin" },
                    { "Action", "Create" },
                    { "destinationId", hotel.DestinationPart.Id }
                };
            context.Metadata.EditorRouteValues = new RouteValueDictionary
                {
                    { "Area", "Summit.Core" },
                    { "Controller", "HotelAdmin" },
                    { "Action", "Edit" },
                    { "hotelId", context.ContentItem.Id },
                    { "destinationId", hotel.DestinationPart.Id }
                };
            context.Metadata.RemoveRouteValues = new RouteValueDictionary
                {
                    { "Area", "Summit.Core" },
                    { "Controller", "HotelAdmin" },
                    { "Action", "Delete" },
                    { "hotelId", context.ContentItem.Id },
                    { "destinationId", hotel.DestinationPart.Id }
                };
        }
示例#2
0
        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var Timetable = context.ContentItem.As<TimetablePart>();

            if (Timetable == null)
                return;

            var TimetableSlug = Timetable.Id == _routableHomePageProvider.GetHomePageId(_workContextAccessor.GetContext().CurrentSite.HomePage)
                ? ""
                : Timetable.As<RoutePart>().Slug;

            context.Metadata.DisplayRouteValues = new RouteValueDictionary {
                {"Area", "Alois.Timetables"},
                {"Controller", "Timetable"},
                {"Action", "Item"},
                {"TimetableSlug", TimetableSlug}
            };
            context.Metadata.CreateRouteValues = new RouteValueDictionary {
                {"Area", "Alois.Timetables"},
                {"Controller", "TimetableAdmin"},
                {"Action", "Create"}
            };
            context.Metadata.EditorRouteValues = new RouteValueDictionary {
                {"Area", "Alois.Timetables"},
                {"Controller", "TimetableAdmin"},
                {"Action", "Edit"},
                {"TimetableId", context.ContentItem.Id}
            };
            context.Metadata.RemoveRouteValues = new RouteValueDictionary {
                {"Area", "Alois.Timetables"},
                {"Controller", "TimetableAdmin"},
                {"Action", "Remove"},
                {"TimetableId", context.ContentItem.Id}
            };
        }
 protected override void GetItemMetadata(GetContentItemMetadataContext context)
 {
     if (context.ContentItem.ContentType != "Site")
         return;
     base.GetItemMetadata(context);
     context.Metadata.EditorGroupInfo.Add(new GroupInfo(T("Comments")));
 }
        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var TimetableAppointment = context.ContentItem.As<TimetableAppointmentPart>();
            
            if (TimetableAppointment == null)
                return;

            context.Metadata.CreateRouteValues = new RouteValueDictionary {
                {"Area", "Alois.Timetables"},
                {"Controller", "TimetableAppointmentAdmin"},
                {"Action", "Create"},
                {"TimetableId", TimetableAppointment.TimetablePart.Id}
            };
            context.Metadata.EditorRouteValues = new RouteValueDictionary {
                {"Area", "Alois.Timetables"},
                {"Controller", "TimetableAppointmentAdmin"},
                {"Action", "Edit"},
                {"postId", context.ContentItem.Id},
                {"TimetableId", TimetableAppointment.TimetablePart.Id}
            };
            context.Metadata.RemoveRouteValues = new RouteValueDictionary {
                {"Area", "Alois.Timetables"},
                {"Controller", "TimetableAppointmentAdmin"},
                {"Action", "Delete"},
                {"postId", context.ContentItem.Id},
                {"TimetableSlug", TimetableAppointment.TimetablePart.As<RoutePart>().Slug}
            };
        }
示例#5
0
 public override void GetContentItemMetadata(GetContentItemMetadataContext context) {
     if (context.Metadata.CreateRouteValues == null) {
         context.Metadata.CreateRouteValues = new RouteValueDictionary {
             {"Area", "Contents"},
             {"Controller", "Admin"},
             {"Action", "Create"},
             {"Id", context.ContentItem.ContentType}
         };
     }
     if (context.Metadata.EditorRouteValues == null) {
         context.Metadata.EditorRouteValues = new RouteValueDictionary {
             {"Area", "Contents"},
             {"Controller", "Admin"},
             {"Action", "Edit"},
             {"Id", context.ContentItem.Id}
         };
     }
     if (context.Metadata.DisplayRouteValues == null) {
         context.Metadata.DisplayRouteValues = new RouteValueDictionary {
             {"Area", "Contents"},
             {"Controller", "Item"},
             {"Action", "Display"},
             {"Id", context.ContentItem.Id}
         };
     }
     if (context.Metadata.RemoveRouteValues == null) {
         context.Metadata.RemoveRouteValues = new RouteValueDictionary {
             {"Area", "Contents"},
             {"Controller", "Admin"},
             {"Action", "Remove"},
             {"Id", context.ContentItem.Id}
         };
     }
 }
 protected override void GetItemMetadata(GetContentItemMetadataContext context) {
     if (context.ContentItem.ContentType != "Site")
         return;
     base.GetItemMetadata(context);
     // Add in the menu option for the Settings
     context.Metadata.EditorGroupInfo.Add(new GroupInfo(T("Page Title Override")));
 }
示例#7
0
        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var part = context.ContentItem.As<LayerPart>();

            if (part != null) {
                 context.Metadata.Identity.Add("Layer.LayerName", part.Name);
            }
        }
示例#8
0
 protected override void GetContentItemMetadata(GetContentItemMetadataContext context, TPart instance)
 {
     if (OnGetItemMetadata != null)
     {
         OnGetItemMetadata(context, instance);
     }
 }
示例#9
0
        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var part = context.ContentItem.As<ITitleAspect>();

            if (part != null) {
                context.Metadata.DisplayText = part.Title;
            }
        }
示例#10
0
        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var part = context.ContentItem.As<IdentityPart>();

            if (part != null) {
                context.Metadata.Identity.Add("Identifier", part.Identifier);
            }
        }
        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var widget = context.ContentItem.As<WidgetPart>();

            if (widget == null)
                return;

            // create needs to go through the add widget flow (index -> [select layer -> ] add [widget type] to layer)
            context.Metadata.CreateRouteValues = new RouteValueDictionary {
                {"Area", "Orchard.Widgets"},
                {"Controller", "Admin"},
                {"Action", "Index"}
            };
            context.Metadata.EditorRouteValues = new RouteValueDictionary {
                {"Area", "Orchard.Widgets"},
                {"Controller", "Admin"},
                {"Action", "EditWidget"},
                {"Id", context.ContentItem.Id}
            };
            // remove goes through edit widget...
            context.Metadata.RemoveRouteValues = new RouteValueDictionary {
                {"Area", "Orchard.Widgets"},
                {"Controller", "Admin"},
                {"Action", "EditWidget"},
                {"Id", context.ContentItem.Id}
            };
        }
 protected override void GetItemMetadata(GetContentItemMetadataContext context)
 {
     var featuredItemPart = context.ContentItem.As<FeaturedItemPart>();
     if (featuredItemPart != null) {
         context.Metadata.DisplayText = featuredItemPart.Headline;
     }
 }
        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var blogPost = context.ContentItem.As<BlogPostPart>();

            // BlogPart can be null if this is a new Blog Post item.
            if (blogPost == null || blogPost.BlogPart == null) {
                return;
            }

            context.Metadata.CreateRouteValues = new RouteValueDictionary {
                {"Area", "Orchard.Blogs"},
                {"Controller", "BlogPostAdmin"},
                {"Action", "Create"},
                {"blogId", blogPost.BlogPart.Id}
            };
            context.Metadata.EditorRouteValues = new RouteValueDictionary {
                {"Area", "Orchard.Blogs"},
                {"Controller", "BlogPostAdmin"},
                {"Action", "Edit"},
                {"postId", context.ContentItem.Id},
                {"blogId", blogPost.BlogPart.Id}
            };
            context.Metadata.RemoveRouteValues = new RouteValueDictionary {
                {"Area", "Orchard.Blogs"},
                {"Controller", "BlogPostAdmin"},
                {"Action", "Delete"},
                {"postId", context.ContentItem.Id},
                {"blogId", blogPost.BlogPart.Id}
            };
        }
示例#14
0
        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var part = context.ContentItem.As<MenuItemPart>();

            if (part != null) {
                context.Metadata.Identity.Add("MenuItem.Url", part.Url);
            }
        }
示例#15
0
        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            if(context.ContentItem.ContentType != "Menu") {
                return;
            }

            context.Metadata.Identity.Add("name", context.ContentItem.As<TitlePart>().Title);
        }
 protected override void GetItemMetadata(GetContentItemMetadataContext context)
 {
     if (context.ContentItem.ContentType != "Site")
         return;
     base.GetItemMetadata(context);
     context.Metadata.EditorGroupInfo.Add(new GroupInfo(T("Two-Factor Authentication")));
 }
        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var part = context.ContentItem.As<PackageVersionPart>();

            if (part == null)
                return;

            var container = part.CommonPart.Container.As<PackagePart>();

            if (container == null)
                return;

            if (!String.IsNullOrWhiteSpace(container.PackageId)) {
                context.Metadata.Identity.Add("package-version-id", container.PackageId.ToLowerInvariant() + "/" + part.Version);
            }

            context.Metadata.DisplayText = container.TitlePart.Title + " " + part.Version;

            context.Metadata.DisplayRouteValues = new RouteValueDictionary {
                {"Area", "Orchard.Gallery"},
                {"Controller", "PackageVersion"},
                {"Action", "Display"},
                {"id", container.PackageId},
                {"version", part.Version}
            };
        }
示例#18
0
        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var part = context.ContentItem.As<UserPart>();

            if (part != null) {
                context.Metadata.Identity.Add("User.UserName", part.UserName);
                context.Metadata.DisplayText = part.UserName;
            }
        }
示例#19
0
 void IContentHandler.GetContentItemMetadata(GetContentItemMetadataContext context)
 {
     foreach (var filter in Filters.OfType <IContentTemplateFilter>())
     {
         filter.GetContentItemMetadata(context);
     }
     GetItemMetadata(context);
 }
示例#20
0
        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var part = context.ContentItem.As<RoutePart2>();

            if (part != null) {
                // todo: what is this for?
                //context.Metadata.Identity.Add("Route.Path", part.Slug);
            }
        }
 protected override void GetItemMetadata(GetContentItemMetadataContext context)
 {
     if (context.ContentItem.ContentType.Equals("Site"))
     {
         base.GetItemMetadata(context);
         context.Metadata.EditorGroupInfo.Add(new GroupInfo(this._localizer("Magelia WebStore")) { Id = "WebStoreSettings" });
     }
 }
        protected override void GetItemMetadata(GetContentItemMetadataContext context)
        {
            if (context.ContentItem.ContentType != "AssociativyGraph")
                return;

            base.GetItemMetadata(context);

            context.Metadata.DisplayText = context.ContentItem.As<AssociativyGraphPart>().DisplayGraphName;
        }
 protected override void GetItemMetadata(GetContentItemMetadataContext context)
 {
     if (context.ContentItem.ContentType != "Site")
         return;
     base.GetItemMetadata(context);
     var groupInfo = new GroupInfo(T("Combinator")); // Addig a new group to the "Settings" menu.
     groupInfo.Id = "Combinator";
     context.Metadata.EditorGroupInfo.Add(groupInfo);
 }
        protected override void GetItemMetadata(GetContentItemMetadataContext context)
        {
            if (context.ContentItem.ContentType != "Site")
                return;

            base.GetItemMetadata(context);

            context.Metadata.EditorGroupInfo.Add(new GroupInfo(T("User Notifications")) { Id = "NotificationWidgetSettings" });
        }
        protected override void GetItemMetadata(GetContentItemMetadataContext context)
        {
            if (context.ContentItem.ContentType != "Site")
                return;

            base.GetItemMetadata(context);

            context.Metadata.EditorGroupInfo.Add(new GroupInfo(T("Azure Application Insights")) { Id = Constants.SiteSettingsEditorGroup });
        }
        protected override void GetItemMetadata(GetContentItemMetadataContext context)
        {
            var part = context.ContentItem.As<QQUserInfoPart>();

            if (part != null)
            {
                context.Metadata.DisplayText = part.nickname;
            }
        }
 protected override void GetItemMetadata(GetContentItemMetadataContext context) {
     if (context.ContentItem.ContentType != "Site")
         return;
     base.GetItemMetadata(context);
     context.Metadata.EditorGroupInfo.Add(new GroupInfo(T("SSL")) {
         Id = "Ssl",
         Position = "2"
     });
 }
示例#28
0
        protected override void GetItemMetadata(GetContentItemMetadataContext context)
        {
            var part = context.ContentItem.As<LdapDirectoryPart>();

            if (part != null)
            {
                context.Metadata.Identity.Add("LdapDirectory.Name", part.Name);
                context.Metadata.DisplayText = part.Name;
            }
        }
        protected override void GetItemMetadata(GetContentItemMetadataContext context)
        {
            if (context.ContentItem.ContentType != "Site")
            {
                return;
            }

            base.GetItemMetadata(context);
            context.Metadata.EditorGroupInfo.Add(new GroupInfo(T("VirtoCommerce WebStore")) { Id = "WebStore" });
        }
示例#30
0
        protected override void GetItemMetadata(GetContentItemMetadataContext context)
        {
            var part = context.ContentItem.As<ResourceFormPart>();

            if (part != null)
            {
                //context.Metadata.Identity.Add("ResourceForm.Name", part.Name);
                //context.Metadata.DisplayText = part.Name;
            }
        }
示例#31
0
        protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var part = context.ContentItem.As<MenuPart>();

            if (part != null) {
                string stereotype;
                if (context.ContentItem.TypeDefinition.Settings.TryGetValue("Stereotype", out stereotype) && stereotype == "MenuItem") {
                    context.Metadata.DisplayText = part.MenuText;    
                }
            }
        }
示例#32
0
        protected override void GetItemMetadata(GetContentItemMetadataContext context)
        {
            var part = context.ContentItem.As<ExtendedMenuItemPart>();

            if (part != null) {
                string stereotype;
                if (context.ContentItem.TypeDefinition.Settings.TryGetValue("Stereotype", out stereotype) && stereotype == "MenuItem") {
                    context.Metadata.DisplayText = !string.IsNullOrWhiteSpace(part.Text) ? part.Text : "<No text>";
                }
            }
        }
示例#33
0
 protected virtual void GetItemMetadata(GetContentItemMetadataContext context)
 {
 }