示例#1
0
 //
 //=============================================================================================
 //
 public string getRenderedActiveContent(string RequestName)
 {
     try {
         return(ActiveContentController.processWysiwygResponseForSave(core, GenericController.encodeText(getProperty(RequestName).value)));
     } catch (Exception ex) {
         LogController.logError(core, ex);
         throw;
     }
 }
示例#2
0
        //
        //====================================================================================================
        /// <summary>
        /// Process the active editor form
        /// </summary>
        /// <param name="core"></param>
        public static void processActiveEditor(CoreController core)
        {
            //
            string Button      = null;
            int    ContentID   = 0;
            string ContentName = null;
            int    RecordID    = 0;
            string FieldName   = null;
            string ContentCopy = null;

            //
            Button = core.docProperties.getText("Button");
            switch (Button)
            {
            case ButtonCancel:
                //
                // ----- Do nothing, the form will reload with the previous contents
                //
                break;

            case ButtonSave:
                //
                // ----- read the form fields
                //
                ContentID   = core.docProperties.getInteger("cid");
                RecordID    = core.docProperties.getInteger("id");
                FieldName   = core.docProperties.getText("fn");
                ContentCopy = core.docProperties.getText("ContentCopy");
                //
                // ----- convert editor active edit icons
                //
                ContentCopy = ActiveContentController.processWysiwygResponseForSave(core, ContentCopy);
                //
                // ----- save the content
                //
                ContentName = MetadataController.getContentNameByID(core, ContentID);
                if (!string.IsNullOrEmpty(ContentName))
                {
                    using (var csData = new CsModel(core)) {
                        csData.open(ContentName, "ID=" + DbController.encodeSQLNumber(RecordID), "", false);
                        if (csData.ok())
                        {
                            csData.set(FieldName, ContentCopy);
                        }
                        csData.close();
                    }
                }
                break;
            }
        }
示例#3
0
 //
 //====================================================================================================
 /// <summary>
 /// Converts html content from wysiwyg editors to be saved. See EncodeHtmlForWysiwygEditor() for more details.
 /// </summary>
 /// <param name="Source"></param>
 /// <returns></returns>
 public override string DecodeHtmlFromWysiwygEditor(string Source)
 {
     return(ActiveContentController.processWysiwygResponseForSave(cp.core, Source));
 }
示例#4
0
 //
 //====================================================================================================
 /// <summary>
 /// Converts html content to the wysiwyg editor compatible format that includes edit icons for addons. Use this to convert the html content added to wysiwyg editors. Use EncodeHtmlFromWysiwygEditor() before saving back to Db.
 /// </summary>
 /// <param name="Source"></param>
 /// <returns></returns>
 public override string EncodeHtmlForWysiwygEditor(string Source)
 {
     return(ActiveContentController.renderHtmlForWysiwygEditor(cp.core, Source));
 }
示例#5
0
 //
 // ====================================================================================================
 //
 public override string EncodeContentForWeb(string Source, string ContextContentName = "", int ContextRecordId = 0, int WrapperId = 0)
 {
     return(ActiveContentController.renderHtmlForWeb(cp.core, Source, ContextContentName, ContextRecordId, 0, "", WrapperId, CPUtilsBaseClass.addonContext.ContextPage));
 }
 //
 public string EncodeContent9(string Source, int personalizationPeopleId, string ContextContentName, int ContextRecordID, int ContextContactPeopleID, bool PlainText, bool AddLinkEID, bool EncodeActiveFormatting, bool EncodeActiveImages, bool EncodeActiveEditIcons, bool EncodeActivePersonalization, string AddAnchorQuery, string ProtocolHostString, bool IsEmailContent, int DefaultWrapperID, String ignore_TemplateCaseOnly_Content, int addonContext)
 {
     return(ActiveContentController.encode(core, Source, personalizationPeopleId, ContextContentName, ContextRecordID, ContextContactPeopleID, PlainText, AddLinkEID, EncodeActiveFormatting, EncodeActiveImages, EncodeActiveEditIcons, EncodeActivePersonalization, AddAnchorQuery, ProtocolHostString, IsEmailContent, DefaultWrapperID, ignore_TemplateCaseOnly_Content, (CPUtilsClass.addonContext)addonContext, core.session.isAuthenticated, null, false));
 }