protected override ListItem[] GetListItems()
        {
            ParameterCollection query = Parameter.Equal("State", ContentState.Published);

            if (LinkedType != null && LinkedType != typeof(ContentItem))
            {
                query &= Parameter.TypeEqual(LinkedType);
            }

            if (ExcludedType != null)
            {
                query &= Parameter.TypeNotEqual(ExcludedType);
            }

            if (!Is(EditableItemSelectionFilter.Pages))
            {
                query &= Parameter.IsNotNull("ZoneName");
            }
            if (!Is(EditableItemSelectionFilter.Parts))
            {
                query &= Parameter.IsNull("ZoneName");
            }

            var items = Engine.Content.Search.Repository.Select(query, "ID", "Title");

            return(items.Select(row => new ListItem((string)row["Title"], row["ID"].ToString()))
                   .ToArray());
        }
Esempio n. 2
0
 public static Parameter State(ContentState expectedState)
 {
     return(Parameter.Equal("State", expectedState));
 }
Esempio n. 3
0
 public static ParameterCollection BelowOrSelf(ContentItem ancestorOrSelf)
 {
     return(Parameter.Equal("ID", ancestorOrSelf.ID)
            | Parameter.Like("AncestralTrail", ancestorOrSelf.GetTrail() + "%"));
 }
Esempio n. 4
0
 public static Parameter TypeEqual(string discriminator)
 {
     return(Parameter.Equal("class", discriminator));
 }