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());
        }
Exemplo n.º 2
0
 public static Parameter State(ContentState expectedState)
 {
     return(Parameter.Equal("State", expectedState));
 }
Exemplo n.º 3
0
 public static ParameterCollection BelowOrSelf(ContentItem ancestorOrSelf)
 {
     return(Parameter.Equal("ID", ancestorOrSelf.ID)
            | Parameter.Like("AncestralTrail", ancestorOrSelf.GetTrail() + "%"));
 }
Exemplo n.º 4
0
 public static Parameter TypeEqual(string discriminator)
 {
     return(Parameter.Equal("class", discriminator));
 }