예제 #1
0
        public TeamMentor_Article getGuidanceItem(Guid guidanceItemId)
        {
            if (Cached_GuidanceItems.hasKey(guidanceItemId).isFalse())
            {
                return(null);
            }

            return(Cached_GuidanceItems[guidanceItemId]);
        }
예제 #2
0
        public string getGuidanceItemHtml(Guid sessionId, Guid guidanceItemId)
        {
            if (Cached_GuidanceItems.hasKey(guidanceItemId).isFalse())
            {
                return(null);
            }

            var article = Cached_GuidanceItems[guidanceItemId];


            sessionId.session_TmUser().logUserActivity("View Article Html", article.Metadata.Title);

            var articleContent = article.Content.Data.Value;

            if (articleContent.inValid())
            {
                return("");
            }

            switch (article.Content.DataType.lower())
            {
            case "raw":
                return(articleContent);

            case "html":
            {
                if (TMConfig.Current.TMSecurity.Sanitize_HtmlContent && article.Content.Sanitized.isFalse())
                {
                    return(articleContent.sanitizeHtmlContent());
                }

                return(articleContent.fixXmlDoubleEncodingIssue());
            }

            case "safehtml":
            {
                return(articleContent.sanitizeHtmlContent());
            }

            case "wikitext":
                return("<div id ='tm_datatype_wikitext'>{0}</div>".format(articleContent));

            case "markdown":
                return(articleContent.markdown_transform());

            default:
                return(articleContent);
            }
        }
예제 #3
0
        public string getGuidanceItemHtml(Guid guidanceItemId)
        {
            if (Cached_GuidanceItems.hasKey(guidanceItemId).isFalse())
            {
                return(null);
            }

            var article        = Cached_GuidanceItems[guidanceItemId];
            var articleContent = article.Content.Data.Value;

            if (articleContent.inValid())
            {
                return("");
            }

            switch (article.Content.DataType.lower())
            {
            case "raw":
                return(articleContent);

            case "html":
            {
                if (TMConfig.Current.SanitizeHtmlContent && article.Content.Sanitized.isFalse())
                {
                    return(articleContent.sanitizeHtmlContent());
                }
                else
                {
                    return(articleContent.fixXmlDoubleEncodingIssue());
                }
            }

            case "safehtml":
            {
                return(articleContent.sanitizeHtmlContent());
            }

            case "wikitext":
                return("<div id ='tm_datatype_wikitext'>{0}</div>".format(articleContent));

            default:
                return(articleContent);
            }
        }