public static string GetContentTitle(SiteInfo siteInfo, ContentInfo contentInfo, string pageUrl) { string url; var title = ContentUtility.FormatTitle(contentInfo.GetString(BackgroundContentAttribute.TitleFormatString), contentInfo.Title); var displayString = contentInfo.IsColor ? $"<span style='color:#ff0000;text-decoration:none' title='醒目'>{title}</span>" : title; if (contentInfo.ChannelId < 0) { url = displayString; } else if (contentInfo.IsChecked) { url = $"<a href='{PageRedirect.GetRedirectUrlToContent(siteInfo.Id, contentInfo.ChannelId, contentInfo.Id)}' target='blank'>{displayString}</a>"; } else { url = $"<a href='{PageContentView.GetContentViewUrl(siteInfo.Id, contentInfo.ChannelId, contentInfo.Id, pageUrl)}'>{displayString}</a>"; } var image = string.Empty; if (contentInfo.IsRecommend) { image += " <img src='../pic/icon/recommend.gif' title='推荐' align='absmiddle' border=0 />"; } if (contentInfo.IsHot) { image += " <img src='../pic/icon/hot.gif' title='热点' align='absmiddle' border=0 />"; } if (contentInfo.IsTop) { image += " <img src='../pic/icon/top.gif' title='置顶' align='absmiddle' border=0 />"; } if (contentInfo.ReferenceId > 0) { if (contentInfo.GetString(ContentAttribute.TranslateContentType) == ETranslateContentType.ReferenceContent.ToString()) { image += " <img src='../pic/icon/reference.png' title='引用内容' align='absmiddle' border=0 />(引用内容)"; } else if (contentInfo.GetString(ContentAttribute.TranslateContentType) != ETranslateContentType.ReferenceContent.ToString()) { image += " <img src='../pic/icon/reference.png' title='引用地址' align='absmiddle' border=0 />(引用地址)"; } } if (!string.IsNullOrEmpty(contentInfo.GetString(ContentAttribute.LinkUrl))) { image += " <img src='../pic/icon/link.png' title='外部链接' align='absmiddle' border=0 />"; } if (!string.IsNullOrEmpty(contentInfo.GetString(BackgroundContentAttribute.ImageUrl))) { var imageUrl = PageUtility.ParseNavigationUrl(siteInfo, contentInfo.GetString(BackgroundContentAttribute.ImageUrl), true); var openWindowString = ModalMessage.GetOpenWindowString(siteInfo.Id, "预览图片", $"<img src='{imageUrl}' />", 500, 500); image += $@" <a href=""javascript:;"" onclick=""{openWindowString}""><img src='../assets/icons/img.gif' title='预览图片' align='absmiddle' border=0 /></a>"; } if (!string.IsNullOrEmpty(contentInfo.GetString(BackgroundContentAttribute.VideoUrl))) { var openWindowString = ModalMessage.GetOpenWindowStringToPreviewVideoByUrl(siteInfo.Id, contentInfo.GetString(BackgroundContentAttribute.VideoUrl)); image += $@" <a href=""javascript:;"" onclick=""{openWindowString}""><img src='../pic/icon/video.png' title='预览视频' align='absmiddle' border=0 /></a>"; } if (!string.IsNullOrEmpty(contentInfo.GetString(BackgroundContentAttribute.FileUrl))) { image += " <img src='../pic/icon/attachment.gif' title='附件' align='absmiddle' border=0 />"; if (siteInfo.Additional.IsCountDownload) { var count = CountManager.GetCount(siteInfo.TableName, contentInfo.Id.ToString(), ECountType.Download); image += $"下载次数:<strong>{count}</strong>"; } } if (!string.IsNullOrEmpty(contentInfo.WritingUserName)) { var openWindowString = ModalUserView.GetOpenWindowString(contentInfo.WritingUserName); image += $@" (<a href=""javascript:;"" onclick=""{openWindowString}"">投稿用户:{contentInfo.WritingUserName}</a>)"; } return(url + image); }
public static string GetContentTitle(SiteInfo siteInfo, ContentInfo contentInfo, string pageUrl) { string url; var title = ContentUtility.FormatTitle(contentInfo.GetString(ContentAttribute.GetFormatStringAttributeName(ContentAttribute.Title)), contentInfo.Title); var displayString = contentInfo.IsColor ? $"<span style='color:#ff0000;text-decoration:none' title='醒目'>{title}</span>" : title; if (contentInfo.IsChecked && contentInfo.ChannelId > 0) { url = $"<a>{displayString}</a>"; } else { url = $@"<a href=""javascript:;"" >{displayString}</a>"; } var image = string.Empty; if (contentInfo.IsRecommend) { image += " <img src='../pic/icon/recommend.gif' title='推荐' align='absmiddle' border=0 />"; } if (contentInfo.IsHot) { image += " <img src='../pic/icon/hot.gif' title='热点' align='absmiddle' border=0 />"; } if (contentInfo.IsTop) { image += " <img src='../pic/icon/top.gif' title='置顶' align='absmiddle' border=0 />"; } if (contentInfo.ReferenceId > 0) { if (contentInfo.GetString(ContentAttribute.TranslateContentType) == ETranslateContentType.ReferenceContent.ToString()) { image += " <img src='../pic/icon/reference.png' title='引用内容' align='absmiddle' border=0 />(引用内容)"; } else if (contentInfo.GetString(ContentAttribute.TranslateContentType) != ETranslateContentType.ReferenceContent.ToString()) { image += " <img src='../pic/icon/reference.png' title='引用地址' align='absmiddle' border=0 />(引用地址)"; } } if (!string.IsNullOrEmpty(contentInfo.GetString(ContentAttribute.LinkUrl))) { image += " <img src='../pic/icon/link.png' title='外部链接' align='absmiddle' border=0 />"; } if (!string.IsNullOrEmpty(contentInfo.GetString(BackgroundContentAttribute.ImageUrl))) { var imageUrl = PageUtility.ParseNavigationUrl(siteInfo, contentInfo.GetString(BackgroundContentAttribute.ImageUrl), true); var openWindowString = ModalMessage.GetOpenWindowString(siteInfo.Id, "预览图片", $"<img src='{imageUrl}' />", 500, 500); image += $@" <a href=""javascript:;"" onclick=""{openWindowString}""><img src='../assets/icons/img.gif' title='预览图片' align='absmiddle' border=0 /></a>"; } if (!string.IsNullOrEmpty(contentInfo.GetString(BackgroundContentAttribute.VideoUrl))) { var openWindowString = ModalMessage.GetOpenWindowStringToPreviewVideoByUrl(siteInfo.Id, contentInfo.GetString(BackgroundContentAttribute.VideoUrl)); image += $@" <a href=""javascript:;"" onclick=""{openWindowString}""><img src='../pic/icon/video.png' title='预览视频' align='absmiddle' border=0 /></a>"; } if (!string.IsNullOrEmpty(contentInfo.GetString(BackgroundContentAttribute.FileUrl))) { image += " <img src='../pic/icon/attachment.gif' title='附件' align='absmiddle' border=0 />"; } return(url + image); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } appointmentID = Body.GetQueryInt("appointmentID"); appointmentItemID = Body.GetQueryInt("appointmentItemID"); var selectImageClick = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, tbContentImageUrl.ClientID); var uploadImageClick = ModalUploadImageSingle.GetOpenWindowStringToTextBox(PublishmentSystemId, tbContentImageUrl.ClientID); var cuttingImageClick = ModalCuttingImage.GetOpenWindowStringWithTextBox(PublishmentSystemId, tbContentImageUrl.ClientID); var previewImageClick = ModalMessage.GetOpenWindowStringToPreviewImage(PublishmentSystemId, tbContentImageUrl.ClientID); ltlContentImageUrl.Text = $@" <a class=""btn"" href=""javascript:;"" onclick=""{selectImageClick};return false;"" title=""选择""><i class=""icon-th""></i></a> <a class=""btn"" href=""javascript:;"" onclick=""{uploadImageClick};return false;"" title=""上传""><i class=""icon-arrow-up""></i></a> <a class=""btn"" href=""javascript:;"" onclick=""{cuttingImageClick};return false;"" title=""裁切""><i class=""icon-crop""></i></a> <a class=""btn"" href=""javascript:;"" onclick=""{previewImageClick};return false;"" title=""预览""><i class=""icon-eye-open""></i></a>"; var selectVideoClick = ModalSelectVideo.GetOpenWindowString(PublishmentSystemInfo, tbContentVideoUrl.ClientID); var uploadVideoClick = ModalUploadVideo.GetOpenWindowStringToTextBox(PublishmentSystemId, tbContentVideoUrl.ClientID); var previewVideoClick = ModalMessage.GetOpenWindowStringToPreviewVideoByUrl(PublishmentSystemId, tbContentVideoUrl.ClientID); ltlContentVideoUrl.Text = $@" <a class=""btn"" href=""javascript:;"" onclick=""{selectVideoClick};return false;"" title=""选择""><i class=""icon-th""></i></a> <a class=""btn"" href=""javascript:;"" onclick=""{uploadVideoClick};return false;"" title=""上传""><i class=""icon-arrow-up""></i></a> <a class=""btn"" href=""javascript:;"" onclick=""{previewVideoClick};return false;"" title=""预览""><i class=""icon-eye-open""></i></a>"; if (!IsPostBack) { ltlTopImageUrl.Text = $@"<img id=""preview_topImageUrl"" src=""{AppointmentManager.GetImageUrl(PublishmentSystemInfo, string.Empty)}"" width=""370"" align=""middle"" />"; if (appointmentItemID > 0) { var appointmentItemInfo = DataProviderWX.AppointmentItemDAO.GetItemInfo(appointmentItemID); if (appointmentItemInfo != null) { tbTitle.Text = appointmentItemInfo.Title; topImageUrl.Value = appointmentItemInfo.TopImageUrl; cbIsDescription.Checked = appointmentItemInfo.IsDescription; tbDescriptionTitle.Text = appointmentItemInfo.DescriptionTitle; tbDescription.Text = appointmentItemInfo.Description; cbIsImageUrl.Checked = appointmentItemInfo.IsImageUrl; tbImageUrlTitle.Text = appointmentItemInfo.ImageUrlTitle; tbContentImageUrl.Text = appointmentItemInfo.ImageUrl; cbIsVideoUrl.Checked = appointmentItemInfo.IsVideoUrl; tbVideoUrlTitle.Text = appointmentItemInfo.VideoUrlTitle; tbContentVideoUrl.Text = appointmentItemInfo.VideoUrl; cbIsImageUrlCollection.Checked = appointmentItemInfo.IsImageUrlCollection; tbImageUrlCollectionTitle.Text = appointmentItemInfo.ImageUrlCollectionTitle; imageUrlCollection.Value = appointmentItemInfo.ImageUrlCollection; largeImageUrlCollection.Value = appointmentItemInfo.LargeImageUrlCollection; cbIsMap.Checked = appointmentItemInfo.IsMap; tbMapTitle.Text = appointmentItemInfo.MapTitle; tbMapAddress.Text = appointmentItemInfo.MapAddress; cbIsTel.Checked = appointmentItemInfo.IsTel; tbTelTitle.Text = appointmentItemInfo.TelTitle; tbTel.Text = appointmentItemInfo.Tel; if (!string.IsNullOrEmpty(appointmentItemInfo.TopImageUrl)) { ltlTopImageUrl.Text = $@"<img id=""preview_topImageUrl"" src=""{PageUtility.ParseNavigationUrl( PublishmentSystemInfo, appointmentItemInfo.TopImageUrl)}"" width=""370"" align=""middle"" />"; } if (!string.IsNullOrEmpty(appointmentItemInfo.MapAddress)) { ltlMap.Text = $@"<iframe style=""width:100%;height:100%;background-color:#ffffff;margin-bottom:15px;"" scrolling=""auto"" frameborder=""0"" width=""100%"" height=""100%"" src=""{MapManager.GetMapUrl(PublishmentSystemInfo, tbMapAddress.Text)}""></iframe>"; } if (!string.IsNullOrEmpty(appointmentItemInfo.ImageUrlCollection)) { var scriptBuilder = new StringBuilder(); scriptBuilder.AppendFormat(@" addImage('{0}','{1}'); ", appointmentItemInfo.ImageUrlCollection, appointmentItemInfo.LargeImageUrlCollection); ltlScript.Text = $@" $(document).ready(function(){{ {scriptBuilder.ToString()} }}); "; } } } } // this.btnAddImageUrl.Attributes.Add("onclick", Modal.AppointmentItemPhotoUpload.GetOpenWindowStringToAdd(base.PublishmentSystemID, this.imageUrlCollection.Value)); }