Example #1
0
        public override string GetFieldValueAsText(object value)
        {
            HTML5HeaderField field = (HTML5HeaderField)value;

            if (field != null)
            {
                return(field.ToString());
            }
            return(string.Empty);
        }
        protected override void CreateChildControls()
        {
            this.DisableInputFieldLabel = true;
            base.ControlMode            = SPContext.Current.FormContext.FormMode;
            base.CreateChildControls();

            headerField = (HTML5HeaderField)ItemFieldValue;

            if (headerField == null)
            {
                headerField = new HTML5HeaderField();
            }
            bool design = base.DesignMode;

            if (base.ControlMode == SPControlMode.Edit || base.ControlMode == SPControlMode.New)
            {
                /*
                 * html_title = (CheckBox)this.TemplateContainer.FindControl("html_title");
                 * html_title.Checked = headerField.UseTitle;
                 *
                 * html_heading = (TextInput)this.TemplateContainer.FindControl("html_heading");
                 * html_heading.Text = headerField.Heading;
                 * html_heading.Enabled = !html_title.Checked;
                 *
                 * html_subheading = (TextInput)this.TemplateContainer.FindControl("html_subheading");
                 * html_subheading.Text = headerField.SubHeading;
                 *
                 * html_author = (CheckBox)this.TemplateContainer.FindControl("html_author");
                 * html_author.Checked = headerField.IncludeAuthor;
                 *
                 * html_date = (CheckBox)this.TemplateContainer.FindControl("html_date");
                 * html_date.Checked = headerField.IncludeDate;
                 */
                html_header_hidden       = (HiddenField)this.TemplateContainer.FindControl("html_header_hidden");
                html_header_hidden.Value = headerField.Text;

                html_header = (Header)this.TemplateContainer.FindControl("html_header");
                html_header.Controls.AddAt(0, new LiteralControl {
                    Text = headerField.Text
                });
            }
            else
            {
                html_header = (Header)this.TemplateContainer.FindControl("html_header");
                html_header.Controls.AddAt(0, new LiteralControl {
                    Text = headerField.Text
                });

                /*
                 * if (string.IsNullOrEmpty(headerField.SubHeading))
                 * {
                 *  CreateHeader(html_header);
                 * }
                 * else
                 * {
                 *  HGroup hgroup = new HGroup();
                 *  CreateGroup(hgroup);
                 *  html_header.Controls.Add(hgroup);
                 *  CreateMeta(html_header);
                 * }
                 */
            }
        }