Esempio n. 1
0
        public string GenerateUrl()
        {
            var fieldList         = CreateFieldDescriptors(RequestContext.Argument);
            var fieldeditorOption = new FieldEditorOptions(fieldList);

            fieldeditorOption.SaveItem = true;
            return(fieldeditorOption.ToUrlString().ToString());
        }
        public string GenerateUrl()
        {
            var fieldList         = CreateFieldDescriptors(RequestContext.Argument.ToLower());
            var fieldeditorOption = new FieldEditorOptions(fieldList);

            //Save item when ok button is pressed
            fieldeditorOption.SaveItem = true;
            return(fieldeditorOption.ToUrlString().ToString());
        }
Esempio n. 3
0
        private string GenerateUrl()
        {
            var fieldList          = CreateFieldDescriptors(RequestContext.Argument);
            var fieldEditorOptions = new FieldEditorOptions(fieldList)
            {
                SaveItem = true
            };

            return(fieldEditorOptions.ToUrlString().ToString());
        }
        public static string GenerateFieldEditorUrl(Item item, IEnumerable <TemplateField> fields)
        {
            var fieldsEditor = string.Join("|", fields.Select(x => x.FieldName));

            FieldEditorOptions fieldEditorOption = new FieldEditorOptions(CreateFieldDescriptors(item, fieldsEditor));

            fieldEditorOption.SaveItem         = true;
            fieldEditorOption.PreserveSections = true;
            return(fieldEditorOption.ToUrlString().ToString());
        }
Esempio n. 5
0
        /// <summary>
        /// Generates the url for the editor dialog.
        /// </summary>
        /// <returns>
        /// Returns the url for the dialog form.
        /// </returns>
        public string GenerateUrl()
        {
            List <FieldDescriptor> fieldList = RequestContext.Item.CreateFieldDescriptors();

            FieldEditorOptions fieldeditorOption = new FieldEditorOptions(fieldList)
            {
                PreserveSections = true,
                //Save item when ok button is pressed
                SaveItem = true
            };

            return(fieldeditorOption.ToUrlString().ToString());
        }
Esempio n. 6
0
        public string GenerateUrl()
        {
            var parameters        = WebUtil.ParseQueryString(RequestContext.Argument);
            var fieldeditorOption = new FieldEditorOptions(CreateFieldDescriptors(parameters["fieldnames"], parameters["datasource"]));

            if (!string.IsNullOrWhiteSpace(parameters["dialogtitle"]))
            {
                fieldeditorOption.DialogTitle = parameters["dialogtitle"];
            }

            bool boolValue;

            fieldeditorOption.PreserveSections = !bool.TryParse(parameters["preservesections"], out boolValue) || boolValue;

            fieldeditorOption.SaveItem = true;
            return(fieldeditorOption.ToUrlString().ToString());
        }
        public void Run(ClientPipelineArgs args)
        {
            if (!args.IsPostBack)
            {
                var item   = Sitecore.Data.Database.GetItem(ItemUri.Parse(args.Parameters["uri"]));
                var fields = new List <FieldDescriptor>();
                FieldEditorOptions options = new FieldEditorOptions(fields);
                options.SaveItem    = true;
                options.DialogTitle = "Item Bucket settings";
                foreach (var fieldDescriptor in GetFields(item).Select(s => new FieldDescriptor(item, s)))
                {
                    options.Fields.Add(fieldDescriptor);
                }
                Context.ClientPage.ClientResponse.ShowModalDialog(options.ToUrlString().ToString(), true);

                args.WaitForPostBack();
            }
        }
        public void Run(ClientPipelineArgs args)
        {
            if (!args.IsPostBack)
            {
                var item = Sitecore.Data.Database.GetItem(ItemUri.Parse(args.Parameters["uri"]));
                var fields = new List<FieldDescriptor>();
                FieldEditorOptions options = new FieldEditorOptions(fields);
                options.SaveItem = true;
                options.DialogTitle = "Item Bucket settings";
                foreach (var fieldDescriptor in GetFields(item).Select(s => new FieldDescriptor(item, s)))
                {
                    options.Fields.Add(fieldDescriptor);
                }
                Context.ClientPage.ClientResponse.ShowModalDialog(options.ToUrlString().ToString(), true);

                args.WaitForPostBack();
            }


        }
Esempio n. 9
0
        private void OpenEditDialog(Item item)
        {
            if (item == null)
            {
                return;
            }

            var fieldList          = this.CreateFieldDescriptors(item);
            var fieldEditorOptions = new FieldEditorOptions(fieldList)
            {
                SaveItem = true,
            };
            var url = fieldEditorOptions.ToUrlString().ToString();

            SheerResponse.ShowModalDialog(new ModalDialogOptions(url)
            {
                Width           = "800",
                Height          = "600",
                Response        = false,
                ForceDialogSize = false,
            });
        }