public static string GetContentCommands(string administratorName, PublishmentSystemInfo publishmentSystemInfo, NodeInfo nodeInfo, string pageUrl, string currentFileName, bool isCheckPage) { var iconUrl = SiteServerAssets.GetIconUrl(string.Empty); var modelType = EContentModelTypeUtils.GetEnumType(nodeInfo.ContentModelId); var builder = new StringBuilder(); //添加内容 if (!isCheckPage && AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentAdd) && nodeInfo.Additional.IsContentAddable) { var redirectUrl = GetContentAddAddUrl(publishmentSystemInfo.PublishmentSystemId, nodeInfo, pageUrl); var title = "添加内容"; if (modelType == EContentModelType.GovPublic) { title = "采集信息"; } else if (modelType == EContentModelType.GovInteract) { title = "新增办件"; } else if (modelType == EContentModelType.Photo) { title = "添加图片"; } else if (modelType == EContentModelType.Vote) { title = "发起投票"; } builder.Append( $@"<a href=""{redirectUrl}""><img style=""margin-right: 3px"" src=""{iconUrl}/add.gif"" align=""absMiddle"" />{title}</a> <span class=""gray""> | </span> "); builder.Append($@"<a href=""javascript:;"" onclick=""{ModalContentImport.GetOpenWindowString(publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId)}"">导入内容</a> <span class=""gray""> | </span> "); if (modelType != EContentModelType.UserDefined && modelType != EContentModelType.Vote && modelType != EContentModelType.Job && modelType != EContentModelType.GovInteract) { builder.Append( $@"<a href=""javascript:;"" onclick=""{ModalUploadWord.GetOpenWindowString( publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, StringUtils.ValueToUrl(pageUrl))}"">导入Word</a> <span class=""gray""> | </span> "); } } //删 除 if (nodeInfo.ContentNum > 0 && AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentDelete)) { builder.Append( $@"<a href=""javascript:;"" onclick=""{PageContentDelete.GetRedirectClickStringForSingleChannel( publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, false, pageUrl)}"">删 除</a> <span class=""gray""> | </span> "); } if (nodeInfo.ContentNum > 0) { builder.Append( $@"<a href=""javascript:;"" onclick=""{ModalContentExport.GetOpenWindowString( publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId)}"">导 出</a> <span class=""gray""> | </span> "); //设置 if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentEdit)) { builder.Append( $@"<a href=""javascript:;"" onclick=""{ModalContentAttributes.GetOpenWindowString( publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId)}"">设置属性</a> <span class=""gray""> | </span> "); builder.Append( $@"<a href=""javascript:;"" onclick=""{ModalAddToGroup.GetOpenWindowStringToContent( publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId)}"">设置内容组</a> <span class=""gray""> | </span> "); } //转 移 if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentTranslate)) { var redirectUrl = PageContentTranslate.GetRedirectUrl(publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, pageUrl); var clickString = PageUtils.GetRedirectStringWithCheckBoxValue(redirectUrl, "ContentIDCollection", "ContentIDCollection", "请选择需要转移的内容!"); builder.Append( $@"<a href=""javascript:;"" onclick=""{clickString}"">转 移</a> <span class=""gray""> | </span> "); } //排 序 if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentEdit)) { builder.Append( $@"<a href=""javascript:;"" onclick=""{ModalContentTaxis.GetOpenWindowString( publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, pageUrl)}"">排 序</a> <span class=""gray""> | </span> "); } //整理 if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentOrder)) { builder.Append( $@"<a href=""javascript:;"" onclick=""{ModalContentTidyUp.GetOpenWindowString( publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, pageUrl)}"">整 理</a> <span class=""gray""> | </span> "); } //审 核 if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentCheck)) { builder.Append( $@"<a href=""javascript:;"" onclick=""{ModalContentCheck.GetOpenWindowString( publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, pageUrl)}"">审 核</a> <span class=""gray""> | </span> "); } //归 档 if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentArchive)) { builder.Append( $@"<a href=""javascript:;"" onclick=""{ModalContentArchive.GetOpenWindowString( publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, pageUrl)}"">归 档</a> <span class=""gray""> | </span> "); } //跨站转发 if (CrossSiteTransUtility.IsTranslatable(publishmentSystemInfo, nodeInfo)) { builder.Append( $@"<a href=""javascript:;"" onclick=""{ModalContentCrossSiteTrans.GetOpenWindowString( publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId)}"">跨站转发</a> <span class=""gray""> | </span> "); } //生 成 if (!isCheckPage && (AdminUtility.HasWebsitePermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, AppManager.Cms.Permission.WebSite.Create) || AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.CreatePage))) { builder.Append( $@"<a href=""javascript:;"" onclick=""{Cms.ModalProgressBar .GetOpenWindowStringWithCreateContentsOneByOne(publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId)}"">生 成</a> <span class=""gray""> | </span> "); } } //选择显示项 //if (nodeInfo.NodeType != ENodeType.BackgroundImageNode) //{ if (AdminUtility.HasChannelPermissions(administratorName, publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ChannelEdit)) { builder.Append( $@"<a href=""javascript:;"" onclick=""{ModalSelectColumns.GetOpenWindowStringToContent( publishmentSystemInfo.PublishmentSystemId, nodeInfo.NodeId, true)}"">显示项</a> "); } //} if (!isCheckPage && nodeInfo.ContentNum > 0) { if (builder.Length > 0) { builder.Length = builder.Length - 15; } //builder.Append(GetContentLinks(publishmentSystemInfo, nodeInfo, contentType, currentFileName)); builder.Append( $@" <a href=""javascript:;;"" onClick=""$('#contentSearch').toggle(); return false""><img src=""{iconUrl}/search.gif"" align=""absMiddle"" alt=""快速查找"" /></a>"); } //if (builder.Length > 0) //{ // builder.Length = builder.Length - 16; //} return(builder.ToString()); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("PublishmentSystemID", "NodeID", "ContentID", "ReturnUrl"); var nodeId = Body.GetQueryInt("NodeID"); _contentId = Body.GetQueryInt("ContentID"); _returnUrl = StringUtils.ValueFromUrl(Body.GetQueryString("ReturnUrl")); _nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, nodeId); if (!IsPostBack) { BreadCrumb(AppManager.Cms.LeftMenu.IdContent, "内容管理", string.Empty); Operation.Items.Add(new ListItem("继续添加内容", EContentAddAfter.ContinueAdd.ToString())); Operation.Items.Add(new ListItem("返回管理界面", EContentAddAfter.ManageContents.ToString())); var isContribute = CrossSiteTransUtility.IsTranslatable(PublishmentSystemInfo, _nodeInfo); var isTransOk = false; if (isContribute) { var isAutomatic = CrossSiteTransUtility.IsAutomatic(_nodeInfo); if (isAutomatic) { var targetPublishmentSystemId = 0; if (_nodeInfo.Additional.TransType == ECrossSiteTransType.SpecifiedSite) { targetPublishmentSystemId = _nodeInfo.Additional.TransPublishmentSystemID; } else if (_nodeInfo.Additional.TransType == ECrossSiteTransType.SelfSite) { targetPublishmentSystemId = PublishmentSystemId; } else if (_nodeInfo.Additional.TransType == ECrossSiteTransType.ParentSite) { targetPublishmentSystemId = PublishmentSystemManager.GetParentPublishmentSystemId(PublishmentSystemId); } if (targetPublishmentSystemId > 0) { var targetPublishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(targetPublishmentSystemId); if (targetPublishmentSystemInfo != null) { var targetNodeIdArrayList = TranslateUtils.StringCollectionToIntList(_nodeInfo.Additional.TransNodeIDs); if (targetNodeIdArrayList.Count > 0) { foreach (int targetNodeId in targetNodeIdArrayList) { CrossSiteTransUtility.TransContentInfo(PublishmentSystemInfo, _nodeInfo, _contentId, targetPublishmentSystemInfo, targetNodeId); isTransOk = true; } } } } } else { Operation.Items.Add(new ListItem("转发到其他站点", EContentAddAfter.Contribute.ToString())); } } SuccessMessage(isTransOk ? "内容添加成功并已转发到指定站点,请选择后续操作。" : "内容添加成功,请选择后续操作。"); phPublishmentSystemID.Visible = phSubmit.Visible = false; } }
public void Page_Load(object sender, EventArgs e) { PageUtils.CheckRequestParameter("PublishmentSystemID", "NodeID", "ContentID", "ReturnUrl"); var nodeID = int.Parse(Request.QueryString["NodeID"]); contentID = int.Parse(Request.QueryString["ContentID"]); returnUrl = StringUtils.ValueFromUrl(Request.QueryString["ReturnUrl"]); if (string.IsNullOrEmpty(returnUrl)) { returnUrl = PageContent.GetRedirectUrl(PublishmentSystemId, nodeID); } nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, nodeID); if (!IsPostBack) { BreadCrumb(AppManager.Wcm.LeftMenu.IdGovPublic, AppManager.Wcm.LeftMenu.GovPublic.IdGovPublicContent, "后续操作", AppManager.Wcm.Permission.WebSite.GovPublicContent); Operation.Items.Add(new ListItem("继续添加内容", EContentAddAfter.ContinueAdd.ToString())); Operation.Items.Add(new ListItem("返回管理界面", EContentAddAfter.ManageContents.ToString())); var isContribute = CrossSiteTransUtility.IsTranslatable(PublishmentSystemInfo, nodeInfo); var isTransOk = false; if (isContribute) { var isAutomatic = CrossSiteTransUtility.IsAutomatic(nodeInfo); if (isAutomatic) { var targetPublishmentSystemID = 0; if (nodeInfo.Additional.TransType == ECrossSiteTransType.SpecifiedSite) { targetPublishmentSystemID = nodeInfo.Additional.TransPublishmentSystemID; } else if (nodeInfo.Additional.TransType == ECrossSiteTransType.SelfSite) { targetPublishmentSystemID = PublishmentSystemId; } else if (nodeInfo.Additional.TransType == ECrossSiteTransType.ParentSite) { targetPublishmentSystemID = PublishmentSystemManager.GetParentPublishmentSystemId(PublishmentSystemId); } if (targetPublishmentSystemID > 0) { var targetPublishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(targetPublishmentSystemID); if (targetPublishmentSystemInfo != null) { var targetNodeIDArrayList = TranslateUtils.StringCollectionToIntList(nodeInfo.Additional.TransNodeIDs); if (targetNodeIDArrayList.Count > 0) { foreach (int targetNodeID in targetNodeIDArrayList) { CrossSiteTransUtility.TransContentInfo(PublishmentSystemInfo, nodeInfo, contentID, targetPublishmentSystemInfo, targetNodeID); isTransOk = true; } } } } } else { Operation.Items.Add(new ListItem("转发到其他站点", EContentAddAfter.Contribute.ToString())); } } if (isTransOk) { SuccessMessage("内容添加成功并已转发到指定站点,请选择后续操作。"); } else { SuccessMessage("内容添加成功,请选择后续操作。"); } PublishmentSystemIDRow.Visible = NodeIDDropDownListRow.Visible = Submit.Visible = false; } }