/pigeoncms/Controls/ContentEditorControl.ascx.cs

http://pigeoncms.googlecode.com/ · C# · 105 lines · 76 code · 9 blank · 20 comment · 3 complexity · eb14bdd02b4adae76fc043e67c182765 MD5 · raw file

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