Exemple #1
0
        public static string GetCommandsHtml(SiteInfo siteInfo, Dictionary <string, List <Menu> > pluginMenus, ContentInfo contentInfo, string pageUrl, string administratorName, bool isEdit)
        {
            var builder = new StringBuilder();

            if (isEdit || administratorName == contentInfo.AddUserName)
            {
                builder.Append($@"<a href=""{PageContentAdd.GetRedirectUrlOfEdit(siteInfo.Id, contentInfo.ChannelId, contentInfo.Id, pageUrl)}"">编辑</a>");
            }

            if (pluginMenus != null)
            {
                foreach (var pluginId in pluginMenus.Keys)
                {
                    var contentMenus = pluginMenus[pluginId];
                    if (contentMenus != null && contentMenus.Count > 0)
                    {
                        foreach (var menu in contentMenus)
                        {
                            var href = PluginMenuManager.GetMenuContentHref(pluginId, menu.Href, siteInfo.Id,
                                                                            contentInfo.ChannelId, contentInfo.Id, pageUrl);

                            builder.Append(string.IsNullOrEmpty(menu.Target)
                                ? $@"<a class=""m-l-5"" href=""javascript:;"" onclick=""{LayerUtils.GetOpenScript(menu.Text, href)}"">{menu.Text}</a>"
                                : $@"<a class=""m-l-5"" href=""{href}"" target=""{menu.Target}"">{menu.Text}</a>");
                        }
                    }
                }
            }

            return(builder.ToString());
        }
Exemple #2
0
 private static string GetContentEditUrl(EContentModelType modelType, int publishmentSystemId, int nodeId, int id, string returnUrl)
 {
     if (modelType == EContentModelType.GovPublic)
     {
         return(PageGovPublicContentAdd.GetRedirectUrlOfEdit(publishmentSystemId, nodeId, id, returnUrl));
     }
     if (modelType == EContentModelType.Vote)
     {
         return(PageVoteContentAdd.GetRedirectUrlOfEdit(publishmentSystemId, nodeId, id, returnUrl));
     }
     return(PageContentAdd.GetRedirectUrlOfEdit(publishmentSystemId, nodeId, id, returnUrl));
 }
Exemple #3
0
        public static string GetCommandsHtml(SiteInfo siteInfo, Dictionary<string, List<HyperLink>> pluginLinks, ContentInfo contentInfo, string pageUrl, string administratorName, bool isEdit)
        {
            var builder = new StringBuilder();

            if (isEdit || administratorName == contentInfo.AddUserName)
            {
                builder.Append($@"<a href=""{PageContentAdd.GetRedirectUrlOfEdit(siteInfo.Id, contentInfo.ChannelId, contentInfo.Id, pageUrl)}"">编辑</a>");
            }

            //if (isComment)
            //{
            //    //var urlComment = PageComment.GetRedirectUrl(siteInfo.SiteId, contentInfo.ChannelId, contentInfo.Id, pageUrl);
            //    var urlComment = PageComments.GetRedirectUrl(siteInfo.Id, contentInfo.ChannelId, contentInfo.Id, pageUrl);
            //    builder.Append(
            //        $@"<a style=""margin:0 5px"" href=""{urlComment}"">评论<span style=""color:gray"">({contentInfo
            //            .Comments})</span></a>");
            //}

            if (pluginLinks != null)
            {
                foreach (var pluginId in pluginLinks.Keys)
                {
                    var contentLinks = pluginLinks[pluginId];
                    if (contentLinks != null && contentLinks.Count > 0)
                    {
                        foreach (var link in contentLinks)
                        {
                            var originalUrl = link.NavigateUrl;
                            link.NavigateUrl = PluginMenuManager.GetMenuContentHref(pluginId, originalUrl, siteInfo.Id, contentInfo.ChannelId, contentInfo.Id, pageUrl);

                            builder.Append("&nbsp;&nbsp;").Append(ControlUtils.GetControlRenderHtml(link));

                            link.NavigateUrl = originalUrl;

                            //builder.Append(
                            //    $@"<a style=""margin:0 5px"" href=""{href}"" {(string.IsNullOrEmpty(link.Target) ? string.Empty : "target='" + link.Target + "'")}>{link.Text}</a>");
                        }
                    }
                }
            }

            return builder.ToString();
        }
Exemple #4
0
 public static string GetContentAddEditUrl(int siteId, ChannelInfo nodeInfo, int id, string returnUrl)
 {
     return(PageContentAdd.GetRedirectUrlOfEdit(siteId, nodeInfo.Id, id, returnUrl));
 }
Exemple #5
0
 public static string GetContentAddAddUrl(int siteId, ChannelInfo nodeInfo, string returnUrl)
 {
     return(PageContentAdd.GetRedirectUrlOfAdd(siteId, nodeInfo.Id, returnUrl));
 }
Exemple #6
0
 public static string GetContentAddUploadWordUrl(int siteId, ChannelInfo nodeInfo, bool isFirstLineTitle, bool isFirstLineRemove, bool isClearFormat, bool isFirstLineIndent, bool isClearFontSize, bool isClearFontFamily, bool isClearImages, int contentLevel, string fileName, string returnUrl)
 {
     return
         ($"{PageContentAdd.GetRedirectUrlOfAdd(siteId, nodeInfo.Id, returnUrl)}&isUploadWord=True&isFirstLineTitle={isFirstLineTitle}&isFirstLineRemove={isFirstLineRemove}&isClearFormat={isClearFormat}&isFirstLineIndent={isFirstLineIndent}&isClearFontSize={isClearFontSize}&isClearFontFamily={isClearFontFamily}&isClearImages={isClearImages}&contentLevel={contentLevel}&fileName={fileName}");
 }
Exemple #7
0
 public static string GetContentAddAddUrl(int siteId, int channelId, string returnUrl)
 {
     return(PageContentAdd.GetRedirectUrlOfAdd(siteId, channelId, returnUrl));
 }