GetMarkupString() public static method

Gets Binary of a Content Repository File in a string.
public static GetMarkupString ( string filePath ) : string
filePath string
return string
Ejemplo n.º 1
0
        /// <summary>
        /// Gets markup for a Comment control
        /// </summary>
        /// <returns></returns>
        public static string GetCommentControlMarkup(Node contextNode, string hiddenCommentsMarkup, string commentsMarkup, int commentCount, LikeInfo likeInfo)
        {
            var markupStr = WallHelper.GetMarkupString("$skin/renderers/Wall/CommentControl.html");

            if (markupStr == null)
            {
                return(null);
            }

            markupStr = ReplaceResources(markupStr);

            markupStr = markupStr.Replace("{{postid}}", contextNode.Id.ToString());
            markupStr = markupStr.Replace("{{hiddencomments}}", hiddenCommentsMarkup);
            markupStr = markupStr.Replace("{{comments}}", commentsMarkup);
            markupStr = markupStr.Replace("{{hiddencommentboxdisplay}}", commentCount > 2 ? "block" : "none");
            markupStr = markupStr.Replace("{{commentcount}}", commentCount.ToString());
            markupStr = markupStr.Replace("{{likeboxdisplay}}", likeInfo.Count > 0 ? "block" : "none");
            markupStr = markupStr.Replace("{{likes}}", likeInfo.GetLongMarkup());
            markupStr = markupStr.Replace("{{ilikedisplay}}", !likeInfo.iLike ? "inline" : "none");
            markupStr = markupStr.Replace("{{iunlikedisplay}}", likeInfo.iLike ? "inline" : "none");

            // user interaction allowed
            markupStr = markupStr.Replace("{{interactdisplay}}", WallHelper.HasWallPermission(contextNode.Path, contextNode) ? "block" : "none");

            return(markupStr);
        }
Ejemplo n.º 2
0
        public static string GetContentCardMarkup(Node sharedContent, string contextPath)
        {
            var markupStr = WallHelper.GetMarkupString("$skin/renderers/Wall/ContentCard.html");

            if (markupStr == null)
            {
                return(null);
            }

            markupStr = ReplaceResources(markupStr);

            var shareContent = Content.Create(sharedContent);
            var sharedGc     = sharedContent as GenericContent;

            markupStr = markupStr.Replace("{{shareicon}}", IconHelper.ResolveIconPath(sharedGc.Icon, 32));
            markupStr = markupStr.Replace("{{sharedisplayname}}", shareContent.DisplayName);
            markupStr = markupStr.Replace("{{sharecontenttype}}", sharedGc.NodeType.Name);

            var user = sharedContent as User;

            if (user == null)
            {
                markupStr = markupStr.Replace("{{sharepath}}", sharedGc.Path);

                var wsRelPath = sharedGc.Path;
                if (sharedGc.Path.StartsWith(contextPath) && sharedGc.Path != contextPath)
                {
                    wsRelPath = sharedGc.Path.Substring(contextPath.Length);
                }

                markupStr = markupStr.Replace("{{shareworkspacerelativepath}}", wsRelPath);
            }
            else
            {
                var path = Actions.ActionUrl(Content.Create(user), "Profile");

                markupStr = markupStr.Replace("{{sharepath}}", path);
                markupStr = markupStr.Replace("{{shareworkspacerelativepath}}", path);
            }

            return(markupStr);
        }