public void Delete_OnClick(object sender, EventArgs e) { if (Page.IsPostBack && Page.IsValid) { try { var accountInfo = WeiXinManager.GetAccountInfo(PublishmentSystemID); var accessToken = MPUtils.GetAccessToken(accountInfo); var result = CommonApi.DeleteMenu(accessToken); if (result.errmsg == "ok") { SuccessMessage("菜单禁用成功,取消关注公众账号后再次关注,可以立即看到禁用后的效果"); } else { FailMessage($"菜单禁用失败:{result.errmsg}"); } } catch (Exception ex) { FailMessage($"菜单禁用失败:{ex.Message}"); } } }
public static void ParticleProcessor(MPWorld world, int numParticles, MPParticle *particles) { for (int i = 0; i < numParticles; ++i) { if (particles[i].hit == -1 || particles[i].hit == particles[i].hit_prev) { continue; } GameObject col = world.colliders[particles[i].hit]; RedirectForceToParent cp = col.GetComponent <RedirectForceToParent>(); if (cp) { Transform parent = col.transform.parent; if (parent) { MPUtils.CallParticleHitHandler(world, parent.gameObject, ref particles[i]); } } else { MPUtils.CallParticleHitHandler(world, col, ref particles[i]); } } }
void OnDestroy() { if (MPWorld.s_instances.Count == 0) { return; } Vector3 pos = trans.position; Vector3 scale = trans.localScale; MPWorld.s_instances[0].AddOneTimeAction(() => { float radius = (scale.x + scale.y + scale.z) * 0.5f; MPUtils.AddRadialSphereForce(MPWorld.s_instances[0], pos, radius, radius * 100.0f); }); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("PublishmentSystemId"); _menuId = Body.GetQueryInt("menuID"); _parentId = Body.GetQueryInt("parentID"); if (!IsPostBack) { EMenuTypeUtils.AddListItems(DdlMenuType); var menuInfo = DataProviderWx.MenuDao.GetMenuInfo(_menuId); if (menuInfo == null) { _menuId = 0; } if (_menuId == 0) { LtlPageTitle.Text = $"添加{(_parentId == 0 ? "主" : "子")}菜单"; } else { LtlPageTitle.Text = $"修改{(_parentId == 0 ? "主" : "子")}菜单({menuInfo.MenuName})"; TbMenuName.Text = menuInfo.MenuName; ControlUtils.SelectListItems(DdlMenuType, EMenuTypeUtils.GetValue(menuInfo.MenuType)); TbKeyword.Text = menuInfo.Keyword; TbUrl.Text = menuInfo.Url; LtlScript.Text = $"<script>{MPUtils.GetChannelOrContentSelectScript(PublishmentSystemInfo, menuInfo.ChannelId, menuInfo.ContentId)}</script>"; } DdlMenuType_OnSelectedIndexChanged(null, EventArgs.Empty); BtnKeywordSelect.Attributes.Add("onclick", "parent." + ModalKeywordSelect.GetOpenWindowString(PublishmentSystemId, "selectKeyword")); BtnContentSelect.Attributes.Add("onclick", "parent." + ModalContentSelect.GetOpenWindowString(PublishmentSystemId, false, "contentSelect")); BtnChannelSelect.Attributes.Add("onclick", "parent." + ModalChannelSelect.GetOpenWindowString(PublishmentSystemId)); } }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("PublishmentSystemID"); menuID = TranslateUtils.ToInt(GetQueryString("menuID")); parentID = TranslateUtils.ToInt(GetQueryString("parentID")); if (!IsPostBack) { EMenuTypeUtils.AddListItems(ddlMenuType); var menuInfo = DataProviderWX.MenuDAO.GetMenuInfo(menuID); if (menuInfo == null) { menuID = 0; } if (menuID == 0) { ltlPageTitle.Text = $"添加{(parentID == 0 ? "主" : "子")}菜单"; } else { ltlPageTitle.Text = $"修改{(parentID == 0 ? "主" : "子")}菜单({menuInfo.MenuName})"; tbMenuName.Text = menuInfo.MenuName; ControlUtils.SelectListItems(ddlMenuType, EMenuTypeUtils.GetValue(menuInfo.MenuType)); tbKeyword.Text = menuInfo.Keyword; tbUrl.Text = menuInfo.Url; ltlScript.Text = $"<script>{MPUtils.GetChannelOrContentSelectScript(PublishmentSystemInfo, menuInfo.ChannelID, menuInfo.ContentID)}</script>"; } ddlMenuType_OnSelectedIndexChanged(null, EventArgs.Empty); btnKeywordSelect.Attributes.Add("onclick", "parent." + Modal.KeywordSelect.GetOpenWindowString(PublishmentSystemID, "selectKeyword")); btnContentSelect.Attributes.Add("onclick", "parent." + Modal.ContentSelect.GetOpenWindowString(PublishmentSystemID, false, "contentSelect")); btnChannelSelect.Attributes.Add("onclick", "parent." + CMS.BackgroundPages.Modal.ChannelSelect.GetOpenWindowString(PublishmentSystemID)); } }
void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var ltlItemTitle = e.Item.FindControl("ltlItemTitle") as Literal; var ltlChannel = e.Item.FindControl("ltlChannel") as Literal; var ltlItemImageUrl = e.Item.FindControl("ltlItemImageUrl") as Literal; var ltlItemSummary = e.Item.FindControl("ltlItemSummary") as Literal; var ltlSelect = e.Item.FindControl("ltlSelect") as Literal; var contentInfo = new ContentInfo(e.Item.DataItem); ltlItemTitle.Text = WebUtils.GetContentTitle(PublishmentSystemInfo, contentInfo, PageUrl); var nodeName = _valueHashtable[contentInfo.NodeId] as string; if (nodeName == null) { nodeName = NodeManager.GetNodeNameNavigation(PublishmentSystemId, contentInfo.NodeId); _valueHashtable[contentInfo.NodeId] = nodeName; } ltlChannel.Text = nodeName; var imageUrl = contentInfo.GetExtendedAttribute(BackgroundContentAttribute.ImageUrl); if (!string.IsNullOrEmpty(imageUrl)) { ltlItemImageUrl.Text = $@"<img src=""{PageUtility.ParseNavigationUrl(PublishmentSystemInfo, imageUrl)}"" style=""max-width:78px;max-height:78px;"" />"; } ltlItemSummary.Text = MPUtils.GetSummary(contentInfo.GetExtendedAttribute(BackgroundContentAttribute.Summary), contentInfo.GetExtendedAttribute(BackgroundContentAttribute.Content)); if (_isMultiple) { ltlSelect.Text = $@"<input type=""checkbox"" name=""IDsCollection"" value=""{contentInfo.NodeId}_{contentInfo.Id}"" />"; } else { ltlSelect.Text = $@"<input type=""radio"" name=""IDsCollection"" value=""{contentInfo.NodeId}_{contentInfo.Id}"" />"; } } }
/// <summary> /// Prior toe successful deletion of a management pack the user is prompted for confirmation. /// </summary> /// <param name="mp">Management Pack that is going to be deleted.</param> /// <returns>Verification Boolean if the pack can be removed.</returns> private bool UninstallConfirmed(ManagementPack mp) { MessageBoxOptions messageBoxOption = (MessageBoxOptions)0; if (RightToLeft == RightToLeft.Yes) { messageBoxOption = MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading; } CultureInfo invariantCulture = CultureInfo.InvariantCulture; string confirmMPDelete = "Are you sure you would like to delete this Community Pack?\nThe pack will be removed from your Management Group, but it will remain available in the catalog if you change your mind."; object[] managementPackDisplayName = new object[] { MPUtils.GetMPDisplayName(this, mp), mp.Version.ToString() }; if (MessageBox.Show(this, string.Format(invariantCulture, confirmMPDelete, managementPackDisplayName), ((IApplicationInfo)GetService(typeof(IApplicationInfo))).ProductTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, messageBoxOption) == DialogResult.No) { return(false); } return(true); }
private bool SyncMenu(GetMenuResultFull resultFull, AccountInfo accountInfo, out string errorMessage) { var isSync = false; errorMessage = string.Empty; var bg = CommonApi.GetMenuFromJsonResult(resultFull).menu; var accessToken = MPUtils.GetAccessToken(accountInfo); var result = CommonApi.CreateMenu(accessToken, bg); if (result.errmsg == "ok") { isSync = true; } else { isSync = false; errorMessage = result.errmsg; } return(isSync); }
public static unsafe void GatheredHitProcessor(MPWorld world, int numHits, MPHitData *hits) { for (int i = 0; i < numHits; ++i) { if (hits[i].num_hits == 0) { continue; } GameObject col = world.colliders[i]; RedirectForceToParent cp = col.GetComponent <RedirectForceToParent>(); if (cp) { Transform parent = col.transform.parent; if (parent) { MPUtils.CallGathereditHandler(world, parent.gameObject, ref hits[i]); } } else { MPUtils.CallGathereditHandler(world, col, ref hits[i]); } } }
public override void Submit_OnClick(object sender, EventArgs e) { try { var idsCollection = Request.Form["IDsCollection"]; if (string.IsNullOrEmpty(idsCollection)) { FailMessage("操作失败,请选择需要显示的内容"); return; } if (_isKeywordAdd) { if (_keywordId > 0) { var idsList = TranslateUtils.StringCollectionToStringList(idsCollection); var resourceId = 0; foreach (var ids in idsList) { var nodeId = TranslateUtils.ToInt(ids.Split('_')[0]); var contentId = TranslateUtils.ToInt(ids.Split('_')[1]); var tableStyle = NodeManager.GetTableStyle(PublishmentSystemInfo, nodeId); var tableName = NodeManager.GetTableName(PublishmentSystemInfo, nodeId); var contentInfo = DataProvider.ContentDao.GetContentInfo(tableStyle, tableName, contentId); var resourceInfo = new KeywordResourceInfo(); resourceInfo.ResourceId = 0; resourceInfo.PublishmentSystemId = PublishmentSystemId; resourceInfo.KeywordId = _keywordId; resourceInfo.Title = contentInfo.Title; resourceInfo.ImageUrl = contentInfo.GetExtendedAttribute(BackgroundContentAttribute.ImageUrl); resourceInfo.Summary = MPUtils.GetSummary(contentInfo.GetExtendedAttribute(BackgroundContentAttribute.Summary), contentInfo.GetExtendedAttribute(BackgroundContentAttribute.Content)); resourceInfo.ResourceType = EResourceType.Site; resourceInfo.IsShowCoverPic = false; resourceInfo.Content = contentInfo.GetExtendedAttribute(BackgroundContentAttribute.Content); resourceInfo.NavigationUrl = string.Empty; resourceInfo.ChannelId = contentInfo.NodeId; resourceInfo.ContentId = contentInfo.Id; resourceInfo.Taxis = 0; var id = DataProviderWx.KeywordResourceDao.Insert(resourceInfo); if (resourceId == 0) { resourceId = id; } } var redirectUrl = PageKeywordNewsAdd.GetRedirectUrl(PublishmentSystemId, _keywordId, resourceId, !_isMultiple); PageUtils.CloseModalPageAndRedirect(Page, redirectUrl); } } else { var scripts = string.Empty; if (_isMultiple) { var titleBuilder = new StringBuilder(); var idsList = TranslateUtils.StringCollectionToStringList(idsCollection); foreach (var ids in idsList) { var nodeId = TranslateUtils.ToInt(ids.Split('_')[0]); var contentId = TranslateUtils.ToInt(ids.Split('_')[1]); var tableStyle = NodeManager.GetTableStyle(PublishmentSystemInfo, nodeId); var tableName = NodeManager.GetTableName(PublishmentSystemInfo, nodeId); var contentInfo = DataProvider.ContentDao.GetContentInfo(tableStyle, tableName, contentId); titleBuilder.AppendFormat("{0} <a href='{1}' target='blank'>查看</a><br />", contentInfo.Title, PageUtilityWX.GetContentUrl(PublishmentSystemInfo, contentInfo)); } scripts = $@"window.parent.{_jsMethod}(""{idsCollection}"", ""{titleBuilder}"");"; } else { var nodeId = TranslateUtils.ToInt(idsCollection.Split('_')[0]); var contentId = TranslateUtils.ToInt(idsCollection.Split('_')[1]); var tableStyle = NodeManager.GetTableStyle(PublishmentSystemInfo, nodeId); var tableName = NodeManager.GetTableName(PublishmentSystemInfo, nodeId); var contentInfo = DataProvider.ContentDao.GetContentInfo(tableStyle, tableName, contentId); var imageUrl = contentInfo.GetExtendedAttribute(BackgroundContentAttribute.ImageUrl); var imageSrc = PageUtility.ParseNavigationUrl(PublishmentSystemInfo, imageUrl); var summary = MPUtils.GetSummary(contentInfo.GetExtendedAttribute(BackgroundContentAttribute.Summary), contentInfo.GetExtendedAttribute(BackgroundContentAttribute.Content)); var pageUrl = PageUtilityWX.GetContentUrl(PublishmentSystemInfo, contentInfo); scripts = $@"window.parent.{_jsMethod}(""{contentInfo.Title}"", ""{nodeId}"", ""{contentId}"", ""{pageUrl}"", ""{imageUrl}"", ""{imageSrc}"", ""{summary}"");"; if (Request.QueryString["itemIndex"] != null) { scripts = $@"window.parent.{_jsMethod}({_itemIndex}, ""{contentInfo.Title}"", {nodeId}, {contentId});"; } } PageUtils.CloseModalPageWithoutRefresh(Page, scripts); } } catch (Exception ex) { FailMessage(ex, "失败:" + ex.Message); } }
void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var keywordId = SqlUtils.EvalInt(e.Item.DataItem, "KeywordId"); var keywords = SqlUtils.EvalString(e.Item.DataItem, "Keywords"); var isDisabled = TranslateUtils.ToBool(SqlUtils.EvalString(e.Item.DataItem, "IsDisabled")); var reply = SqlUtils.EvalString(e.Item.DataItem, "Reply"); var matchType = EMatchTypeUtils.GetEnumType(SqlUtils.EvalString(e.Item.DataItem, "MatchType")); var addDate = SqlUtils.EvalDateTime(e.Item.DataItem, "AddDate"); var phSingle = e.Item.FindControl("phSingle") as PlaceHolder; var phMultiple = e.Item.FindControl("phMultiple") as PlaceHolder; var resourceInfoList = DataProviderWx.KeywordResourceDao.GetResourceInfoList(keywordId); phMultiple.Visible = resourceInfoList.Count > 1; phSingle.Visible = !phMultiple.Visible; if (phSingle.Visible) { var resourceInfo = new KeywordResourceInfo(); if (resourceInfoList.Count > 0) { resourceInfo = resourceInfoList[0]; } var ltlSingleTitle = e.Item.FindControl("ltlSingleTitle") as Literal; var ltlSingleKeywords = e.Item.FindControl("ltlSingleKeywords") as Literal; var ltlSingleAddDate = e.Item.FindControl("ltlSingleAddDate") as Literal; var ltlSingleImageUrl = e.Item.FindControl("ltlSingleImageUrl") as Literal; var ltlSingleSummary = e.Item.FindControl("ltlSingleSummary") as Literal; var ltlSingleEditUrl = e.Item.FindControl("ltlSingleEditUrl") as Literal; var ltlSingleDeleteUrl = e.Item.FindControl("ltlSingleDeleteUrl") as Literal; ltlSingleTitle.Text = $@"<a href=""{"javascript:;"}"" target=""_blank"">{resourceInfo.Title}</a>"; ltlSingleKeywords.Text = $@"{keywords + (isDisabled ? "(禁用)" : string.Empty)} <a href=""javascript:;"" onclick=""{ModalKeywordAddNews.GetOpenWindowStringToEdit(PublishmentSystemId, keywordId)}"">修改</a>"; ltlSingleAddDate.Text = addDate.ToShortDateString(); if (!string.IsNullOrEmpty(resourceInfo.ImageUrl)) { ltlSingleImageUrl.Text = $@"<img src=""{PageUtility.ParseNavigationUrl(PublishmentSystemInfo, resourceInfo.ImageUrl)}"" class=""appmsg_thumb"">"; } ltlSingleSummary.Text = MPUtils.GetSummary(resourceInfo.Summary, resourceInfo.Content); ltlSingleEditUrl.Text = $@"<a class=""js_edit"" href=""{PageKeywordNewsAdd.GetRedirectUrl(PublishmentSystemId, keywordId, resourceInfo.ResourceId, phSingle.Visible)}""><i class=""icon18_common edit_gray"">编辑</i></a>"; ltlSingleDeleteUrl.Text = $@"<a class=""js_del no_extra"" href=""{GetRedirectUrl( PublishmentSystemId)}&delete=true&keywordID={keywordId}"" onclick=""javascript:return confirm('此操作将删除图文回复“{keywords}”,确认吗?');""><i class=""icon18_common del_gray"">删除</i></a>"; } else { var resourceInfo = resourceInfoList[0]; resourceInfoList.Remove(resourceInfo); var ltlMultipleKeywords = e.Item.FindControl("ltlMultipleKeywords") as Literal; var ltlMultipleAddDate = e.Item.FindControl("ltlMultipleAddDate") as Literal; var ltlMultipleTitle = e.Item.FindControl("ltlMultipleTitle") as Literal; var ltlMultipleImageUrl = e.Item.FindControl("ltlMultipleImageUrl") as Literal; var rptMultipleContents = e.Item.FindControl("rptMultipleContents") as Repeater; var ltlMultipleEditUrl = e.Item.FindControl("ltlMultipleEditUrl") as Literal; var ltlMultipleDeleteUrl = e.Item.FindControl("ltlMultipleDeleteUrl") as Literal; ltlMultipleKeywords.Text = $@"{keywords + (isDisabled ? "(禁用)" : string.Empty)} <a href=""javascript:;"" onclick=""{ModalKeywordAddNews.GetOpenWindowStringToEdit(PublishmentSystemId, keywordId)}"">修改</a>"; ltlMultipleAddDate.Text = addDate.ToShortDateString(); ltlMultipleTitle.Text = $@"<a href=""{"javascript:;"}"" target=""_blank"">{resourceInfo.Title}</a>"; if (!string.IsNullOrEmpty(resourceInfo.ImageUrl)) { ltlMultipleImageUrl.Text = $@"<img src=""{PageUtility.ParseNavigationUrl(PublishmentSystemInfo, resourceInfo.ImageUrl)}"" class=""appmsg_thumb"">"; } rptMultipleContents.DataSource = resourceInfoList; rptMultipleContents.ItemDataBound += rptMultipleContents_ItemDataBound; rptMultipleContents.DataBind(); ltlMultipleEditUrl.Text = $@"<a class=""js_edit"" href=""{PageKeywordNewsAdd.GetRedirectUrl(PublishmentSystemId, keywordId, resourceInfo.ResourceId, phSingle.Visible)}""><i class=""icon18_common edit_gray"">编辑</i></a>"; ltlMultipleDeleteUrl.Text = $@"<a class=""js_del no_extra"" href=""{GetRedirectUrl( PublishmentSystemId)}&delete=true&keywordID={keywordId}"" onclick=""javascript:return confirm('此操作将删除图文回复“{keywords}”,确认吗?');""><i class=""icon18_common del_gray"">删除</i></a>"; } } }
void OnDestroy() { float radius = (trans.localScale.x + trans.localScale.y + trans.localScale.z) * 0.5f; MPUtils.AddRadialSphereForce(trans.position, radius, radius * 100.0f); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("PublishmentSystemID"); keywordID = TranslateUtils.ToInt(GetQueryString("keywordID")); resourceID = TranslateUtils.ToInt(GetQueryString("resourceID")); isSingle = TranslateUtils.ToBool(GetQueryString("isSingle")); if (Request.QueryString["deleteResource"] != null) { var deleteResourceID = TranslateUtils.ToInt(Request.QueryString["deleteResourceID"]); try { DataProviderWX.KeywordResourceDAO.Delete(deleteResourceID); SuccessDeleteMessage(); } catch (Exception ex) { FailDeleteMessage(ex); } } if (!IsPostBack) { var pageTitle = keywordID == 0 ? "添加关键词图文回复" : "修改关键词图文回复"; ltlPageTitle.Text = pageTitle; BreadCrumb(AppManager.WeiXin.LeftMenu.ID_Accounts, AppManager.WeiXin.LeftMenu.Function.ID_ImageReply, pageTitle, AppManager.WeiXin.Permission.WebSite.ImageReply); phSingle.Visible = isSingle; phMultiple.Visible = !isSingle; if (isSingle) { var resourceInfo = new KeywordResourceInfo(); resourceInfo.ResourceID = 0; resourceInfo.PublishmentSystemID = PublishmentSystemID; resourceInfo.KeywordID = keywordID; resourceInfo.Title = "标题"; resourceInfo.ImageUrl = string.Empty; resourceInfo.Summary = string.Empty; resourceInfo.ResourceType = EResourceType.Content; resourceInfo.IsShowCoverPic = true; resourceInfo.Content = string.Empty; resourceInfo.NavigationUrl = string.Empty; resourceInfo.ChannelID = 0; resourceInfo.ContentID = 0; resourceInfo.Taxis = 0; if (resourceID > 0) { resourceInfo = DataProviderWX.KeywordResourceDAO.GetResourceInfo(resourceID); } ltlSingleTitle.Text = $@"<a href=""javascript:;"">{resourceInfo.Title}</a>"; if (string.IsNullOrEmpty(resourceInfo.ImageUrl)) { ltlSingleImageUrl.Text = @"<i class=""appmsg_thumb default"">封面图片</i>"; } else { ltlSingleImageUrl.Text = $@"<img class=""js_appmsg_thumb"" src=""{PageUtility.ParseNavigationUrl( PublishmentSystemInfo, resourceInfo.ImageUrl)}"">"; } ltlSingleSummary.Text = MPUtils.GetSummary(resourceInfo.Summary, resourceInfo.Content); } else { var resourceInfoList = DataProviderWX.KeywordResourceDAO.GetResourceInfoList(keywordID); var resourceInfo = new KeywordResourceInfo(); resourceInfo.ResourceID = 0; resourceInfo.PublishmentSystemID = PublishmentSystemID; resourceInfo.KeywordID = keywordID; resourceInfo.Title = "标题"; resourceInfo.ImageUrl = string.Empty; resourceInfo.Summary = string.Empty; resourceInfo.ResourceType = EResourceType.Content; resourceInfo.IsShowCoverPic = true; resourceInfo.Content = string.Empty; resourceInfo.NavigationUrl = string.Empty; resourceInfo.ChannelID = 0; resourceInfo.ContentID = 0; resourceInfo.Taxis = 0; if (resourceInfoList.Count <= 1) { resourceInfoList.Add(resourceInfo); } if (resourceInfoList.Count > 1) { resourceInfo = resourceInfoList[0]; resourceInfoList.Remove(resourceInfo); } ltlMultipleTitle.Text = $@"<a href=""javascript:;"">{resourceInfo.Title}</a>"; if (string.IsNullOrEmpty(resourceInfo.ImageUrl)) { ltlMultipleImageUrl.Text = @"<i class=""appmsg_thumb default"">封面图片</i>"; } else { ltlMultipleImageUrl.Text = $@"<img class=""js_appmsg_thumb"" src=""{PageUtility.ParseNavigationUrl( PublishmentSystemInfo, resourceInfo.ImageUrl)}"">"; } ltlMultipleEditUrl.Text = $@"<a class=""icon18_common edit_gray js_edit"" href=""{BackgroundKeywordResourceAdd.GetRedirectUrl( PublishmentSystemID, keywordID, resourceInfo.ResourceID, 1, false)}"" target=""resource""> </a>"; rptMultipleContents.DataSource = resourceInfoList; rptMultipleContents.ItemDataBound += rptMultipleContents_ItemDataBound; rptMultipleContents.DataBind(); ltlItemEditUrl.Text = $@"<a class=""icon18_common edit_gray js_edit"" href=""{BackgroundKeywordResourceAdd.GetRedirectUrl( PublishmentSystemID, keywordID, 0, resourceInfoList.Count + 2, false)}"" target=""resource""> </a>"; } ltlIFrame.Text = $@"<iframe frameborder=""0"" id=""resource"" name=""resource"" width=""100%"" height=""1300"" src=""{BackgroundKeywordResourceAdd .GetRedirectUrl(PublishmentSystemID, keywordID, resourceID, 1, isSingle)}"" scrolling=""no""></iframe>"; } }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("PublishmentSystemID"); keywordID = TranslateUtils.ToInt(GetQueryString("keywordID")); resourceID = TranslateUtils.ToInt(GetQueryString("resourceID")); floor = TranslateUtils.ToInt(GetQueryString("floor")); isSingle = TranslateUtils.ToBool(GetQueryString("isSingle")); if (!IsPostBack) { ltlPreview.Text = @" <p class=""js_cover upload_preview"" style=""display:none""> <input type=""hidden"" id=""imageUrl"" name=""imageUrl"" value="""" /> <img src="""" width=""64""> <a class=""js_removeCover"" href=""javascript:;"" onclick=""deleteImageUrl();return false;"">删除</a> </p>"; ltlNav.Text = GetNavHtml(EResourceType.Site); ltlSite.Text = @" <div id=""titles"" class=""well well-small"" style=""display:none""></div> <input id=""channelID"" name=""channelID"" type=""hidden"" value="""" /> <input id=""contentID"" name=""contentID"" type=""hidden"" value="""" />"; if (resourceID > 0) { var resourceInfo = DataProviderWX.KeywordResourceDAO.GetResourceInfo(resourceID); if (resourceInfo.ResourceType == EResourceType.Site) { var siteHtml = MPUtils.GetSitePreivewHtml(PublishmentSystemInfo, resourceInfo.ChannelID, resourceInfo.ContentID); if (!string.IsNullOrEmpty(siteHtml)) { ltlSite.Text = $@" <div id=""titles"" class=""well well-small"">{siteHtml}</div> <input id=""channelID"" name=""channelID"" type=""hidden"" value=""{resourceInfo.ChannelID}"" /> <input id=""contentID"" name=""contentID"" type=""hidden"" value=""{resourceInfo.ContentID}"" />"; } } tbTitle.Text = resourceInfo.Title; tbTaxis.Text = resourceInfo.Taxis.ToString(); if (!string.IsNullOrEmpty(resourceInfo.ImageUrl)) { ltlPreview.Text = $@" <p class=""js_cover upload_preview""> <input type=""hidden"" id=""imageUrl"" name=""imageUrl"" value=""{resourceInfo.ImageUrl}"" /> <img src=""{PageUtility.ParseNavigationUrl(PublishmentSystemInfo, resourceInfo.ImageUrl)}"" width=""64""> <a class=""js_removeCover"" href=""javascript:;"" onclick=""deleteImageUrl();return false;"">删除</a> </p>"; } tbSummary.Text = resourceInfo.Summary; if (resourceInfo.IsShowCoverPic == false) { ltlScript.Text += "<script>$('.js_show_cover_pic').click();</script>"; } breContent.Text = resourceInfo.Content; tbNavigationUrl.Text = resourceInfo.NavigationUrl; ltlScript.Text += $@"<script>$('.nav a.{EResourceTypeUtils.GetValue(resourceInfo.ResourceType)}').click();</script>"; } btnContentSelect.Attributes.Add("onclick", "parent." + Modal.ContentSelect.GetOpenWindowString(PublishmentSystemID, false, "contentSelect")); btnChannelSelect.Attributes.Add("onclick", "parent." + CMS.BackgroundPages.Modal.ChannelSelect.GetOpenWindowString(PublishmentSystemID)); var top = 0; if (floor > 1) { top = 67 + (floor - 1) * 103; } ltlArrow.Text = $@"<i class=""arrow arrow_out"" style=""margin-top: {top}px;""></i><i class=""arrow arrow_in"" style=""margin-top: {top}px;""></i>"; } }