public void Page_Load(object sender, EventArgs e) { PageUtils.CheckRequestParameter("PublishmentSystemID"); if (IsPostBack) { return; } LtlCategoryChannel.Text = string.Format($@"<a href='{PageContent.GetRedirectUrl(PublishmentSystemId, PublishmentSystemInfo.Additional.GovPublicNodeId)}' isLink='true' onclick='fontWeightLink(this)' target='content'>主题分类</a>"); ClientScriptRegisterClientScriptBlock("NodeTreeScript", ChannelLoading.GetScript(PublishmentSystemInfo, ELoadingType.GovPublicChannelTree, null)); var additional = new NameValueCollection { { "PublishmentSystemID", PublishmentSystemId.ToString() }, { "DepartmentIDCollection", TranslateUtils.ObjectCollectionToString( GovPublicManager.GetFirstDepartmentIdList(PublishmentSystemInfo)) } }; ClientScriptRegisterClientScriptBlock("DepartmentTreeScript", DepartmentTreeItem.GetScript(EDepartmentLoadingType.ContentTree, additional)); var categoryClassInfoArrayList = DataProvider.GovPublicCategoryClassDao.GetCategoryClassInfoArrayList(PublishmentSystemId, ETriState.False, ETriState.True); foreach (GovPublicCategoryClassInfo categoryClassInfo in categoryClassInfoArrayList) { ClientScriptRegisterClientScriptBlock("CategoryTreeScript_" + categoryClassInfo.ClassCode, GovPublicCategoryTreeItem.GetScript(categoryClassInfo.ClassCode, PublishmentSystemId, EGovPublicCategoryLoadingType.Tree, null)); } BindGrid(categoryClassInfoArrayList); }
public string GetItemHtml(EDepartmentLoadingType loadingType, NameValueCollection additional, bool isOpen) { var htmlBuilder = new StringBuilder(); var parentsCount = _departmentInfo.ParentsCount; if (loadingType == EDepartmentLoadingType.AdministratorTree || loadingType == EDepartmentLoadingType.DepartmentSelect || loadingType == EDepartmentLoadingType.ContentTree) { parentsCount = parentsCount + 1; } for (var i = 0; i < parentsCount; i++) { htmlBuilder.Append($@"<img align=""absmiddle"" src=""{_iconEmptyUrl}"" />"); } if (_departmentInfo.ChildrenCount > 0) { if (isOpen) { htmlBuilder.Append( $@"<img align=""absmiddle"" style=""cursor:pointer"" onClick=""displayChildren(this);"" isAjax=""false"" isOpen=""true"" id=""{_departmentInfo .Id}"" src=""{_iconMinusUrl}"" />"); } else { htmlBuilder.Append( $@"<img align=""absmiddle"" style=""cursor:pointer"" onClick=""displayChildren(this);"" isAjax=""true"" isOpen=""false"" id=""{_departmentInfo .Id}"" src=""{_iconPlusUrl}"" />"); } } else { htmlBuilder.Append($@"<img align=""absmiddle"" src=""{_iconEmptyUrl}"" />"); } if (!string.IsNullOrEmpty(_iconFolderUrl)) { htmlBuilder.Append($@"<img align=""absmiddle"" src=""{_iconFolderUrl}"" />"); } htmlBuilder.Append(" "); if (loadingType == EDepartmentLoadingType.AdministratorTree) { var linkUrl = PageAdministrator.GetRedirectUrl(); htmlBuilder.Append( $"<a href='{linkUrl}' isLink='true' onclick='fontWeightLink(this)' target='department'>{_departmentInfo.DepartmentName}</a>"); } else if (loadingType == EDepartmentLoadingType.DepartmentSelect) { var linkUrl = PageUtils.AddQueryString(additional["UrlFormatString"], new NameValueCollection { { "DepartmentId", _departmentInfo.Id.ToString() } }); htmlBuilder.Append($"<a href='{linkUrl}'>{_departmentInfo.DepartmentName}</a>"); } else if (loadingType == EDepartmentLoadingType.ContentTree) { var linkUrl = PageContent.GetRedirectUrl(TranslateUtils.ToInt(additional["SiteId"]), _departmentInfo.Id); htmlBuilder.Append( $"<a href='{linkUrl}' isLink='true' onclick='fontWeightLink(this)' target='content'>{_departmentInfo.DepartmentName}</a>"); } else { htmlBuilder.Append(_departmentInfo.DepartmentName); } if (loadingType == EDepartmentLoadingType.AdministratorTree) { if (_departmentInfo.CountOfAdmin >= 0) { htmlBuilder.Append(" "); htmlBuilder.Append( $@"<span style=""font-size:8pt;font-family:arial"" class=""gray"">({_departmentInfo.CountOfAdmin})</span>"); } } htmlBuilder.Replace("displayChildren", "displayChildren_Department"); return(htmlBuilder.ToString()); }
public string GetItemHtml(ELoadingType loadingType, string returnUrl, NameValueCollection additional) { var htmlBuilder = new StringBuilder(); var parentsCount = _channelInfo.ParentsCount; for (var i = 0; i < parentsCount; i++) { htmlBuilder.Append($@"<img align=""absmiddle"" src=""{_iconEmptyUrl}"" />"); } if (_channelInfo.ChildrenCount > 0) { htmlBuilder.Append( _channelInfo.SiteId == _channelInfo.Id ? $@"<img align=""absmiddle"" style=""cursor:pointer; margin-top: -5px; margin-right: 2px;"" onClick=""event.stopPropagation();displayChildren(this);"" isAjax=""false"" isOpen=""true"" id=""{_channelInfo .Id}"" src=""{_iconMinusUrl}"" />" : $@"<img align=""absmiddle"" style=""cursor:pointer; margin-top: -5px; margin-right: 2px;"" onClick=""event.stopPropagation();displayChildren(this);"" isAjax=""true"" isOpen=""false"" id=""{_channelInfo .Id}"" src=""{_iconPlusUrl}"" />"); } else { htmlBuilder.Append($@"<img align=""absmiddle"" src=""{_iconEmptyUrl}"" />"); } var contentModelIconHtml = $@"<i class=""{_contentModelIconClass}""></i>"; if (_channelInfo.Id > 0) { contentModelIconHtml = $@"<a href=""{PageRedirect.GetRedirectUrlToChannel(_channelInfo.SiteId, _channelInfo.Id)}"" target=""_blank"" title=""浏览页面"" onclick=""event.stopPropagation()"">{contentModelIconHtml}</a>"; } htmlBuilder.Append(contentModelIconHtml); htmlBuilder.Append(" "); if (_enabled) { if (loadingType == ELoadingType.ContentTree) { var linkUrl = PageContent.GetRedirectUrl(_channelInfo.SiteId, _channelInfo.Id); if (!string.IsNullOrEmpty(additional?["linkUrl"])) { linkUrl = PageUtils.AddQueryStringIfNotExists(additional["linkUrl"], new NameValueCollection { ["channelId"] = _channelInfo.Id.ToString() }); } linkUrl = PageUtils.GetLoadingUrl(linkUrl); htmlBuilder.Append( $"<a href='{linkUrl}' isLink='true' onclick='fontWeightLink(this)' target='content'>{_channelInfo.ChannelName}</a>"); } else if (loadingType == ELoadingType.ChannelSelect) { var linkUrl = ModalChannelSelect.GetRedirectUrl(_channelInfo.SiteId, _channelInfo.Id); if (additional != null) { if (!string.IsNullOrEmpty(additional["linkUrl"])) { linkUrl = additional["linkUrl"] + _channelInfo.Id; } else { foreach (string key in additional.Keys) { linkUrl += $"&{key}={additional[key]}"; } } } htmlBuilder.Append($"<a href='{linkUrl}'>{_channelInfo.ChannelName}</a>"); } else { if (_permissionManager.HasChannelPermissions(_channelInfo.SiteId, _channelInfo.Id, ConfigManager.ChannelPermissions.ChannelEdit)) { var onClickUrl = ModalChannelEdit.GetOpenWindowString(_channelInfo.SiteId, _channelInfo.Id, returnUrl); htmlBuilder.Append( $@"<a href=""javascript:;;"" onClick=""{onClickUrl}"" title=""快速编辑栏目"">{_channelInfo.ChannelName}</a>"); } else { htmlBuilder.Append($@"<a href=""javascript:;"">{_channelInfo.ChannelName}</a>"); } } } else { htmlBuilder.Append($"<span>{_channelInfo.ChannelName}</span>"); } if (_channelInfo.SiteId != 0) { htmlBuilder.Append(" "); htmlBuilder.Append(ChannelManager.GetNodeTreeLastImageHtml(_siteInfo, _channelInfo)); if (_channelInfo.ContentNum < 0) { return(htmlBuilder.ToString()); } htmlBuilder.Append( $@"<span style=""font-size:8pt;font-family:arial"" class=""gray"">({_channelInfo.ContentNum})</span>"); } return(htmlBuilder.ToString()); }
public string GetItemHtml(ELoadingType loadingType, string returnUrl, NameValueCollection additional) { var htmlBuilder = new StringBuilder(); var parentsCount = _nodeInfo.ParentsCount; if (loadingType == ELoadingType.GovPublicChannelAdd || loadingType == ELoadingType.GovPublicChannelTree) { parentsCount = parentsCount - 1; } else if (loadingType == ELoadingType.GovPublicChannel || loadingType == ELoadingType.GovInteractChannel) { parentsCount = parentsCount - 2; } for (var i = 0; i < parentsCount; i++) { htmlBuilder.Append($@"<img align=""absmiddle"" src=""{_iconEmptyUrl}"" />"); } if (_nodeInfo.ChildrenCount > 0) { if (_nodeInfo.PublishmentSystemId == _nodeInfo.NodeId) { htmlBuilder.Append( $@"<img align=""absmiddle"" style=""cursor:pointer"" onClick=""displayChildren(this);"" isAjax=""false"" isOpen=""true"" id=""{_nodeInfo.NodeId}"" src=""{_iconMinusUrl}"" />"); } else { htmlBuilder.Append( $@"<img align=""absmiddle"" style=""cursor:pointer"" onClick=""displayChildren(this);"" isAjax=""true"" isOpen=""false"" id=""{_nodeInfo.NodeId}"" src=""{_iconPlusUrl}"" />"); } } else { htmlBuilder.Append($@"<img align=""absmiddle"" src=""{_iconEmptyUrl}"" />"); } if (!string.IsNullOrEmpty(_iconFolderUrl)) { if (_nodeInfo.NodeId > 0) { htmlBuilder.Append( $@"<a href=""{PageActions.GetRedirectUrl(_nodeInfo.PublishmentSystemId, _nodeInfo.NodeId)}"" target=""_blank"" title=""浏览页面""><img align=""absmiddle"" border=""0"" src=""{_iconFolderUrl}"" /></a>"); } else { htmlBuilder.Append($@"<img align=""absmiddle"" src=""{_iconFolderUrl}"" />"); } } htmlBuilder.Append(" "); if (_enabled) { if (loadingType == ELoadingType.ContentTree) { var linkUrl = PageContent.GetRedirectUrl(_nodeInfo.PublishmentSystemId, _nodeInfo.NodeId); htmlBuilder.Append( $"<a href='{linkUrl}' isLink='true' onclick='fontWeightLink(this)' target='content'>{_nodeInfo.NodeName}</a>"); } else if (loadingType == ELoadingType.ChannelSelect) { var linkUrl = ModalChannelSelect.GetRedirectUrl(_nodeInfo.PublishmentSystemId, _nodeInfo.NodeId); if (additional != null) { if (!string.IsNullOrEmpty(additional["linkUrl"])) { linkUrl = additional["linkUrl"] + _nodeInfo.NodeId; } else { foreach (string key in additional.Keys) { linkUrl += $"&{key}={additional[key]}"; } } } htmlBuilder.Append($"<a href='{linkUrl}'>{_nodeInfo.NodeName}</a>"); } else if (loadingType == ELoadingType.GovPublicChannelAdd) { if (EContentModelTypeUtils.Equals(_nodeInfo.ContentModelId, EContentModelType.GovPublic)) { htmlBuilder.Append($@"<a href=""{ModalGovPublicCategoryChannelSelect.GetRedirectUrl(_nodeInfo.PublishmentSystemId, _nodeInfo.NodeId)}"">{_nodeInfo.NodeName}</a>"); } else { htmlBuilder.Append(_nodeInfo.NodeName); } } else if (loadingType == ELoadingType.GovPublicChannelTree) { var linkUrl = PageContent.GetRedirectUrl(_nodeInfo.PublishmentSystemId, _nodeInfo.NodeId); htmlBuilder.Append( $"<a href='{linkUrl}' isLink='true' onclick='fontWeightLink(this)' target='content'>{_nodeInfo.NodeName}</a>"); } else { if (AdminUtility.HasChannelPermissions(_administratorName, _nodeInfo.PublishmentSystemId, _nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ChannelEdit)) { var onClickUrl = ModalChannelEdit.GetOpenWindowString(_nodeInfo.PublishmentSystemId, _nodeInfo.NodeId, returnUrl); htmlBuilder.Append( $@"<a href=""javascript:;;"" onClick=""{onClickUrl}"" title=""快速编辑栏目"">{_nodeInfo.NodeName}</a>"); } else { htmlBuilder.Append($@"<a href=""javascript:;;"">{_nodeInfo.NodeName}</a>"); } } } else { htmlBuilder.Append(_nodeInfo.NodeName); } if (_nodeInfo.PublishmentSystemId != 0) { var publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(_nodeInfo.PublishmentSystemId); htmlBuilder.Append(" "); htmlBuilder.Append(NodeManager.GetNodeTreeLastImageHtml(publishmentSystemInfo, _nodeInfo)); if (_nodeInfo.ContentNum >= 0) { htmlBuilder.Append(" "); htmlBuilder.Append( $@"<span style=""font-size:8pt;font-family:arial"" class=""gray"">({_nodeInfo.ContentNum})</span>"); } } return(htmlBuilder.ToString()); }
public string GetItemHtml(ELoadingType loadingType, string returnUrl, NameValueCollection additional) { var htmlBuilder = new StringBuilder(); var parentsCount = _channelInfo.ParentsCount; for (var i = 0; i < parentsCount; i++) { htmlBuilder.Append($@"<img align=""absmiddle"" src=""{_iconEmptyUrl}"" />"); } if (_channelInfo.ChildrenCount > 0) { htmlBuilder.Append( _channelInfo.SiteId == _channelInfo.Id ? $@"<img align=""absmiddle"" style=""cursor:pointer"" onClick=""displayChildren(this);"" isAjax=""false"" isOpen=""true"" id=""{_channelInfo .Id}"" src=""{_iconMinusUrl}"" />" : $@"<img align=""absmiddle"" style=""cursor:pointer"" onClick=""displayChildren(this);"" isAjax=""true"" isOpen=""false"" id=""{_channelInfo .Id}"" src=""{_iconPlusUrl}"" />"); } else { htmlBuilder.Append($@"<img align=""absmiddle"" src=""{_iconEmptyUrl}"" />"); } if (!string.IsNullOrEmpty(_iconFolderUrl)) { htmlBuilder.Append( _channelInfo.Id > 0 ? $@"<a href=""{PageRedirect.GetRedirectUrlToChannel(_channelInfo.SiteId, _channelInfo.Id)}"" target=""_blank"" title=""浏览页面""><img align=""absmiddle"" border=""0"" src=""{_iconFolderUrl}"" style=""max-height: 22px; max-width: 22px"" /></a>" : $@"<img align=""absmiddle"" src=""{_iconFolderUrl}"" style=""max-height: 22px; max-width: 22px"" />"); } htmlBuilder.Append(" "); if (_enabled) { if (loadingType == ELoadingType.ContentTree) { var linkUrl = PageContent.GetRedirectUrl(_channelInfo.SiteId, _channelInfo.Id); htmlBuilder.Append( $"<a href='{linkUrl}' isLink='true' onclick='fontWeightLink(this)' target='content'>{_channelInfo.ChannelName}</a>"); } else if (loadingType == ELoadingType.ChannelSelect) { var linkUrl = ModalChannelSelect.GetRedirectUrl(_channelInfo.SiteId, _channelInfo.Id); if (additional != null) { if (!string.IsNullOrEmpty(additional["linkUrl"])) { linkUrl = additional["linkUrl"] + _channelInfo.Id; } else { foreach (string key in additional.Keys) { linkUrl += $"&{key}={additional[key]}"; } } } htmlBuilder.Append($"<a href='{linkUrl}'>{_channelInfo.ChannelName}</a>"); } else { if (AdminUtility.HasChannelPermissions(_administratorName, _channelInfo.SiteId, _channelInfo.Id, ConfigManager.Permissions.Channel.ChannelEdit)) { var onClickUrl = ModalChannelEdit.GetOpenWindowString(_channelInfo.SiteId, _channelInfo.Id, returnUrl); htmlBuilder.Append( $@"<a href=""javascript:;;"" onClick=""{onClickUrl}"" title=""快速编辑栏目"">{_channelInfo.ChannelName}</a>"); } else { htmlBuilder.Append($@"<a href=""javascript:;;"">{_channelInfo.ChannelName}</a>"); } } } else { htmlBuilder.Append(_channelInfo.ChannelName); } if (_channelInfo.SiteId != 0) { htmlBuilder.Append(" "); htmlBuilder.Append(ChannelManager.GetNodeTreeLastImageHtml(_siteInfo, _channelInfo)); if (_channelInfo.ContentNum < 0) { return(htmlBuilder.ToString()); } htmlBuilder.Append( $@"<span style=""font-size:8pt;font-family:arial"" class=""gray"">({_channelInfo.ContentNum})</span>"); } return(htmlBuilder.ToString()); }
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; } }