public TemplateDefinition GetTemplate(string templateKey) { TemplateContainer templates = container.GetBelowRoot(); if (templates == null) { return(null); } var template = templates.GetChild(templateKey); return(CreateTemplateInfo(template)); }
public virtual IEnumerable<MagicLocation> GetLocations() { var container = containers.GetBelowRoot(); if (container == null) yield break; foreach (ContentItem child in container.GetChildren()) { yield return child as MagicLocation; } }
public TrashContainerItem GetTrashContainer(bool create) { if (!create) { container.GetBelowRoot(); } return(container.GetOrCreateBelowRoot((trashContainer) => { trashContainer.Name = TrashContainerName; trashContainer.Title = TrashContainerName; trashContainer.Visible = false; trashContainer.AuthorizedRoles.Add(new AuthorizedRole(trashContainer, "admin")); trashContainer.AuthorizedRoles.Add(new AuthorizedRole(trashContainer, "Editors")); trashContainer.AuthorizedRoles.Add(new AuthorizedRole(trashContainer, "Administrators")); trashContainer.SortOrder = int.MaxValue - 1000000; })); }
public virtual IEnumerable <MagicLocation> GetLocations() { var container = containers.GetBelowRoot(); if (container == null) { yield break; } foreach (var child in container.Children.WhereAccessible().OfType <MagicLocation>()) { if (child.Location == null || child.Location.State == ContentState.Deleted) { continue; } yield return(child as MagicLocation); } }