From 671c516301cf0969bb3b9a9f58a374978862ede5 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Wed, 30 Mar 2011 17:45:38 -0700 Subject: [PATCH] #17587: Addind a link in notifications for missing Base Url Work Items: 17587 --HG-- branch : 1.x --- .../Modules/Orchard.Warmup/Services/SettingsBanner.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Warmup/Services/SettingsBanner.cs b/src/Orchard.Web/Modules/Orchard.Warmup/Services/SettingsBanner.cs index b51da54f0..0ce541ee7 100644 --- a/src/Orchard.Web/Modules/Orchard.Warmup/Services/SettingsBanner.cs +++ b/src/Orchard.Web/Modules/Orchard.Warmup/Services/SettingsBanner.cs @@ -1,4 +1,7 @@ using System.Collections.Generic; +using System.Security.Policy; +using System.Web.Mvc; +using System.Web.Routing; using Orchard.ContentManagement; using Orchard.Environment.Configuration; using Orchard.Localization; @@ -8,9 +11,11 @@ using Orchard.UI.Notify; namespace Orchard.Warmup.Services { public class SettingsBanner: INotificationProvider { private readonly IOrchardServices _orchardServices; + private readonly WorkContext _workContext; - public SettingsBanner(IOrchardServices orchardServices) { + public SettingsBanner(IOrchardServices orchardServices, WorkContext workContext) { _orchardServices = orchardServices; + _workContext = workContext; T = NullLocalizer.Instance; } @@ -18,7 +23,9 @@ namespace Orchard.Warmup.Services { public IEnumerable GetNotifications() { if ( string.IsNullOrWhiteSpace(_orchardServices.WorkContext.CurrentSite.BaseUrl)) { - yield return new NotifyEntry { Message = T("The Warmup feature needs the Base Url site setting to be set." ), Type = NotifyType.Warning }; + var urlHelper = new UrlHelper(_workContext.HttpContext.Request.RequestContext); + var url = urlHelper.Action("Index", "Admin", new {Area = "Settings"}); + yield return new NotifyEntry { Message = T("The Warmup feature needs the Base Url site setting to be set.", url), Type = NotifyType.Warning }; } } }