mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Dashboard:
|
Dashboard:
|
||||||
Description: Standard admin dashboard.
|
Description: Standard admin dashboard.
|
||||||
Dependencies: Common
|
|
||||||
Category: Core
|
Category: Core
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Feeds:
|
Feeds:
|
||||||
Description: RSS feeds for content items.
|
Description: RSS feeds for content items.
|
||||||
Dependencies: Common
|
|
||||||
Category: Syndication
|
Category: Syndication
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
HomePage:
|
HomePage:
|
||||||
Description: Standard site home page that allows a specified content type or container to *be* the home page.
|
Description: Standard site home page that allows a specified content type or container to *be* the home page.
|
||||||
Dependencies: Common
|
|
||||||
Category: Core
|
Category: Core
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Navigation:
|
Navigation:
|
||||||
Description: Menu management.
|
Description: Menu management.
|
||||||
Dependencies: Common
|
|
||||||
Category: Core
|
Category: Core
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Scheduling:
|
Scheduling:
|
||||||
Description: Scheduled background tasks.
|
Description: Scheduled background tasks.
|
||||||
Dependencies: Common
|
|
||||||
Category: Core
|
Category: Core
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Settings:
|
Settings:
|
||||||
Description: Site settings.
|
Description: Site settings.
|
||||||
Dependencies: Common
|
|
||||||
Category: Core
|
Category: Core
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
XmlRpc:
|
XmlRpc:
|
||||||
Description: XML-RPC opt-in implementation.
|
Description: XML-RPC opt-in implementation.
|
||||||
Dependencies: Common
|
Category: Content Management
|
||||||
Category: Core
|
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Futures.Widgets:
|
Futures.Widgets:
|
||||||
Description: Widgets container with simple inline content editing widget.
|
Description: Widgets container with simple inline content editing widget.
|
||||||
Dependencies: Common
|
|
||||||
Category: Widget
|
Category: Widget
|
@@ -7,5 +7,5 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Orchard.Blogs:
|
Orchard.Blogs:
|
||||||
Description: A simple web log.
|
Description: A simple web log.
|
||||||
Dependencies: Common, XmlRpc
|
Dependencies: XmlRpc
|
||||||
Category: Content
|
Category: Content
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Orchard.Comments:
|
Orchard.Comments:
|
||||||
Description: Standard content item comments.
|
Description: Standard content item comments.
|
||||||
Dependencies: Common
|
|
||||||
Category: Social
|
Category: Social
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Orchard.DevTools:
|
Orchard.DevTools:
|
||||||
Description: An assortment of debuging tools.
|
Description: An assortment of debuging tools.
|
||||||
Dependencies: Common
|
|
||||||
Category: Developer
|
Category: Developer
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Orchard.Media:
|
Orchard.Media:
|
||||||
Description: File system based media upload, storage and management.
|
Description: File system based media upload, storage and management.
|
||||||
Dependencies: Common
|
|
||||||
Category: Media
|
Category: Media
|
@@ -1,11 +1,8 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using Orchard.Localization;
|
using Orchard.Localization;
|
||||||
using Orchard.Modules.ViewModels;
|
using Orchard.Modules.ViewModels;
|
||||||
using Orchard.Mvc.AntiForgery;
|
|
||||||
using Orchard.Mvc.Results;
|
using Orchard.Mvc.Results;
|
||||||
using Orchard.UI.Notify;
|
|
||||||
|
|
||||||
namespace Orchard.Modules.Controllers {
|
namespace Orchard.Modules.Controllers {
|
||||||
public class AdminController : Controller {
|
public class AdminController : Controller {
|
||||||
@@ -37,9 +34,7 @@ namespace Orchard.Modules.Controllers {
|
|||||||
if (module == null)
|
if (module == null)
|
||||||
return new NotFoundResult();
|
return new NotFoundResult();
|
||||||
|
|
||||||
return View(new ModuleEditViewModel {
|
return View(new ModuleEditViewModel {Name = module.DisplayName});
|
||||||
Name = module.DisplayName
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult Features() {
|
public ActionResult Features() {
|
||||||
@@ -50,43 +45,30 @@ namespace Orchard.Modules.Controllers {
|
|||||||
return View(new FeaturesViewModel {Features = features});
|
return View(new FeaturesViewModel {Features = features});
|
||||||
}
|
}
|
||||||
|
|
||||||
[ValidateAntiForgeryTokenOrchard]
|
[HttpPost]
|
||||||
public ActionResult Enable(string id) {
|
public ActionResult Enable(string id, bool? force) {
|
||||||
if (!Services.Authorizer.Authorize(Permissions.ManageFeatures, T("Not allowed to manage features")))
|
if (!Services.Authorizer.Authorize(Permissions.ManageFeatures, T("Not allowed to manage features")))
|
||||||
return new HttpUnauthorizedResult();
|
return new HttpUnauthorizedResult();
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(id))
|
if (string.IsNullOrEmpty(id))
|
||||||
return new NotFoundResult();
|
return new NotFoundResult();
|
||||||
|
|
||||||
_moduleService.EnableFeatures(new [] {id});
|
_moduleService.EnableFeatures(new[] {id}, force != null && (bool) force);
|
||||||
|
|
||||||
return RedirectToAction("Features");
|
return RedirectToAction("Features");
|
||||||
}
|
}
|
||||||
|
|
||||||
[ValidateAntiForgeryTokenOrchard]
|
[HttpPost]
|
||||||
public ActionResult Disable(string id) {
|
public ActionResult Disable(string id, bool? force) {
|
||||||
if (!Services.Authorizer.Authorize(Permissions.ManageFeatures, T("Not allowed to manage features")))
|
if (!Services.Authorizer.Authorize(Permissions.ManageFeatures, T("Not allowed to manage features")))
|
||||||
return new HttpUnauthorizedResult();
|
return new HttpUnauthorizedResult();
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(id))
|
if (string.IsNullOrEmpty(id))
|
||||||
return new NotFoundResult();
|
return new NotFoundResult();
|
||||||
|
|
||||||
_moduleService.DisableFeatures(new[] { id });
|
_moduleService.DisableFeatures(new[] {id}, force != null && (bool) force);
|
||||||
|
|
||||||
return RedirectToAction("Features");
|
return RedirectToAction("Features");
|
||||||
}
|
}
|
||||||
|
|
||||||
private class FormValueRequiredAttribute : ActionMethodSelectorAttribute {
|
|
||||||
private readonly string _submitButtonName;
|
|
||||||
|
|
||||||
public FormValueRequiredAttribute(string submitButtonName) {
|
|
||||||
_submitButtonName = submitButtonName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo) {
|
|
||||||
var value = controllerContext.HttpContext.Request.Form[_submitButtonName];
|
|
||||||
return !string.IsNullOrEmpty(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Orchard.Modules:
|
Orchard.Modules:
|
||||||
Description: Standard module and feature management.
|
Description: Standard module and feature management.
|
||||||
Dependencies: Common
|
|
||||||
Category: Core
|
Category: Core
|
@@ -16,7 +16,8 @@ namespace Orchard.Modules.Services {
|
|||||||
private readonly IExtensionManager _extensionManager;
|
private readonly IExtensionManager _extensionManager;
|
||||||
private readonly IShellDescriptorManager _shellDescriptorManager;
|
private readonly IShellDescriptorManager _shellDescriptorManager;
|
||||||
|
|
||||||
public ModuleService(IOrchardServices orchardServices,IExtensionManager extensionManager, IShellDescriptorManager shellDescriptorManager) {
|
public ModuleService(IOrchardServices orchardServices, IExtensionManager extensionManager,
|
||||||
|
IShellDescriptorManager shellDescriptorManager) {
|
||||||
Services = orchardServices;
|
Services = orchardServices;
|
||||||
_extensionManager = extensionManager;
|
_extensionManager = extensionManager;
|
||||||
_shellDescriptorManager = shellDescriptorManager;
|
_shellDescriptorManager = shellDescriptorManager;
|
||||||
@@ -27,14 +28,19 @@ namespace Orchard.Modules.Services {
|
|||||||
public IOrchardServices Services { get; set; }
|
public IOrchardServices Services { get; set; }
|
||||||
|
|
||||||
public IModule GetModuleByName(string moduleName) {
|
public IModule GetModuleByName(string moduleName) {
|
||||||
return _extensionManager.AvailableExtensions().Where(e => string.Equals(e.Name, moduleName, StringComparison.OrdinalIgnoreCase) && string.Equals(e.ExtensionType, ModuleExtensionType, StringComparison.OrdinalIgnoreCase)).Select(
|
return
|
||||||
|
_extensionManager.AvailableExtensions().Where(
|
||||||
|
e =>
|
||||||
|
string.Equals(e.Name, moduleName, StringComparison.OrdinalIgnoreCase) &&
|
||||||
|
string.Equals(e.ExtensionType, ModuleExtensionType, StringComparison.OrdinalIgnoreCase)).Select(
|
||||||
descriptor => AssembleModuleFromDescriptor(descriptor)).FirstOrDefault();
|
descriptor => AssembleModuleFromDescriptor(descriptor)).FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<IModule> GetInstalledModules() {
|
public IEnumerable<IModule> GetInstalledModules() {
|
||||||
return
|
return
|
||||||
_extensionManager.AvailableExtensions().Where(
|
_extensionManager.AvailableExtensions().Where(
|
||||||
e => String.Equals(e.ExtensionType, ModuleExtensionType, StringComparison.OrdinalIgnoreCase)).Select(
|
e => String.Equals(e.ExtensionType, ModuleExtensionType, StringComparison.OrdinalIgnoreCase)).Select
|
||||||
|
(
|
||||||
descriptor => AssembleModuleFromDescriptor(descriptor));
|
descriptor => AssembleModuleFromDescriptor(descriptor));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,86 +52,145 @@ namespace Orchard.Modules.Services {
|
|||||||
_extensionManager.UninstallExtension(ModuleExtensionType, moduleName);
|
_extensionManager.UninstallExtension(ModuleExtensionType, moduleName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IModule GetModuleByFeatureName(string featureName) {
|
|
||||||
return GetInstalledModules()
|
|
||||||
.Where(
|
|
||||||
m =>
|
|
||||||
m.Features.FirstOrDefault(f => string.Equals(f.Name, featureName, StringComparison.OrdinalIgnoreCase)) !=
|
|
||||||
null).FirstOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<IModuleFeature> GetAvailableFeatures() {
|
public IEnumerable<IModuleFeature> GetAvailableFeatures() {
|
||||||
var enabledFeatures = _shellDescriptorManager.GetShellDescriptor().EnabledFeatures;
|
var enabledFeatures = _shellDescriptorManager.GetShellDescriptor().EnabledFeatures;
|
||||||
return GetInstalledModules()
|
return GetInstalledModules()
|
||||||
.SelectMany(m => _extensionManager.LoadFeatures(m.Features))
|
.SelectMany(m => _extensionManager.LoadFeatures(m.Features))
|
||||||
.Select(f => AssembleModuleFromDescriptor(f, enabledFeatures.FirstOrDefault(sf => string.Equals(sf.Name, f.Descriptor.Name, StringComparison.OrdinalIgnoreCase)) != null));
|
.Select(
|
||||||
}
|
f =>
|
||||||
|
AssembleModuleFromDescriptor(f,
|
||||||
public IEnumerable<Feature> GetAvailableFeaturesByModule(string moduleName) {
|
enabledFeatures.FirstOrDefault(
|
||||||
throw new NotImplementedException();
|
sf =>
|
||||||
|
string.Equals(sf.Name, f.Descriptor.Name,
|
||||||
|
StringComparison.OrdinalIgnoreCase)) != null));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void EnableFeatures(IEnumerable<string> featureNames) {
|
public void EnableFeatures(IEnumerable<string> featureNames) {
|
||||||
|
EnableFeatures(featureNames, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void EnableFeatures(IEnumerable<string> features, bool force) {
|
||||||
var shellDescriptor = _shellDescriptorManager.GetShellDescriptor();
|
var shellDescriptor = _shellDescriptorManager.GetShellDescriptor();
|
||||||
var enabledFeatures = shellDescriptor.EnabledFeatures.ToList();
|
var enabledFeatures = shellDescriptor.EnabledFeatures.ToList();
|
||||||
var features = GetAvailableFeatures().ToList();
|
|
||||||
|
|
||||||
foreach (var name in featureNames) {
|
var featuresToEnable =
|
||||||
var featureName = name;
|
features.Select(s => EnableFeature(s, GetAvailableFeatures(), force)).
|
||||||
var feature = features.Single(f => f.Descriptor.Name == featureName);
|
SelectMany(ies => ies.Select(s => s));
|
||||||
var sleepingDependencies =
|
|
||||||
feature.Descriptor.Dependencies.Where(s => enabledFeatures.FirstOrDefault(sf => sf.Name == s) == null);
|
|
||||||
|
|
||||||
if (sleepingDependencies.Count() != 0) {
|
if (featuresToEnable.Count() == 0)
|
||||||
Services.Notifier.Warning(T(
|
return;
|
||||||
"If you want to enable {0}, then you'll also need {1} (and I won't let you flip everything on in one go yet).",
|
|
||||||
featureName,
|
foreach (var featureToEnable in featuresToEnable) {
|
||||||
sleepingDependencies.Count() > 1
|
enabledFeatures.Add(new ShellFeature {Name = featureToEnable});
|
||||||
? string.Join("",
|
Services.Notifier.Information(T("{0} was enabled", featureToEnable));
|
||||||
sleepingDependencies.Select(
|
|
||||||
(s, i) =>
|
|
||||||
i == sleepingDependencies.Count() - 2
|
|
||||||
? T("{0} and ", s).ToString()
|
|
||||||
: T("{0}, ", s).ToString()).ToArray())
|
|
||||||
: sleepingDependencies.First()));
|
|
||||||
} else if (enabledFeatures.FirstOrDefault(f => f.Name == featureName) == null) {
|
|
||||||
enabledFeatures.Add(new ShellFeature {Name = featureName});
|
|
||||||
Services.Notifier.Information(T("{0} was enabled", featureName));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_shellDescriptorManager.UpdateShellDescriptor(shellDescriptor.SerialNumber, enabledFeatures, shellDescriptor.Parameters);
|
_shellDescriptorManager.UpdateShellDescriptor(shellDescriptor.SerialNumber, enabledFeatures,
|
||||||
|
shellDescriptor.Parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DisableFeatures(IEnumerable<string> featureNames) {
|
public void DisableFeatures(IEnumerable<string> featureNames) {
|
||||||
|
DisableFeatures(featureNames, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DisableFeatures(IEnumerable<string> features, bool force) {
|
||||||
var shellDescriptor = _shellDescriptorManager.GetShellDescriptor();
|
var shellDescriptor = _shellDescriptorManager.GetShellDescriptor();
|
||||||
var enabledFeatures = shellDescriptor.EnabledFeatures.ToList();
|
var enabledFeatures = shellDescriptor.EnabledFeatures.ToList();
|
||||||
var features = GetAvailableFeatures().ToList();
|
|
||||||
|
|
||||||
foreach (var name in featureNames) {
|
var featuresToDisable =
|
||||||
var featureName = name;
|
features.Select(s => DisableFeature(s, GetAvailableFeatures(), force)).SelectMany(
|
||||||
var dependants = features.Where(f => f.IsEnabled && f.Descriptor.Dependencies != null && f.Descriptor.Dependencies.Contains(featureName));
|
ies => ies.Select(s => s));
|
||||||
|
|
||||||
if (dependants.Count() != 0) {
|
if (featuresToDisable.Count() == 0)
|
||||||
Services.Notifier.Warning(T(
|
return;
|
||||||
"If you want to disable {0}, then you'll also lose {1} (and I won't let you do that yet).",
|
|
||||||
|
foreach (var featureToDisable in featuresToDisable) {
|
||||||
|
var feature = featureToDisable;
|
||||||
|
enabledFeatures.RemoveAll(f => f.Name == feature);
|
||||||
|
Services.Notifier.Information(T("{0} was disabled", feature));
|
||||||
|
}
|
||||||
|
|
||||||
|
_shellDescriptorManager.UpdateShellDescriptor(shellDescriptor.SerialNumber, enabledFeatures,
|
||||||
|
shellDescriptor.Parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IModule GetModuleByFeatureName(string featureName) {
|
||||||
|
return GetInstalledModules()
|
||||||
|
.Where(
|
||||||
|
m =>
|
||||||
|
m.Features.FirstOrDefault(
|
||||||
|
f => string.Equals(f.Name, featureName, StringComparison.OrdinalIgnoreCase)) !=
|
||||||
|
null).FirstOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerable<string> EnableFeature(string featureName, IEnumerable<IModuleFeature> features, bool force) {
|
||||||
|
var featuresList = features.ToList();
|
||||||
|
var getDisabledDependencies =
|
||||||
|
new Func<string, IEnumerable<IModuleFeature>, IEnumerable<IModuleFeature>>(
|
||||||
|
(n, fs) => {
|
||||||
|
var feature = fs.Single(f => f.Descriptor.Name == n);
|
||||||
|
return feature.Descriptor.Dependencies != null
|
||||||
|
? feature.Descriptor.Dependencies.Select(
|
||||||
|
fn => fs.Single(f => f.Descriptor.Name == fn)).Where(f => !f.IsEnabled)
|
||||||
|
: Enumerable.Empty<IModuleFeature>();
|
||||||
|
});
|
||||||
|
|
||||||
|
var featuresToEnable = GetAffectedFeatures(featureName, featuresList, getDisabledDependencies);
|
||||||
|
|
||||||
|
if (featuresToEnable.Count() > 1 && !force) {
|
||||||
|
GenerateWarning("If you want {0} enabled, then you'll also need to enable {1}.",
|
||||||
featureName,
|
featureName,
|
||||||
dependants.Count() > 0
|
featuresToEnable.Where(fn => fn != featureName));
|
||||||
? string.Join("",
|
return Enumerable.Empty<string>();
|
||||||
dependants.Select(
|
|
||||||
(f, i) =>
|
|
||||||
i == dependants.Count() - 2
|
|
||||||
? T("{0} and ", f.Descriptor.Name).ToString()
|
|
||||||
: T("{0}, ", f.Descriptor.Name).ToString()).ToArray())
|
|
||||||
: dependants.First().Descriptor.Name));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
enabledFeatures.RemoveAll(f => f.Name == featureName);
|
|
||||||
Services.Notifier.Information(T("{0} was disabled", featureName));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_shellDescriptorManager.UpdateShellDescriptor(shellDescriptor.SerialNumber, enabledFeatures, shellDescriptor.Parameters);
|
return featuresToEnable;
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerable<string> DisableFeature(string featureName, IEnumerable<IModuleFeature> features, bool force) {
|
||||||
|
var featuresList = features.ToList();
|
||||||
|
var getEnabledDependants =
|
||||||
|
new Func<string, IEnumerable<IModuleFeature>, IEnumerable<IModuleFeature>>(
|
||||||
|
(n, fs) => fs.Where(f => f.IsEnabled && f.Descriptor.Dependencies != null && f.Descriptor.Dependencies.Contains(n)));
|
||||||
|
|
||||||
|
var featuresToDisable = GetAffectedFeatures(featureName, featuresList, getEnabledDependants);
|
||||||
|
|
||||||
|
if (featuresToDisable.Count() > 1 && !force) {
|
||||||
|
GenerateWarning("If {0} is disabled, then you'll also lose {1}.",
|
||||||
|
featureName,
|
||||||
|
featuresToDisable.Where(fn => fn != featureName));
|
||||||
|
return Enumerable.Empty<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
return featuresToDisable;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static IEnumerable<string> GetAffectedFeatures(string featureName, IEnumerable<IModuleFeature> features, Func<string, IEnumerable<IModuleFeature>, IEnumerable<IModuleFeature>> getAffectedDependencies) {
|
||||||
|
var dependencies = new List<string> {featureName};
|
||||||
|
|
||||||
|
foreach (var dependency in getAffectedDependencies(featureName, features))
|
||||||
|
dependencies.AddRange(GetAffectedFeatures(dependency.Descriptor.Name, features, getAffectedDependencies));
|
||||||
|
|
||||||
|
return dependencies;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GenerateWarning(string messageFormat, string featureName, IEnumerable<string> featuresInQuestion) {
|
||||||
|
if (featuresInQuestion.Count() < 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Services.Notifier.Warning(T(
|
||||||
|
messageFormat,
|
||||||
|
featureName,
|
||||||
|
featuresInQuestion.Count() > 1
|
||||||
|
? string.Join("",
|
||||||
|
featuresInQuestion.Select(
|
||||||
|
(fn, i) =>
|
||||||
|
T(i == featuresInQuestion.Count() - 1
|
||||||
|
? "{0}"
|
||||||
|
: (i == featuresInQuestion.Count() - 2
|
||||||
|
? "{0} and "
|
||||||
|
: "{0}, "), fn).ToString()).ToArray())
|
||||||
|
: featuresInQuestion.First()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IModule AssembleModuleFromDescriptor(ExtensionDescriptor extensionDescriptor) {
|
private static IModule AssembleModuleFromDescriptor(ExtensionDescriptor extensionDescriptor) {
|
||||||
|
@@ -13,7 +13,10 @@
|
|||||||
if (featureGroup == featureGroups.First())
|
if (featureGroup == featureGroups.First())
|
||||||
categoryClassName += " first";
|
categoryClassName += " first";
|
||||||
if (featureGroup == featureGroups.Last())
|
if (featureGroup == featureGroups.Last())
|
||||||
categoryClassName += " last"; %>
|
categoryClassName += " last";
|
||||||
|
|
||||||
|
//temporarily "disable" actions on core features
|
||||||
|
var showActions = categoryName.ToString() != "Core"; %>
|
||||||
<li class="<%=categoryClassName %>">
|
<li class="<%=categoryClassName %>">
|
||||||
<h2><%=Html.Encode(categoryName) %></h2>
|
<h2><%=Html.Encode(categoryName) %></h2>
|
||||||
<ul><%
|
<ul><%
|
||||||
@@ -42,7 +45,8 @@
|
|||||||
"") %>
|
"") %>
|
||||||
</div><%
|
</div><%
|
||||||
} %>
|
} %>
|
||||||
</div>
|
</div><%
|
||||||
|
if (showActions) { %>
|
||||||
<div class="actions"><%
|
<div class="actions"><%
|
||||||
if (feature.IsEnabled) {
|
if (feature.IsEnabled) {
|
||||||
using (Html.BeginFormAntiForgeryPost(string.Format("{0}", Url.Action("Disable", new { area = "Orchard.Modules" })), FormMethod.Post, new {@class = "inline link"})) { %>
|
using (Html.BeginFormAntiForgeryPost(string.Format("{0}", Url.Action("Disable", new { area = "Orchard.Modules" })), FormMethod.Post, new {@class = "inline link"})) { %>
|
||||||
@@ -56,6 +60,23 @@
|
|||||||
}
|
}
|
||||||
} %>
|
} %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="cathedral"><%
|
||||||
|
//temporary forceful feature actions
|
||||||
|
if (feature.IsEnabled) {
|
||||||
|
using (Html.BeginFormAntiForgeryPost(string.Format("{0}", Url.Action("Disable", new { area = "Orchard.Modules" })), FormMethod.Post, new {@class = "inline link"})) { %>
|
||||||
|
<%=Html.Hidden("id", feature.Descriptor.Name, new { id = "" })%>
|
||||||
|
<%=Html.Hidden("force", true)%>
|
||||||
|
<button type="submit"><%=_Encoded("π")%></button><%
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
using (Html.BeginFormAntiForgeryPost(string.Format("{0}", Url.Action("Enable", new { area = "Orchard.Modules" })), FormMethod.Post, new {@class = "inline link"})) { %>
|
||||||
|
<%=Html.Hidden("id", feature.Descriptor.Name, new { id = "" })%>
|
||||||
|
<%=Html.Hidden("force", true)%>
|
||||||
|
<button type="submit"><%=_Encoded("π")%></button><%
|
||||||
|
}
|
||||||
|
} %>
|
||||||
|
</div><%
|
||||||
|
} %>
|
||||||
</div>
|
</div>
|
||||||
</li><%
|
</li><%
|
||||||
} %>
|
} %>
|
||||||
|
@@ -1,11 +1,16 @@
|
|||||||
.features .category {
|
.orchard-modules #main h2 {
|
||||||
|
border:0;
|
||||||
|
margin-bottom:.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.features .category {
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
}
|
}
|
||||||
.features .feature {
|
.features .feature {
|
||||||
border:1px solid #EAEAEA;
|
border:1px solid #EAEAEA;
|
||||||
display:block;
|
display:block;
|
||||||
float:left;
|
float:left;
|
||||||
height:6.8em;
|
height:5em;
|
||||||
margin:0 .5% 1% .5%;
|
margin:0 .5% 1% .5%;
|
||||||
position:relative;
|
position:relative;
|
||||||
width:32.1%;
|
width:32.1%;
|
||||||
@@ -28,8 +33,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.features .enabled.feature {
|
.features .enabled.feature {
|
||||||
background:#D1F2A5;
|
background:#FFF;
|
||||||
border-color:#BCD994;
|
border-color:#CFE493;cfe493
|
||||||
}
|
}
|
||||||
.features .disabled.feature {
|
.features .disabled.feature {
|
||||||
background:#EAEAEA;
|
background:#EAEAEA;
|
||||||
@@ -40,7 +45,7 @@
|
|||||||
padding:.4em .5em;
|
padding:.4em .5em;
|
||||||
}
|
}
|
||||||
.features .dependencies li,
|
.features .dependencies li,
|
||||||
.features .actions a {
|
.features .actions {
|
||||||
font-size:1.4em;
|
font-size:1.4em;
|
||||||
}
|
}
|
||||||
.features .dependencies {
|
.features .dependencies {
|
||||||
@@ -52,7 +57,7 @@
|
|||||||
}
|
}
|
||||||
.features .dependencies li {
|
.features .dependencies li {
|
||||||
display:inline;
|
display:inline;
|
||||||
margin-left:.5ex;
|
margin-left:.5em;
|
||||||
}
|
}
|
||||||
.features .dependencies li::after {
|
.features .dependencies li::after {
|
||||||
content:", ";
|
content:", ";
|
||||||
@@ -62,6 +67,19 @@
|
|||||||
}
|
}
|
||||||
.features .feature .actions {
|
.features .feature .actions {
|
||||||
position:absolute;
|
position:absolute;
|
||||||
right:.8em;
|
right:.4em;
|
||||||
top:.6em;
|
top:.6em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cathedral {
|
||||||
|
bottom:0;
|
||||||
|
font-size:.8em;
|
||||||
|
position:absolute;
|
||||||
|
right:3px;
|
||||||
|
}
|
||||||
|
.cathedral a,
|
||||||
|
.cathedral a:link,
|
||||||
|
.cathedral a:visited,
|
||||||
|
.cathedral form.inline.link button {
|
||||||
|
color:#aeaeae;
|
||||||
|
}
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Orchard.MultiTenancy:
|
Orchard.MultiTenancy:
|
||||||
Description: Configure multiple site tenants.
|
Description: Configure multiple site tenants.
|
||||||
Dependencies: Common
|
Category: Hosting
|
||||||
Category: Core
|
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Orchard.Pages:
|
Orchard.Pages:
|
||||||
Description: Simple pages.
|
Description: Simple pages.
|
||||||
Dependencies: Common
|
|
||||||
Category: Content
|
Category: Content
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Orchard.Roles:
|
Orchard.Roles:
|
||||||
Description: Standard user roles.
|
Description: Standard user roles.
|
||||||
Dependencies: Common
|
|
||||||
Category: Core
|
Category: Core
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Orchard.Sandbox:
|
Orchard.Sandbox:
|
||||||
Description: A module to mess around with. Currently wiki-like.
|
Description: A module to mess around with. Currently wiki-like.
|
||||||
Dependencies: Common
|
|
||||||
Category: Developer
|
Category: Developer
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Orchard.Setup:
|
Orchard.Setup:
|
||||||
Description: Standard site setup.
|
Description: Standard site setup.
|
||||||
Dependencies: Common
|
|
||||||
Category: Core
|
Category: Core
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Orchard.Tags:
|
Orchard.Tags:
|
||||||
Description: Tag a content item.
|
Description: Tag a content item.
|
||||||
Dependencies: Common
|
|
||||||
Category: Navigation
|
Category: Navigation
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Orchard.Themes:
|
Orchard.Themes:
|
||||||
Description: Basic theming capability.
|
Description: Basic theming capability.
|
||||||
Dependencies: Common
|
|
||||||
Category: Display
|
Category: Display
|
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
|||||||
features:
|
features:
|
||||||
Orchard.Users:
|
Orchard.Users:
|
||||||
Description: Standard users.
|
Description: Standard users.
|
||||||
Dependencies: Common
|
|
||||||
Category: Core
|
Category: Core
|
@@ -337,8 +337,8 @@ span.message {
|
|||||||
color:#fff;
|
color:#fff;
|
||||||
}
|
}
|
||||||
.info.message {
|
.info.message {
|
||||||
background:#D1F2A5; /* green*/
|
background:#e6f1c9; /* green */
|
||||||
border:1px solid #BCD994;
|
border:1px solid #cfe493;
|
||||||
color:#062232;
|
color:#062232;
|
||||||
}
|
}
|
||||||
.debug.message {
|
.debug.message {
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using Orchard.Environment.Extensions.Models;
|
|
||||||
|
|
||||||
namespace Orchard.Modules {
|
namespace Orchard.Modules {
|
||||||
public interface IModuleService : IDependency {
|
public interface IModuleService : IDependency {
|
||||||
@@ -8,9 +7,10 @@ namespace Orchard.Modules {
|
|||||||
IEnumerable<IModule> GetInstalledModules();
|
IEnumerable<IModule> GetInstalledModules();
|
||||||
void InstallModule(HttpPostedFileBase file);
|
void InstallModule(HttpPostedFileBase file);
|
||||||
void UninstallModule(string moduleName);
|
void UninstallModule(string moduleName);
|
||||||
IModule GetModuleByFeatureName(string featureName);
|
|
||||||
IEnumerable<IModuleFeature> GetAvailableFeatures();
|
IEnumerable<IModuleFeature> GetAvailableFeatures();
|
||||||
void EnableFeatures(IEnumerable<string> featureNames);
|
void EnableFeatures(IEnumerable<string> featureNames);
|
||||||
|
void EnableFeatures(IEnumerable<string> featureNames, bool force);
|
||||||
void DisableFeatures(IEnumerable<string> featureNames);
|
void DisableFeatures(IEnumerable<string> featureNames);
|
||||||
|
void DisableFeatures(IEnumerable<string> featureNames, bool force);
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user