internal static ContentBlockDto Init(this ContentBlockDto dto, BlockConfiguration block, IEnumerable <ModuleWithContent> blockModules) { dto.Id = block.Id; dto.Guid = block.Guid; dto.Modules = blockModules.Select(m => new InstanceDto().Init(m.Module, m.Page)); return(dto); }
public JsContextAll Init(string systemRootUrl, IBlock block, ILog parentLog) { Log.LinkTo(parentLog); var ctx = block.Context; Environment = new JsContextEnvironment(systemRootUrl, ctx); Language = _jsLangCtx.Init(ctx.Site, block.ZoneId); User = new JsContextUser(ctx.User); ContentBlockReference = new ContentBlockReferenceDto(block, ctx.Publishing.Mode); ContentBlock = new ContentBlockDto(block); Ui = new UiDto(((BlockBuilder)block.BlockBuilder)?.UiAutoToolbar ?? false); error = new ErrorDto(block); return(this); }