mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Merge
--HG-- branch : 1.x
This commit is contained in:
@@ -83,7 +83,7 @@ namespace Orchard.Modules.Controllers {
|
||||
moduleEntry.IsRecentlyInstalled = _moduleService.IsRecentlyInstalled(moduleEntry.Descriptor);
|
||||
|
||||
if (_extensionDisplayEventHandler != null) {
|
||||
foreach (string notification in _extensionDisplayEventHandler.Displaying(moduleEntry.Descriptor)) {
|
||||
foreach (string notification in _extensionDisplayEventHandler.Displaying(moduleEntry.Descriptor, ControllerContext.RequestContext)) {
|
||||
moduleEntry.Notifications.Add(notification);
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Routing;
|
||||
using Orchard.Environment.Extensions.Models;
|
||||
using Orchard.Events;
|
||||
|
||||
@@ -7,6 +8,6 @@ namespace Orchard.Modules.Events {
|
||||
/// <summary>
|
||||
/// Called before an extension is displayed
|
||||
/// </summary>
|
||||
IEnumerable<string> Displaying(ExtensionDescriptor extensionDescriptor);
|
||||
IEnumerable<string> Displaying(ExtensionDescriptor extensionDescriptor, RequestContext requestContext);
|
||||
}
|
||||
}
|
@@ -9,7 +9,7 @@
|
||||
@if (Model.ContentPart.Notifications != null && Model.ContentPart.Notifications.Count > 0) {
|
||||
<div class="notifications">
|
||||
@foreach (string notification in Model.ContentPart.Notifications) {
|
||||
<h5>@notification</h5>
|
||||
<h5>@Html.Raw(notification)</h5>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
@@ -235,7 +235,7 @@ namespace Orchard.Packaging.Controllers {
|
||||
packagings.Item2.Installed = true;
|
||||
|
||||
if (_extensionDisplayEventHandler != null) {
|
||||
foreach (string notification in _extensionDisplayEventHandler.Displaying(packagings.Item1)) {
|
||||
foreach (string notification in _extensionDisplayEventHandler.Displaying(packagings.Item1, ControllerContext.RequestContext)) {
|
||||
packagings.Item2.Notifications.Add(notification);
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.DisplayManagement;
|
||||
@@ -11,7 +10,6 @@ using Orchard.Logging;
|
||||
using Orchard.Packaging.Models;
|
||||
using Orchard.Packaging.Services;
|
||||
using Orchard.Packaging.ViewModels;
|
||||
using Orchard.Reports;
|
||||
using Orchard.Reports.Services;
|
||||
using Orchard.Security;
|
||||
using Orchard.Themes;
|
||||
|
@@ -1,5 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Environment.Extensions.Models;
|
||||
using Orchard.Localization;
|
||||
@@ -26,7 +29,7 @@ namespace Orchard.Packaging.Events {
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public IEnumerable<string> Displaying(ExtensionDescriptor extensionDescriptor) {
|
||||
public IEnumerable<string> Displaying(ExtensionDescriptor extensionDescriptor, RequestContext requestContext) {
|
||||
// Get status from background task state or directly
|
||||
_backgroundPackageUpdateStatus.Value =
|
||||
_backgroundPackageUpdateStatus.Value ??
|
||||
@@ -37,7 +40,12 @@ namespace Orchard.Packaging.Events {
|
||||
|
||||
if (updatePackageEntry != null) {
|
||||
if (updatePackageEntry.NewVersionToInstall != null) {
|
||||
yield return T("Version {0} is available.", updatePackageEntry.NewVersionToInstall.Version).ToString();
|
||||
UrlHelper urlHelper = new UrlHelper(requestContext);
|
||||
yield return T("Version {0} is available (See <a href=\"{1}\">Updates</a>).", updatePackageEntry.NewVersionToInstall.Version,
|
||||
urlHelper.Action(DefaultExtensionTypes.IsTheme(updatePackageEntry.ExtensionsDescriptor.ExtensionType)
|
||||
? "ThemesUpdates"
|
||||
: "ModulesUpdates",
|
||||
"GalleryUpdates")).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Routing;
|
||||
using Orchard.Environment.Extensions.Models;
|
||||
using Orchard.Events;
|
||||
|
||||
@@ -7,6 +8,6 @@ namespace Orchard.Packaging.Events {
|
||||
/// <summary>
|
||||
/// Called before an extension is displayed
|
||||
/// </summary>
|
||||
IEnumerable<string> Displaying(ExtensionDescriptor extensionDescriptor);
|
||||
IEnumerable<string> Displaying(ExtensionDescriptor extensionDescriptor, RequestContext requestContext);
|
||||
}
|
||||
}
|
@@ -51,7 +51,7 @@
|
||||
@if (item.Notifications != null && item.Notifications.Count > 0) {
|
||||
<div class="notifications">
|
||||
@foreach (string notification in item.Notifications) {
|
||||
<h5>@notification</h5>
|
||||
<h5>@Html.Raw(notification)</h5>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
@@ -73,7 +73,7 @@
|
||||
@if (item.Notifications != null && item.Notifications.Count > 0) {
|
||||
<div class="notifications">
|
||||
@foreach (string notification in item.Notifications) {
|
||||
<h5>@notification</h5>
|
||||
<h5>@Html.Raw(notification)</h5>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
@@ -92,7 +92,8 @@ namespace Orchard.Themes.Controllers {
|
||||
};
|
||||
|
||||
if (_extensionDisplayEventHandler != null) {
|
||||
foreach (string notification in _extensionDisplayEventHandler.Displaying(themeEntry.Descriptor)) {
|
||||
foreach (string notification in _extensionDisplayEventHandler.Displaying(themeEntry.Descriptor, ControllerContext.RequestContext))
|
||||
{
|
||||
themeEntry.Notifications.Add(notification);
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Routing;
|
||||
using Orchard.Environment.Extensions.Models;
|
||||
using Orchard.Events;
|
||||
|
||||
@@ -7,6 +8,6 @@ namespace Orchard.Themes.Events {
|
||||
/// <summary>
|
||||
/// Called before an extension is displayed
|
||||
/// </summary>
|
||||
IEnumerable<string> Displaying(ExtensionDescriptor extensionDescriptor);
|
||||
IEnumerable<string> Displaying(ExtensionDescriptor extensionDescriptor, RequestContext requestContext);
|
||||
}
|
||||
}
|
@@ -41,12 +41,12 @@
|
||||
<button type="submit" class="disable" title="Disable">@T("Disable")</button>
|
||||
}
|
||||
}
|
||||
else {
|
||||
else {
|
||||
using (Html.BeginFormAntiForgeryPost(Url.Action("Enable"), FormMethod.Post, new { @class = "inline link" })) {
|
||||
@Html.Hidden("themeName", (string)Model.ContentPart.Descriptor.Id)
|
||||
<button type="submit" class="enable" title="Enable">@T("Enable")</button>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@if (Model.ContentPart.NeedsUpdate) {
|
||||
<span> | </span>
|
||||
|
Reference in New Issue
Block a user