protected override void Render(HtmlTextWriter writer) { if (AutoFill) { if (string.IsNullOrEmpty(ProductId)) { ProductId = CommonLinkUtility.GetProductID().ToString("D"); } if (string.IsNullOrEmpty(ModuleId)) { IProduct product; IModule module; CommonLinkUtility.GetLocationByRequest(out product, out module); if (module != null) { ModuleId = module.ID.ToString("D"); } } } writer.Write(Services.WhatsNew.feed.RenderRssMeta( Title, ProductId, ModuleId, ContentOnly? new int?(UserActivityConstants.ContentActionType): null, ContainerId)); }
public static string RenderRssMetaForLocation(string title) { IProduct product; IModule module; CommonLinkUtility.GetLocationByRequest(out product, out module); return(RenderRssMeta(title, product != null ? product.ID.ToString("D") : null, module != null ? module.ID.ToString("D") : null, null)); }
private static void BeforeTransferRequest(NotifyEngine sender, NotifyRequest request) { var aid = Guid.Empty; var aname = string.Empty; if (SecurityContext.IsAuthenticated) { aid = SecurityContext.CurrentAccount.ID; if (CoreContext.UserManager.UserExists(aid)) { aname = CoreContext.UserManager.GetUsers(aid).DisplayUserName(false) .Replace(">", ">") .Replace("<", "<"); } } IProduct product; IModule module; CommonLinkUtility.GetLocationByRequest(out product, out module); if (product == null && CallContext.GetData("asc.web.product_id") != null) { product = WebItemManager.Instance[(Guid)CallContext.GetData("asc.web.product_id")] as IProduct; } var logoText = TenantWhiteLabelSettings.DefaultLogoText; if ((TenantExtra.Enterprise || TenantExtra.Hosted || (CoreContext.Configuration.Personal && CoreContext.Configuration.CustomMode)) && !MailWhiteLabelSettings.Instance.IsDefault) { logoText = TenantLogoManager.GetLogoText(); } request.Arguments.Add(new TagValue(CommonTags.AuthorID, aid)); request.Arguments.Add(new TagValue(CommonTags.AuthorName, aname)); request.Arguments.Add(new TagValue(CommonTags.AuthorUrl, CommonLinkUtility.GetFullAbsolutePath(CommonLinkUtility.GetUserProfile(aid)))); request.Arguments.Add(new TagValue(CommonTags.VirtualRootPath, CommonLinkUtility.GetFullAbsolutePath("~").TrimEnd('/'))); request.Arguments.Add(new TagValue(CommonTags.ProductID, product != null ? product.ID : Guid.Empty)); request.Arguments.Add(new TagValue(CommonTags.ModuleID, module != null ? module.ID : Guid.Empty)); request.Arguments.Add(new TagValue(CommonTags.ProductUrl, CommonLinkUtility.GetFullAbsolutePath(product != null ? product.StartURL : "~"))); request.Arguments.Add(new TagValue(CommonTags.DateTime, TenantUtil.DateTimeNow())); request.Arguments.Add(new TagValue(CommonTags.Helper, new PatternHelper())); request.Arguments.Add(new TagValue(CommonTags.RecipientID, Context.SYS_RECIPIENT_ID)); request.Arguments.Add(new TagValue(CommonTags.RecipientSubscriptionConfigURL, CommonLinkUtility.GetMyStaff())); request.Arguments.Add(new TagValue(CommonTags.HelpLink, CommonLinkUtility.GetHelpLink(false))); request.Arguments.Add(new TagValue(Constants.LetterLogoText, logoText)); request.Arguments.Add(new TagValue(Constants.LetterLogoTextTM, logoText)); request.Arguments.Add(new TagValue(Constants.MailWhiteLabelSettings, MailWhiteLabelSettings.Instance)); if (!request.Arguments.Any(x => CommonTags.SendFrom.Equals(x.Tag))) { request.Arguments.Add(new TagValue(CommonTags.SendFrom, CoreContext.TenantManager.GetCurrentTenant().Name)); } AddLetterLogo(request); }
public static string LocalPath(string relativePath) { IProduct product = null; if (HttpContext.Current != null) { product = HttpContext.Current.Items["currentProduct"] as IProduct; } if (product == null) { //If not saved - get IModule module; CommonLinkUtility.GetLocationByRequest(out product, out module); } if (product != null) { relativePath = product.StartURL.TrimEnd('/') + "/" + relativePath.TrimStart('/'); } return(WebPath.GetPath(relativePath.TrimStart('~'))); }
protected override void Render(HtmlTextWriter writer) { if (AutoFill) { if (string.IsNullOrEmpty(ProductId)) { ProductId = CommonLinkUtility.GetProductID().ToString("D"); } if (string.IsNullOrEmpty(ModuleId)) { IProduct product; IModule module; CommonLinkUtility.GetLocationByRequest(out product, out module); if (module != null) { ModuleId = module.ID.ToString("D"); } } } writer.Write(Services.WhatsNew.feed.RenderRssMeta(Title, ProductId)); }