示例#1
0
        /// <summary>
        /// Gets called when the field is used in edit mode (GET)
        /// </summary>
        protected override DriverResult Editor(ContentPart part, Laser.Orchard.InsertStuff.Fields.InsertStuffField field, dynamic shapeHelper)
        {
            var settings = field.PartFieldDefinition.Settings.GetModel <InsertStuffFieldSettings>();

            var viewModel = new InsertStuffViewModel {
                DisplayName = field.DisplayName,
                StyleList   = string.IsNullOrWhiteSpace(settings.StyleList) ? new List <string>() : new List <string>(settings.StyleList.Split('\n')),
                ScriptList  = string.IsNullOrWhiteSpace(settings.ScriptList) ? new List <string>() : new List <string>(settings.ScriptList.Split('\n')),
                RawHtml     = settings.RawHtml,
                OnFooter    = settings.OnFooter
            };

            return(ContentShape("Fields_Laser_Orchard_InsertStuff_Edit", GetDifferentiator(field, part),
                                () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: viewModel, Prefix: GetPrefix(field, part))));
        }
示例#2
0
 /// <summary>
 /// Gets called when the field is used in edit mode (POST)
 /// </summary>
 protected override DriverResult Editor(ContentPart part, Laser.Orchard.InsertStuff.Fields.InsertStuffField field, IUpdateModel updater, dynamic shapeHelper)
 {
     return(Editor(part, field, shapeHelper));
 }