PageRenderTime 26ms CodeModel.GetById 8ms app.highlight 12ms RepoModel.GetById 2ms app.codeStats 0ms

/pigeoncms/Controls/ContentEditorControl.ascx.cs

http://pigeoncms.googlecode.com/
C# | 105 lines | 76 code | 9 blank | 20 comment | 3 complexity | eb14bdd02b4adae76fc043e67c182765 MD5 | raw file
  1using System;
  2using System.Collections;
  3using System.Configuration;
  4using System.Data;
  5using System.Linq;
  6using System.Web;
  7using System.Web.Security;
  8using System.Web.UI;
  9using System.Web.UI.HtmlControls;
 10using System.Web.UI.WebControls;
 11using System.Web.UI.WebControls.WebParts;
 12using System.Collections.Generic;
 13using PigeonCms;
 14
 15public partial class Controls_ContentEditorControl : PigeonCms.BaseModuleControl
 16{
 17    private ContentEditorProvider.Configuration configuration = new ContentEditorProvider.Configuration();
 18    public ContentEditorProvider.Configuration Configuration
 19    {
 20        get { return configuration; }
 21        set { configuration = value; }
 22    }
 23
 24    /// <summary>
 25    /// show readmore button
 26    /// </summary>
 27    public bool ReadMoreButton
 28    {
 29        get { return this.Configuration.ReadMoreButton; }
 30        set { this.Configuration.ReadMoreButton = value; }
 31    }
 32
 33    /// <summary>
 34    /// show pageBreak button
 35    /// </summary>
 36    public bool PageBreakButton
 37    {
 38        get { return this.Configuration.ReadMoreButton; }
 39        set { this.Configuration.PageBreakButton = value; }
 40    }
 41
 42    /// <summary>
 43    /// show file button to open filemanager 
 44    /// </summary>
 45    public bool FileButton
 46    {
 47        get { return this.Configuration.FileButton; }
 48        set { this.Configuration.FileButton = value; }
 49    }
 50
 51    /// <summary>
 52    /// content editor text
 53    /// </summary>
 54    public string Text
 55    {
 56        get { return Txt1.Text; }
 57        set { Txt1.Text = value; }
 58    }
 59
 60    protected new void Page_Init(object sender, EventArgs e)
 61    {
 62        this.BaseModule = new Module();
 63        this.BaseModule.ModuleNamespace = "PigeonCms";
 64        this.BaseModule.ModuleName = "ContentEditorControl";
 65
 66        if (this.Configuration.ReadMoreButton)
 67        {
 68            var btn = new HtmlInputButton();
 69            btn.Value = base.GetLabel("ReadMore", "Read more");
 70            btn.Attributes["onclick"] = "insertReadmore();";
 71            btn.Attributes["class"] = "button";
 72            this.PanelButtons.Controls.Add(btn);
 73        }
 74        if (this.Configuration.PageBreakButton)
 75        {
 76            var btn = new HtmlInputButton();
 77            btn.Value = base.GetLabel("Pagebreak", "Page break");
 78            btn.Attributes["onclick"] = "insertPagebreak();";
 79            btn.Attributes["class"] = "button";
 80            this.PanelButtons.Controls.Add(btn);
 81        }
 82        if (this.Configuration.FileButton)
 83        {
 84            var btn = new HtmlInputButton();
 85            btn.Value = base.GetLabel("File", "File");
 86            btn.Attributes["onclick"] = "insertFile();";
 87            btn.Attributes["class"] = "button";
 88            this.PanelButtons.Controls.Add(btn);
 89        }
 90        //if (this.Configuration.ToggleEditor)
 91        //{
 92        //    var btn = new HtmlInputButton();
 93        //    btn.Value = base.GetLabel("Html", "Html");
 94        //    btn.Attributes["onclick"] = "toggleEditor();";
 95        //    btn.Attributes["class"] = "button";
 96        //    this.PanelButtons.Controls.Add(btn);
 97        //}
 98
 99        base.Page_Init(sender, e);
100    }
101
102    protected void Page_Load(object sender, EventArgs e)
103    {
104    }
105}