mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Orchard.Commands;
|
||||
using Orchard.Environment.Descriptor.Models;
|
||||
@@ -57,11 +58,11 @@ namespace Orchard.Modules.Commands {
|
||||
[CommandName("feature enable")]
|
||||
public void Enable(params string[] featureNames) {
|
||||
Context.Output.WriteLine(T("Enabling features {0}", string.Join(",", featureNames)));
|
||||
bool listAvailableFeatures = false;
|
||||
List<string> featuresToEnable = new List<string>();
|
||||
string[] availableFeatures = _featureManager.GetAvailableFeatures().Select(x => x.Id).ToArray();
|
||||
var listAvailableFeatures = false;
|
||||
var featuresToEnable = new List<string>();
|
||||
var availableFeatures = _featureManager.GetAvailableFeatures().Select(x => x.Id).OrderBy(x => x).ToArray();
|
||||
foreach (var featureName in featureNames) {
|
||||
if (availableFeatures.Contains(featureName)) {
|
||||
if (availableFeatures.Contains(featureName, StringComparer.OrdinalIgnoreCase)) {
|
||||
featuresToEnable.Add(featureName);
|
||||
}
|
||||
else {
|
||||
|
@@ -92,7 +92,7 @@ namespace Orchard.Modules.Services {
|
||||
/// <param name="force">Boolean parameter indicating if the feature should disable the features which depend on it if required or fail otherwise.</param>
|
||||
public void DisableFeatures(IEnumerable<string> featureIds, bool force) {
|
||||
foreach (string featureId in _featureManager.DisableFeatures(featureIds, force)) {
|
||||
var featureName = _featureManager.GetAvailableFeatures().Where(f => f.Id == featureId).First().Name;
|
||||
var featureName = _featureManager.GetAvailableFeatures().Single(f => f.Id.Equals(featureId, StringComparison.OrdinalIgnoreCase)).Name;
|
||||
Services.Notifier.Information(T("{0} was disabled", featureName));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user