From 5b76da28377f034d6a843c58f167e7a2fe1c9e0f Mon Sep 17 00:00:00 2001 From: "Jonas@JONAS-DATOR.JOAN.local" Date: Tue, 6 Sep 2011 18:39:14 +0200 Subject: [PATCH] Fix for bug 17588 --HG-- branch : 1.x extra : transplant_source : %B0G5%2A%21%ED%B8%F0Z%B2%9E%AB%7D%C2%0Ad%C5%DAn%81 --- .../Services/MissingSettingsBanner.cs | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Email/Services/MissingSettingsBanner.cs b/src/Orchard.Web/Modules/Orchard.Email/Services/MissingSettingsBanner.cs index df0e7f213..a0adcb6b8 100644 --- a/src/Orchard.Web/Modules/Orchard.Email/Services/MissingSettingsBanner.cs +++ b/src/Orchard.Web/Modules/Orchard.Email/Services/MissingSettingsBanner.cs @@ -1,27 +1,37 @@ using System.Collections.Generic; +using System.Web.Mvc; using Orchard.ContentManagement; -using Orchard.Localization; using Orchard.Email.Models; +using Orchard.Localization; using Orchard.UI.Admin.Notification; using Orchard.UI.Notify; -namespace Orchard.Email.Services { - public class MissingSettingsBanner: INotificationProvider { +namespace Orchard.Email.Services +{ + public class MissingSettingsBanner : INotificationProvider + { private readonly IOrchardServices _orchardServices; + private readonly WorkContext _workContext; - public MissingSettingsBanner(IOrchardServices orchardServices) { + public MissingSettingsBanner(IOrchardServices orchardServices, WorkContext workContext) + { _orchardServices = orchardServices; + _workContext = workContext; T = NullLocalizer.Instance; } public Localizer T { get; set; } - public IEnumerable GetNotifications() { + public IEnumerable GetNotifications() + { var smtpSettings = _orchardServices.WorkContext.CurrentSite.As(); - if ( smtpSettings == null || !smtpSettings.IsValid() ) { - yield return new NotifyEntry { Message = T("The SMTP settings needs to be configured." ), Type = NotifyType.Warning}; + if (smtpSettings == null || !smtpSettings.IsValid()) + { + var urlHelper = new UrlHelper(_workContext.HttpContext.Request.RequestContext); + var url = urlHelper.Action("Email", "Admin", new { Area = "Settings" }); + yield return new NotifyEntry { Message = T("The SMTP settings needs to be configured.", url), Type = NotifyType.Warning }; } } }