mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Merge
--HG-- branch : 1.x
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user