public override void RenderInViewMode(HtmlTextWriter writer, CmsPage page, int identifier, CmsLanguage langToRenderFor, string[] paramList)
        {
            PlainTextContentDb db   = new PlainTextContentDb();
            string             html = db.getPlainTextContent(page, identifier, langToRenderFor, true);

            writer.WriteLine(html);
        }
        public override Rss.RssItem[] GetRssFeedItems(CmsPage page, CmsPlaceholderDefinition placeholderDefinition, CmsLanguage langToRenderFor)
        {
            Rss.RssItem        rssItem = base.CreateAndInitRssItem(page, langToRenderFor);
            PlainTextContentDb db      = new PlainTextContentDb();
            string             html    = db.getPlainTextContent(page, placeholderDefinition.Identifier, langToRenderFor, true);

            rssItem.Description = html;

            return(new Rss.RssItem[] { rssItem });
        }
        public override void RenderInEditMode(HtmlTextWriter writer, CmsPage page, int identifier, CmsLanguage langToRenderFor, string[] paramList)
        {
            PlainTextContentDb db = new PlainTextContentDb();
            string             plainTextContent = "";

            string width  = "100%";
            string height = "200px";

            if (CmsConfig.TemplateEngineVersion == CmsTemplateEngineVersion.v2)
            {
                width  = PlaceholderUtils.getParameterValue("width", width, paramList);
                height = PlaceholderUtils.getParameterValue("height", height, paramList);
            }
            else
            {
                throw new NotImplementedException("Error: invalid TemplateEngine version");
            }



            string editorId = "plaintextcontent_" + page.Id.ToString() + "_" + identifier.ToString() + langToRenderFor.shortCode;

            // ------- CHECK THE FORM FOR ACTIONS
            string action = Hatfield.Web.Portal.PageUtils.getFromForm(editorId + "_Action", "");

            if (action.Trim().ToLower() == "update")
            {
                plainTextContent = Hatfield.Web.Portal.PageUtils.getFromForm("name_" + editorId, "");
                db.saveUpdatedPlainTextContent(page, identifier, langToRenderFor, plainTextContent);
            }
            else
            {
                plainTextContent = db.getPlainTextContent(page, identifier, langToRenderFor, true);
            }

            // ------- START RENDERING
            StringBuilder html = new StringBuilder();

            // -- render the Control
            // note: no need to put in the <form></form> tags.

            html.Append("<textarea name=\"name_" + editorId + "\" id=\"" + editorId + "\" style=\"WIDTH: " + width + "; HEIGHT: " + height + ";\">");
            html.Append(plainTextContent);
            html.Append("</textarea>");

            html.Append("<input type=\"hidden\" name=\"" + editorId + "_Action\" value=\"update\">");

            writer.WriteLine(html.ToString());
        }