예제 #1
0
        protected override void CreateChildControls()
        {
            if (EditMode == PropertyEditorMode.Edit)
            {
                var pnlEditor = new Panel();
                if (string.IsNullOrEmpty(CssClass))
                {
                    pnlEditor.CssClass = "dnnLeft";
                }
                else
                {
                    pnlEditor.CssClass = string.Format("{0} dnnLeft", CssClass);
                }


                RichTextEditor           = HtmlEditorProvider.Instance();
                RichTextEditor.ControlID = ID + "edit";
                RichTextEditor.Initialize();
                RichTextEditor.Height = ControlStyle.Height;
                RichTextEditor.Width  = ControlStyle.Width;
                if (RichTextEditor.Height.IsEmpty)
                {
                    RichTextEditor.Height = new Unit(250);
                }

                RichTextEditor.Width = new Unit(400);

                Controls.Clear();
                pnlEditor.Controls.Add(RichTextEditor.HtmlEditorControl);
                Controls.Add(pnlEditor);
            }
            base.CreateChildControls();
        }
예제 #2
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            _richTextEditor           = HtmlEditorProvider.Instance();
            _richTextEditor.ControlID = ID;
            _richTextEditor.Initialize();
        }
예제 #3
0
        protected void Page_Init(object sender, EventArgs e)
        {
            this.RichTextEditor           = HtmlEditorProvider.Instance();
            this.RichTextEditor.ControlID = this.ID;
            this.RichTextEditor.Initialize();

            this.optRender.SelectedIndexChanged += new EventHandler(this.optRender_SelectedIndexChanged);
            this.optView.SelectedIndexChanged   += new EventHandler(this.optView_SelectedIndexChanged);
        }
예제 #4
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            this._richTextEditor = HtmlEditorProvider.Instance();

            if (this.IsRichEditorAvailable)
            {
                this._richTextEditor.ControlID = this.ID;
                this._richTextEditor.Initialize();
            }
        }
예제 #5
0
        /// <Summary>CreateChildControls creates the controls collection</Summary>
        protected override void CreateChildControls()
        {
            RichTextEditor           = HtmlEditorProvider.Instance();
            RichTextEditor.ControlID = this.ID + "edit";
            RichTextEditor.Initialize();
            RichTextEditor.Height = this.ControlStyle.Height;
            RichTextEditor.Width  = this.ControlStyle.Width;

            Controls.Clear();
            Controls.Add(RichTextEditor.HtmlEditorControl);

            base.CreateChildControls();
        }
예제 #6
0
        protected override void CreateChildControls()
        {
            if (this.EditMode == PropertyEditorMode.Edit)
            {
                var pnlEditor = new Panel();
                if (string.IsNullOrEmpty(this.CssClass))
                {
                    pnlEditor.CssClass = "dnnLeft";
                }
                else
                {
                    pnlEditor.CssClass = string.Format("{0} dnnLeft", this.CssClass);
                }

                this._richTextEditor = HtmlEditorProvider.Instance();
                if (this._richTextEditor != null)
                {
                    this._richTextEditor.ControlID = this.ID + "edit";
                    this._richTextEditor.Initialize();
                    this._richTextEditor.Height = this.ControlStyle.Height;
                    this._richTextEditor.Width  = this.ControlStyle.Width;
                    if (this._richTextEditor.Height.IsEmpty)
                    {
                        this._richTextEditor.Height = new Unit(250);
                    }

                    this._richTextEditor.Width = new Unit(400);
                }
                else
                {
                    this._defaultTextEditor = new TextBox
                    {
                        ID       = this.ID + "edit",
                        Width    = this.ControlStyle.Width.IsEmpty ? new Unit(300) : this.ControlStyle.Width,
                        Height   = this.ControlStyle.Height.IsEmpty ? new Unit(250) : this.ControlStyle.Height,
                        TextMode = TextBoxMode.MultiLine,
                    };
                    this._defaultTextEditor.Attributes.Add("aria-label", "editor");
                }

                this.Controls.Clear();
                pnlEditor.Controls.Add(this.TextEditControl);
                this.Controls.Add(pnlEditor);
            }

            base.CreateChildControls();
        }
        protected override void CreateChildControls()
        {
            if (EditMode == PropertyEditorMode.Edit)
            {
                var pnlEditor = new Panel();
                if (string.IsNullOrEmpty(CssClass))
                {
                    pnlEditor.CssClass = "dnnLeft";
                }
                else
                {
                    pnlEditor.CssClass = string.Format("{0} dnnLeft", CssClass);
                }


                _richTextEditor = HtmlEditorProvider.Instance();
                if (_richTextEditor != null)
                {
                    _richTextEditor.ControlID = ID + "edit";
                    _richTextEditor.Initialize();
                    _richTextEditor.Height = ControlStyle.Height;
                    _richTextEditor.Width  = ControlStyle.Width;
                    if (_richTextEditor.Height.IsEmpty)
                    {
                        _richTextEditor.Height = new Unit(250);
                    }

                    _richTextEditor.Width = new Unit(400);
                }
                else
                {
                    _defaultTextEditor = new TextBox
                    {
                        ID       = ID + "edit",
                        Width    = ControlStyle.Width.IsEmpty ? new Unit(300) : ControlStyle.Width,
                        Height   = ControlStyle.Height.IsEmpty ? new Unit(250) : ControlStyle.Height,
                        TextMode = TextBoxMode.MultiLine
                    };
                }

                Controls.Clear();
                pnlEditor.Controls.Add(TextEditControl);
                Controls.Add(pnlEditor);
            }
            base.CreateChildControls();
        }
예제 #8
0
        void Page_Init(object sender, EventArgs e)
        {
            _useRichTextEditor = !GetFieldSetting("PlainText").AsBoolean() && !FilterTags;
            if (FilterScript)
            {
            }

            DefValue = DefaultValue;

            if (_useRichTextEditor)
            {
                var pnlEditor = new Panel {
                    CssClass = "dnnLeft"
                };

                RichTextEditor = HtmlEditorProvider.Instance();
                var controlId = CleanID(string.Format("{0}", FieldTitle));
                RichTextEditor.ControlID = controlId;
                RichTextEditor.Initialize();
                //RichTextEditor.Height = ControlStyle.Height;
                //RichTextEditor.Width = ControlStyle.Width;
                if (RichTextEditor.Height.IsEmpty)
                {
                    RichTextEditor.Height = new Unit(250);
                }

                RichTextEditor.Width = new Unit(400);

                Controls.Clear();
                var htmlEditorControl = RichTextEditor.HtmlEditorControl;
                pnlEditor.Controls.Add(htmlEditorControl);
                RichTextEditor.Text = DefValue;
                Controls.Add(pnlEditor);
                ValueControl = FindControl(controlId);
            }
            else
            {
                TxtBox = new TextBox {
                    TextMode = TextBoxMode.MultiLine, Rows = 7, Text = DefValue, ID = CleanID(FieldTitle)
                };
                Controls.Add(TxtBox);

                ValueControl = TxtBox;
            }
        }
예제 #9
0
        /// <summary>
        /// Initialize the DNN editor.
        /// </summary>
        /// <returns>
        /// Returns if the DNN Editor was initialized.
        /// </returns>
        private bool InitDnnEditor()
        {
            if (!Config.IsDotNetNuke)
            {
                return(false);
            }

            try
            {
                this._editor = HtmlEditorProvider.Instance();
                return(true);
            }
            catch (Exception ex)
            {
                YafContext.Current.Get <ILogger>().Error(ex, "Error in the DNN RichEditor");
            }

            return(false);
        }