--HG--
branch : 1.x
This commit is contained in:
Andre Rodrigues
2011-03-30 18:08:20 -07:00

View File

@@ -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<NotifyEntry> 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 <a href=\"{0}\">Base Url site setting</a> to be set.", url), Type = NotifyType.Warning };
}
}
}