public void Page_Load(object sender, EventArgs e) { var type = Request["type"]; if (type == "DynamicPage") { var redirectUrl = PagePreview.GetRedirectUrl(PublishmentSystemId, 0, 0, 0, 0); PageUtils.Redirect(redirectUrl); } }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("PublishmentSystemID", "NodeID", "ReturnUrl"); var nodeId = Body.GetQueryInt("NodeID"); _nodeInfo = NodeManager.GetNodeInfo(1, nodeId); var contentId = Body.GetQueryInt("ID"); string contentType = WebUtils.GetContentType(_nodeInfo.ContentModelId); ReturnUrl = $@"/siteserver/cms/{contentType}.aspx?PublishmentSystemID=1&NodeId={nodeId}"; ReturnPUrl = $@"/siteserver/cms/{contentType}.aspx?PublishmentSystemID=1&NodeId={ (Body.GetQueryInt("PNodeID")==0? nodeId:Body.GetQueryInt("PNodeID"))}"; //ReturnUrl = StringUtils.ValueFromUrl(Body.GetQueryString("ReturnUrl")); _isAjaxSubmit = Body.GetQueryBool("isAjaxSubmit"); _isPreview = Body.GetQueryBool("isPreview"); _tableStyle = NodeManager.GetTableStyle(PublishmentSystemInfo, _nodeInfo); _tableName = NodeManager.GetTableName(PublishmentSystemInfo, _nodeInfo); //_tableName = "model_content"; _relatedIdentities = RelatedIdentities.GetChannelRelatedIdentities(PublishmentSystemId, nodeId); ContentInfo contentInfo = null; if (_isAjaxSubmit == false) { if (contentId == 0) { if (_nodeInfo != null && _nodeInfo.Additional.IsContentAddable == false) { PageUtils.RedirectToErrorPage("此栏目不能添加内容!"); return; } if (!HasChannelPermissions(nodeId, AppManager.Cms.Permission.Channel.ContentAdd)) { if (!Body.IsAdministratorLoggin) { PageUtils.RedirectToLoginPage(); return; } else { PageUtils.RedirectToErrorPage("您无此栏目的添加内容权限!"); return; } } } else { contentInfo = DataProvider.ContentDao.GetContentInfo(_tableStyle, _tableName, contentId); if (!HasChannelPermissions(nodeId, AppManager.Cms.Permission.Channel.ContentEdit)) { if (!Body.IsAdministratorLoggin) { PageUtils.RedirectToLoginPage(); return; } PageUtils.RedirectToErrorPage("您无此栏目的修改内容权限!"); return; } } if (!IsPostBack) { var nodeNames = NodeManager.GetNodeNameNavigation(PublishmentSystemId, _nodeInfo.NodeId); var pageTitle = (contentId == 0) ? $"添加{ContentModelManager.GetContentModelInfo(PublishmentSystemInfo, _nodeInfo.ContentModelId).ModelName}" : $"编辑{ContentModelManager.GetContentModelInfo(PublishmentSystemInfo, _nodeInfo.ContentModelId).ModelName}"; BreadCrumbWithItemTitle(AppManager.Cms.LeftMenu.IdContent, pageTitle, nodeNames, string.Empty); LtlPageTitle.Text = pageTitle; LtlPageTitle.Text += $@" <script language=""javascript"" type=""text/javascript""> var previewUrl = '{PagePreview.GetRedirectUrl(PublishmentSystemId, _nodeInfo.NodeId, contentId, 0, 0)}'; </script> "; if (PublishmentSystemInfo.Additional.IsAutoSaveContent && PublishmentSystemInfo.Additional.AutoSaveContentInterval > 0) { LtlPageTitle.Text += $@" <input type=""hidden"" id=""savedContentID"" name=""savedContentID"" value=""{contentId}""> <script language=""javascript"" type=""text/javascript"">setInterval(""autoSave()"",{PublishmentSystemInfo.Additional.AutoSaveContentInterval*1000});</script> "; } //专题 if (contentId == 0) { var specialParentId = DataProvider.NodeDao.GetSpecialParentId(); NodeIdDic = new Dictionary <NodeInfo, List <NodeInfo> >(); if (nodeId != 0 && nodeId == specialParentId) { PhSpecial.Visible = true; PhCategory.Visible = true; var specialNodeIdList = DataProvider.NodeDao.GetNodeInfoListByParentId(1, specialParentId); List <NodeInfo> secondLevel = new List <NodeInfo>(); foreach (var nodeInfo in specialNodeIdList) { var secondChild = DataProvider.NodeDao.GetNodeInfoListByParentId(1, nodeInfo.NodeId); if (secondChild != null && secondChild.Count > 0) { NodeIdDic.Add(nodeInfo, secondChild); } } if (NodeIdDic != null && NodeIdDic.Count > 0) { KeyValuePair <NodeInfo, List <NodeInfo> > kv = NodeIdDic.First(); var defaultItem = new ListItem(kv.Key.NodeName, kv.Key.NodeId.ToString()); defaultItem.Selected = true; TbSpecial.Items.Add(defaultItem); foreach (var info in kv.Value) { TbCategory.Items.Add(new ListItem(info.NodeName, info.NodeId.ToString())); } foreach (var info in specialNodeIdList) { if (info.NodeId != kv.Key.NodeId) { TbSpecial.Items.Add(new ListItem(info.NodeName, info.NodeId.ToString())); } } } } else { //信息类型 var childSpecial = DataProvider.NodeDao.GetNodeInfoListByParentId(1, nodeId); if (childSpecial != null && childSpecial.Count > 0) { PhCategory.Visible = true; foreach (var nodeInfo in childSpecial) { var item = new ListItem(nodeInfo.NodeName, nodeInfo.NodeId.ToString()); TbCategory.Items.Add(item); } } } } else { PhSpecial.Visible = false; PhCategory.Visible = true; TbCategory.Items.Add(new ListItem(_nodeInfo.NodeName, _nodeInfo.NodeId.ToString())); //if (_nodeInfo.ParentsCount == 1) //{ // PhSpecial.Visible = false; // PhCategory.Visible = true; // TbSpecial.Items.Add(new ListItem(_nodeInfo.NodeName, _nodeInfo.NodeId.ToString())); //}else if(_nodeInfo.ParentsCount == 1) } //转移 if (AdminUtility.HasChannelPermissions(Body.AdministratorName, PublishmentSystemId, _nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentTranslate)) { PhTranslate.Visible = PublishmentSystemInfo.Additional.IsTranslate; DivTranslateAdd.Attributes.Add("onclick", ModalChannelMultipleSelect.GetOpenWindowString(PublishmentSystemId, true)); ETranslateContentTypeUtils.AddListItems(DdlTranslateType, true); ControlUtils.SelectListItems(DdlTranslateType, ETranslateContentTypeUtils.GetValue(ETranslateContentType.Copy)); } else { PhTranslate.Visible = false; } //内容属性 var excludeAttributeNames = TableManager.GetExcludeAttributeNames(_tableStyle); AcAttributes.AddExcludeAttributeNames(excludeAttributeNames); if (excludeAttributeNames.Count == 0) { PhContentAttributes.Visible = false; } else { PhContentAttributes.Visible = true; foreach (var attributeName in excludeAttributeNames) { var styleInfo = TableStyleManager.GetTableStyleInfo(_tableStyle, _tableName, attributeName, _relatedIdentities); if (styleInfo.IsVisible) { var listItem = new ListItem(styleInfo.DisplayName, styleInfo.AttributeName); if (contentId > 0) { listItem.Selected = TranslateUtils.ToBool(contentInfo?.GetExtendedAttribute(styleInfo.AttributeName)); } else { if (TranslateUtils.ToBool(styleInfo.DefaultValue)) { listItem.Selected = true; } } CblContentAttributes.Items.Add(listItem); } } } //内容组 var contentGroupNameList = DataProvider.ContentGroupDao.GetContentGroupNameList(PublishmentSystemId); if (!PublishmentSystemInfo.Additional.IsGroupContent || contentGroupNameList.Count == 0) { PhContentGroup.Visible = false; } else { foreach (var groupName in contentGroupNameList) { var item = new ListItem(groupName, groupName); if (contentId > 0) { item.Selected = StringUtils.In(contentInfo?.ContentGroupNameCollection, groupName); } CblContentGroupNameCollection.Items.Add(item); } } //标签 if (!PublishmentSystemInfo.Additional.IsRelatedByTags) { PhTags.Visible = false; } else { var tagScript = @" <script type=""text/javascript""> function getTags(tag){ $.get('[url]&tag=' + encodeURIComponent(tag) + '&r=' + Math.random(), function(data) { if(data !=''){ var arr = data.split('|'); var temp=''; for(i=0;i<arr.length;i++) { temp += '<li><a>'+arr[i].replace(tag,'<b>' + tag + '</b>') + '</a></li>'; } var myli='<ul>'+temp+'</ul>'; $('#tagTips').html(myli); $('#tagTips').show(); }else{ $('#tagTips').hide(); } $('#tagTips li').click(function () { var tag = $('#TbTags').val(); var i = tag.lastIndexOf(' '); if (i > 0) { tag = tag.substring(0, i) + ' ' + $(this).text(); }else{ tag = $(this).text(); } $('#TbTags').val(tag); $('#tagTips').hide(); }) }); } $(document).ready(function () { $('#TbTags').keyup(function (e) { if (e.keyCode != 40 && e.keyCode != 38) { var tag = $('#TbTags').val(); var i = tag.lastIndexOf(' '); if (i > 0){ tag = tag.substring(i + 1);} if (tag != '' && tag != ' '){ window.setTimeout(""getTags('"" + tag + ""');"", 200); }else{ $('#tagTips').hide(); } } }).blur(function () { window.setTimeout(""$('#tagTips').hide();"", 200); })}); </script> <div id=""tagTips"" class=""inputTips""></div> "; LtlTags.Text = tagScript.Replace("[url]", AjaxCmsService.GetTagsUrl(PublishmentSystemId)); } if (contentId == 0) { var formCollection = new NameValueCollection(); if (Body.IsQueryExists("isUploadWord")) { var isFirstLineTitle = Body.GetQueryBool("isFirstLineTitle"); var isFirstLineRemove = Body.GetQueryBool("isFirstLineRemove"); var isClearFormat = Body.GetQueryBool("isClearFormat"); var isFirstLineIndent = Body.GetQueryBool("isFirstLineIndent"); var isClearFontSize = Body.GetQueryBool("isClearFontSize"); var isClearFontFamily = Body.GetQueryBool("isClearFontFamily"); var isClearImages = Body.GetQueryBool("isClearImages"); var contentLevel = Body.GetQueryInt("contentLevel"); var fileName = Body.GetQueryString("fileName"); formCollection = WordUtils.GetWordNameValueCollection(PublishmentSystemId, _nodeInfo.ContentModelId, isFirstLineTitle, isFirstLineRemove, isClearFormat, isFirstLineIndent, isClearFontSize, isClearFontFamily, isClearImages, contentLevel, fileName); } AcAttributes.SetParameters(formCollection, PublishmentSystemInfo, _nodeInfo.NodeId, _relatedIdentities, _tableStyle, _tableName, false, IsPostBack); } else { AcAttributes.SetParameters(contentInfo?.Attributes, PublishmentSystemInfo, _nodeInfo.NodeId, _relatedIdentities, _tableStyle, _tableName, true, IsPostBack); TbTags.Text = contentInfo?.Tags; } if (HasChannelPermissions(nodeId, AppManager.Cms.Permission.Channel.ContentCheck)) { PhStatus.Visible = true; int checkedLevel; var isChecked = CheckManager.GetUserCheckLevel(Body.AdministratorName, PublishmentSystemInfo, _nodeInfo.NodeId, out checkedLevel); if (Body.IsQueryExists("contentLevel")) { checkedLevel = TranslateUtils.ToIntWithNagetive(Body.GetQueryString("contentLevel")); if (checkedLevel != LevelManager.LevelInt.NotChange) { isChecked = checkedLevel >= PublishmentSystemInfo.CheckContentLevel; } } LevelManager.LoadContentLevelToEdit(RblContentLevel, PublishmentSystemInfo, nodeId, contentInfo, isChecked, checkedLevel); } else { PhStatus.Visible = false; } BtnSubmit.Attributes.Add("onclick", InputParserUtils.GetValidateSubmitOnClickScript("myForm", true, "autoCheckKeywords()")); //自动检测敏感词 ClientScriptRegisterStartupScript("autoCheckKeywords", WebUtils.GetAutoCheckKeywordsScript(PublishmentSystemInfo)); } else { AcAttributes.SetParameters(Request.Form, PublishmentSystemInfo, _nodeInfo.NodeId, _relatedIdentities, _tableStyle, _tableName, contentId != 0, IsPostBack); } DataBind(); } else { var success = false; string errorMessage; var savedContentId = SaveContentInfo(true, _isPreview, out errorMessage); if (savedContentId > 0) { success = true; } string jsonString = $@"{{success:'{success.ToString().ToLower()}',savedContentID:'{savedContentId}'}}"; PageUtils.ResponseToJson(jsonString); } }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("PublishmentSystemID", "NodeID", "ID", "ReturnUrl"); _nodeId = Body.GetQueryInt("NodeID"); var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, _nodeId); _tableStyle = NodeManager.GetTableStyle(PublishmentSystemInfo, nodeInfo); _tableName = NodeManager.GetTableName(PublishmentSystemInfo, nodeInfo); _contentId = Body.GetQueryInt("ID"); _returnUrl = StringUtils.ValueFromUrl(Body.GetQueryString("ReturnUrl")); _relatedIdentities = RelatedIdentities.GetChannelRelatedIdentities(PublishmentSystemId, _nodeId); _contentInfo = DataProvider.ContentDao.GetContentInfo(_tableStyle, _tableName, _contentId); if (!IsPostBack) { BreadCrumb(AppManager.Cms.LeftMenu.IdContent, "查看内容", string.Empty); var styleInfoList = TableStyleManager.GetTableStyleInfoList(_tableStyle, _tableName, _relatedIdentities); var myStyleInfoArrayList = new ArrayList(); if (styleInfoList != null) { foreach (var styleInfo in styleInfoList) { if (styleInfo.IsVisible) { myStyleInfoArrayList.Add(styleInfo); } } } MyRepeater.DataSource = myStyleInfoArrayList; MyRepeater.ItemDataBound += MyRepeater_ItemDataBound; MyRepeater.DataBind(); ltlNodeName.Text = NodeManager.GetNodeName(PublishmentSystemId, _nodeId); ltlNodeName.Text += $@" <script> function submitPreview(){{ window.open(""{PagePreview.GetRedirectUrl(PublishmentSystemId, _nodeId, _contentId, 0, 0)}""); }} </script> "; if (PublishmentSystemInfo.Additional.IsRelatedByTags) { ltlTags.Text = _contentInfo.Tags; } if (string.IsNullOrEmpty(ltlTags.Text)) { RowTags.Visible = false; } ltlContentGroup.Text = _contentInfo.ContentGroupNameCollection; if (string.IsNullOrEmpty(ltlContentGroup.Text)) { RowContentGroup.Visible = false; } ltlLastEditDate.Text = DateUtils.GetDateAndTimeString(_contentInfo.LastEditDate); ltlAddUserName.Text = AdminManager.GetDisplayName(_contentInfo.AddUserName, true); ltlLastEditUserName.Text = AdminManager.GetDisplayName(_contentInfo.LastEditUserName, true); ltlContentLevel.Text = LevelManager.GetCheckState(PublishmentSystemInfo, _contentInfo.IsChecked, _contentInfo.CheckedLevel); if (_contentInfo.ReferenceId > 0 && _contentInfo.GetExtendedAttribute(ContentAttribute.TranslateContentType) != ETranslateContentType.ReferenceContent.ToString()) { var referencePublishmentSystemID = DataProvider.NodeDao.GetPublishmentSystemId(_contentInfo.SourceId); var referencePublishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(referencePublishmentSystemID); var referenceTableStyle = NodeManager.GetTableStyle(referencePublishmentSystemInfo, _contentInfo.SourceId); var referenceTableName = NodeManager.GetTableName(referencePublishmentSystemInfo, _contentInfo.SourceId); var referenceContentInfo = DataProvider.ContentDao.GetContentInfo(referenceTableStyle, referenceTableName, _contentInfo.ReferenceId); if (referenceContentInfo != null) { var pageUrl = PageUtility.GetContentUrl(referencePublishmentSystemInfo, referenceContentInfo); var referenceNodeInfo = NodeManager.GetNodeInfo(referenceContentInfo.PublishmentSystemId, referenceContentInfo.NodeId); var addEditUrl = WebUtils.GetContentAddEditUrl(referencePublishmentSystemInfo.PublishmentSystemId, referenceNodeInfo, _contentInfo.ReferenceId, Body.GetQueryString("ReturnUrl")); ltlScripts.Text += $@" <div class=""tips"">此内容为对内容 (站点:{referencePublishmentSystemInfo.PublishmentSystemName},栏目:{referenceNodeInfo.NodeName})“<a href=""{pageUrl}"" target=""_blank"">{_contentInfo.Title}</a>”(<a href=""{addEditUrl}"">编辑</a>) 的引用,内容链接将和原始内容链接一致</div>"; } } Submit.Attributes.Add("onclick", ModalContentCheck.GetOpenWindowString(PublishmentSystemInfo.PublishmentSystemId, _nodeId, _contentId, _returnUrl)); } }
public void Page_Load(object sender, EventArgs e) { PageUtils.CheckRequestParameter("PublishmentSystemID"); var nodeId = TranslateUtils.ToInt(Request.QueryString["NodeID"]); if (nodeId == 0) { nodeId = PublishmentSystemInfo.Additional.GovPublicNodeId; } _contentId = TranslateUtils.ToInt(Request.QueryString["ID"]); ReturnUrl = StringUtils.ValueFromUrl(Request.QueryString["ReturnUrl"]); _nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, nodeId); _tableStyle = NodeManager.GetTableStyle(PublishmentSystemInfo, _nodeInfo); _tableName = NodeManager.GetTableName(PublishmentSystemInfo, _nodeInfo); _relatedIdentities = RelatedIdentities.GetChannelRelatedIdentities(PublishmentSystemId, nodeId); GovPublicContentInfo contentInfo = null; if (_contentId == 0) { if (_nodeInfo != null && _nodeInfo.Additional.IsContentAddable == false) { PageUtils.RedirectToErrorPage("此栏目不能添加内容!"); return; } if (!HasChannelPermissions(nodeId, AppManager.Cms.Permission.Channel.ContentAdd)) { if (!Body.IsAdministratorLoggin) { PageUtils.RedirectToLoginPage(); return; } PageUtils.RedirectToErrorPage("您无此栏目的添加内容权限!"); return; } } else { contentInfo = DataProvider.GovPublicContentDao.GetContentInfo(PublishmentSystemInfo, _contentId); if (!HasChannelPermissions(nodeId, AppManager.Cms.Permission.Channel.ContentEdit)) { if (!Body.IsAdministratorLoggin) { PageUtils.RedirectToLoginPage(); return; } PageUtils.RedirectToErrorPage("您无此栏目的修改内容权限!"); return; } } if (!IsPostBack) { var nodeNames = NodeManager.GetNodeNameNavigationByGovPublic(PublishmentSystemId, nodeId); var departmentId = 0; var departmentName = string.Empty; var pageTitle = _contentId == 0 ? "添加信息" : "修改信息"; BreadCrumbWithItemTitle(AppManager.Wcm.LeftMenu.IdGovPublic, AppManager.Wcm.LeftMenu.GovPublic.IdGovPublicContent, pageTitle, nodeNames, AppManager.Wcm.Permission.WebSite.GovPublicContent); ltlPageTitle.Text = pageTitle; ltlPageTitle.Text += $@" <script language=""javascript"" type=""text/javascript""> var previewUrl = '{PagePreview.GetRedirectUrl(PublishmentSystemId, _nodeInfo.NodeId, _contentId, 0, 0)}'; </script> "; EBooleanUtils.AddListItems(rblIsAbolition); ControlUtils.SelectListItemsIgnoreCase(rblIsAbolition, false.ToString()); //转移 if (_tableStyle == ETableStyle.BackgroundContent && AdminUtility.HasChannelPermissions(Body.AdministratorName, PublishmentSystemId, _nodeInfo.NodeId, AppManager.Cms.Permission.Channel.ContentTranslate)) { phTranslate.Visible = PublishmentSystemInfo.Additional.IsTranslate; divTranslateAdd.Attributes.Add("onclick", ModalChannelMultipleSelect.GetOpenWindowString(PublishmentSystemId, true)); ETranslateContentTypeUtils.AddListItems(ddlTranslateType, true); ControlUtils.SelectListItems(ddlTranslateType, ETranslateContentTypeUtils.GetValue(ETranslateContentType.Copy)); } else { phTranslate.Visible = false; } //内容属性 var excludeAttributeNames = TableManager.GetExcludeAttributeNames(_tableStyle); acAttributes.AddExcludeAttributeNames(excludeAttributeNames); if (excludeAttributeNames.Count == 0) { phContentAttributes.Visible = false; } else { phContentAttributes.Visible = true; foreach (var attributeName in GovPublicContentAttribute.CheckBoxAttributes) { var styleInfo = TableStyleManager.GetTableStyleInfo(_tableStyle, _tableName, attributeName, _relatedIdentities); if (styleInfo.IsVisible) { var listItem = new ListItem(styleInfo.DisplayName, styleInfo.AttributeName); if (_contentId > 0) { listItem.Selected = TranslateUtils.ToBool(contentInfo.GetExtendedAttribute(styleInfo.AttributeName)); } ContentAttributes.Items.Add(listItem); } } } //内容组 var contentGroupNameList = DataProvider.ContentGroupDao.GetContentGroupNameList(PublishmentSystemId); if (!PublishmentSystemInfo.Additional.IsGroupContent || contentGroupNameList.Count == 0) { phContentGroup.Visible = false; } else { foreach (var groupName in contentGroupNameList) { var item = new ListItem(groupName, groupName); if (_contentId > 0) { item.Selected = StringUtils.In(contentInfo.ContentGroupNameCollection, groupName); } ContentGroupNameCollection.Items.Add(item); } } if (!PublishmentSystemInfo.Additional.IsRelatedByTags || _tableStyle != ETableStyle.BackgroundContent) { phTags.Visible = false; } else { var tagScript = @" <script type=""text/javascript""> function getTags(tag){ $.get('[url]&tag=' + encodeURIComponent(tag) + '&r=' + Math.random(), function(data) { if(data !=''){ var arr = data.split('|'); var temp=''; for(i=0;i<arr.length;i++) { temp += '<li><a>'+arr[i].replace(tag,'<b>' + tag + '</b>') + '</a></li>'; } var myli='<ul>'+temp+'</ul>'; $('#tagTips').html(myli); $('#tagTips').show(); }else{ $('#tagTips').hide(); } $('#tagTips li').click(function () { var tag = $('#Tags').val(); var i = tag.lastIndexOf(' '); if (i > 0) { tag = tag.substring(0, i) + ' ' + $(this).text(); }else{ tag = $(this).text(); } $('#Tags').val(tag); $('#tagTips').hide(); }) }); } $(document).ready(function () { $('#Tags').keyup(function (e) { if (e.keyCode != 40 && e.keyCode != 38) { var tag = $('#Tags').val(); var i = tag.lastIndexOf(' '); if (i > 0){ tag = tag.substring(i + 1);} if (tag != '' && tag != ' '){ window.setTimeout(""getTags('"" + tag + ""');"", 200); }else{ $('#tagTips').hide(); } } }).blur(function () { window.setTimeout(""$('#tagTips').hide();"", 200); })}); </script> <div id=""tagTips"" class=""inputTips""></div> "; ltlTags.Text = tagScript.Replace("[url]", AjaxCmsService.GetTagsUrl(PublishmentSystemId)); } divAddChannel.Attributes.Add("onclick", ModalGovPublicCategoryChannelSelect.GetOpenWindowString(PublishmentSystemId)); divAddDepartment.Attributes.Add("onclick", ModalGovPublicCategoryDepartmentSelect.GetOpenWindowString(PublishmentSystemId)); var categoryBuilder = new StringBuilder(); var categoryClassInfoArrayList = DataProvider.GovPublicCategoryClassDao.GetCategoryClassInfoArrayList(PublishmentSystemId, ETriState.False, ETriState.True); if (categoryClassInfoArrayList.Count > 0) { var categoryIndex = 1; foreach (GovPublicCategoryClassInfo categoryClassInfo in categoryClassInfoArrayList) { categoryIndex++; if (categoryIndex % 2 == 0) { categoryBuilder.Append("<tr>"); } categoryBuilder.Append( $@"<td height=""30"">{categoryClassInfo.ClassName}分类:</td><td height=""30""> <div class=""fill_box"" id=""category{categoryClassInfo.ClassCode}Container"" style=""display:none""> <div class=""addr_base addr_normal""> <b id=""category{categoryClassInfo.ClassCode}Name""></b> <a class=""addr_del"" href=""javascript:;"" onClick=""showCategory{categoryClassInfo .ClassCode}('', '0')""></a> <input id=""category{categoryClassInfo.ClassCode}ID"" name=""category{categoryClassInfo.ClassCode}ID"" value=""0"" type=""hidden""> </div> </div> <div ID=""divAdd{categoryClassInfo.ClassCode}"" class=""btn_pencil"" onclick=""{ModalGovPublicCategorySelect .GetOpenWindowString(PublishmentSystemId, categoryClassInfo.ClassCode)}""><span class=""pencil""></span> 修改</div> <script language=""javascript""> function showCategory{categoryClassInfo.ClassCode}({categoryClassInfo.ClassCode}Name, {categoryClassInfo.ClassCode}ID){{ $('#category{categoryClassInfo.ClassCode}Name').html({categoryClassInfo.ClassCode}Name); $('#category{categoryClassInfo.ClassCode}ID').val({categoryClassInfo.ClassCode}ID); if ({categoryClassInfo.ClassCode}ID == '0'){{ $('#category{categoryClassInfo.ClassCode}Container').hide(); }}else{{ $('#category{categoryClassInfo.ClassCode}Container').show(); }} }} </script> </td>"); if (categoryIndex % 2 == 1) { categoryBuilder.Append("</tr>"); } } } if (_contentId == 0) { var formCollection = new NameValueCollection(); if (Body.IsQueryExists("isUploadWord")) { var isFirstLineTitle = TranslateUtils.ToBool(Request.QueryString["isFirstLineTitle"]); var isFirstLineRemove = TranslateUtils.ToBool(Request.QueryString["isFirstLineRemove"]); var isClearFormat = TranslateUtils.ToBool(Request.QueryString["isClearFormat"]); var isFirstLineIndent = TranslateUtils.ToBool(Request.QueryString["isFirstLineIndent"]); var isClearFontSize = TranslateUtils.ToBool(Request.QueryString["isClearFontSize"]); var isClearFontFamily = TranslateUtils.ToBool(Request.QueryString["isClearFontFamily"]); var isClearImages = TranslateUtils.ToBool(Request.QueryString["isClearImages"]); var contentLevel = TranslateUtils.ToInt(Request.QueryString["contentLevel"]); var fileName = Request.QueryString["fileName"]; formCollection = WordUtils.GetWordNameValueCollection(PublishmentSystemId, _nodeInfo.ContentModelId, isFirstLineTitle, isFirstLineRemove, isClearFormat, isFirstLineIndent, isClearFontSize, isClearFontFamily, isClearImages, contentLevel, fileName); } ascTitle.SetParameters(PublishmentSystemInfo, _nodeInfo.NodeId, _tableStyle, _tableName, ContentAttribute.Title, formCollection, false, IsPostBack); acAttributes.SetParameters(formCollection, PublishmentSystemInfo, _nodeInfo.NodeId, _relatedIdentities, _tableStyle, _tableName, false, IsPostBack); } //else //{ // this.Tags.Text = contentInfo.Tags; //} //if (contentID == 0) //{ // NameValueCollection formCollection = new NameValueCollection(); // this.ascContent.SetParameters(base.PublishmentSystemInfo, base.PublishmentSystemInfo.Additional.GovPublicNodeID, ETableStyle.GovPublicContent, base.PublishmentSystemInfo.AuxiliaryTableForGovPublic, GovPublicContentAttribute.Content, formCollection, false, base.IsPostBack); //} else { departmentId = contentInfo.DepartmentId; departmentName = DepartmentManager.GetDepartmentName(departmentId); foreach (GovPublicCategoryClassInfo categoryClassInfo in categoryClassInfoArrayList) { var categoryId = TranslateUtils.ToInt(contentInfo.GetExtendedAttribute(categoryClassInfo.ContentAttributeName)); if (categoryId > 0) { var categoryName = DataProvider.GovPublicCategoryDao.GetCategoryName(categoryId); categoryBuilder.Append( $@"<script>showCategory{categoryClassInfo.ClassCode}('{categoryName}', '{categoryId}');</script>"); } } tbIdentifier.Text = contentInfo.Identifier; tbPublisher.Text = contentInfo.Publisher; tbDocumentNo.Text = contentInfo.DocumentNo; dtbPublishDate.DateTime = contentInfo.PublishDate; tbKeywords.Text = contentInfo.Keywords; dtbEffectDate.DateTime = contentInfo.EffectDate; ControlUtils.SelectListItemsIgnoreCase(rblIsAbolition, contentInfo.IsAbolition.ToString()); dtbAbolitionDate.DateTime = contentInfo.AbolitionDate; tbDescription.Text = contentInfo.Description; ascTitle.SetParameters(PublishmentSystemInfo, _nodeInfo.NodeId, _tableStyle, _tableName, ContentAttribute.Title, contentInfo.Attributes, true, IsPostBack); acAttributes.SetParameters(contentInfo.Attributes, PublishmentSystemInfo, _nodeInfo.NodeId, _relatedIdentities, _tableStyle, _tableName, true, IsPostBack); Tags.Text = contentInfo.Tags; } if (departmentId == 0) { departmentId = BaiRongDataProvider.AdministratorDao.GetDepartmentId(Body.AdministratorName); if (departmentId > 0) { departmentName = DepartmentManager.GetDepartmentName(departmentId); } } categoryBuilder.Append( $@"<script>showCategoryChannel('{nodeNames}', '{nodeId}');showCategoryDepartment('{departmentName}', '{departmentId}');</script>"); ltlCategoryScript.Text = categoryBuilder.ToString(); if (HasChannelPermissions(nodeId, AppManager.Cms.Permission.Channel.ContentCheck)) { phStatus.Visible = true; int checkedLevel; var isChecked = CheckManager.GetUserCheckLevel(Body.AdministratorName, PublishmentSystemInfo, PublishmentSystemId, out checkedLevel); LevelManager.LoadContentLevelToEdit(ContentLevel, PublishmentSystemInfo, nodeId, contentInfo, isChecked, checkedLevel); } else { phStatus.Visible = false; } Submit.Attributes.Add("onclick", InputParserUtils.GetValidateSubmitOnClickScript("myForm")); if (PublishmentSystemInfo.Additional.GovPublicIsPublisherRelatedDepartmentId && string.IsNullOrEmpty(tbPublisher.Text)) { tbPublisher.Text = departmentName; } } else { if (_contentId == 0) { ascTitle.SetParameters(PublishmentSystemInfo, _nodeInfo.NodeId, _tableStyle, _tableName, ContentAttribute.Title, Request.Form, false, IsPostBack); acAttributes.SetParameters(Request.Form, PublishmentSystemInfo, _nodeInfo.NodeId, _relatedIdentities, _tableStyle, _tableName, false, IsPostBack); } else { ascTitle.SetParameters(PublishmentSystemInfo, _nodeInfo.NodeId, _tableStyle, _tableName, ContentAttribute.Title, Request.Form, true, IsPostBack); acAttributes.SetParameters(Request.Form, PublishmentSystemInfo, _nodeInfo.NodeId, _relatedIdentities, _tableStyle, _tableName, true, IsPostBack); } //this.ascContent.SetParameters(base.PublishmentSystemInfo, base.PublishmentSystemInfo.Additional.GovPublicNodeID, ETableStyle.GovPublicContent, base.PublishmentSystemInfo.AuxiliaryTableForGovPublic, GovPublicContentAttribute.Content, base.Request.Form, true, base.IsPostBack); } DataBind(); }