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:
|
||||
Futures.Widgets:
|
||||
Description: Widgets container with simple inline content editing widget.
|
||||
Dependencies: Common
|
||||
Category: Widget
|
||||
@@ -7,5 +7,8 @@ orchardversion: 0.1.2010.0312
|
||||
features:
|
||||
Orchard.Blogs:
|
||||
Description: A simple web log.
|
||||
Dependencies: Common, XmlRpc
|
||||
Category: Content
|
||||
Category: Content
|
||||
Remote Blog Publishing:
|
||||
Description: Blog easier using a dedicated MetaWeblogAPI-compatible publishing tool.
|
||||
Dependencies: XmlRpc
|
||||
Category: Content Publishing
|
||||
@@ -8,6 +8,7 @@ using Orchard.Blogs.Models;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.XmlRpc;
|
||||
using Orchard.Core.XmlRpc.Models;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Mvc.Extensions;
|
||||
using Orchard.Security;
|
||||
@@ -15,6 +16,7 @@ using Orchard.Blogs.Extensions;
|
||||
|
||||
namespace Orchard.Blogs.Services {
|
||||
[UsedImplicitly]
|
||||
[OrchardFeature("Remote Blog Publishing")]
|
||||
public class XmlRpcHandler : IXmlRpcHandler {
|
||||
private readonly IBlogService _blogService;
|
||||
private readonly IBlogPostService _blogPostService;
|
||||
|
||||
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
||||
features:
|
||||
Orchard.Comments:
|
||||
Description: Standard content item comments.
|
||||
Dependencies: Common
|
||||
Category: Social
|
||||
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
||||
features:
|
||||
Orchard.DevTools:
|
||||
Description: An assortment of debuging tools.
|
||||
Dependencies: Common
|
||||
Category: Developer
|
||||
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
||||
features:
|
||||
Orchard.Media:
|
||||
Description: File system based media upload, storage and management.
|
||||
Dependencies: Common
|
||||
Category: Media
|
||||
@@ -1,11 +1,8 @@
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Modules.ViewModels;
|
||||
using Orchard.Mvc.AntiForgery;
|
||||
using Orchard.Mvc.Results;
|
||||
using Orchard.UI.Notify;
|
||||
|
||||
namespace Orchard.Modules.Controllers {
|
||||
public class AdminController : Controller {
|
||||
@@ -28,20 +25,6 @@ namespace Orchard.Modules.Controllers {
|
||||
return View(new ModulesIndexViewModel {Modules = modules});
|
||||
}
|
||||
|
||||
public ActionResult Edit(string id) {
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageModules, T("Not allowed to edit module")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
var module = _moduleService.GetModuleByName(id);
|
||||
|
||||
if (module == null)
|
||||
return new NotFoundResult();
|
||||
|
||||
return View(new ModuleEditViewModel {
|
||||
Name = module.DisplayName
|
||||
});
|
||||
}
|
||||
|
||||
public ActionResult Features() {
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageFeatures, T("Not allowed to manage features")))
|
||||
return new HttpUnauthorizedResult();
|
||||
@@ -50,45 +33,30 @@ namespace Orchard.Modules.Controllers {
|
||||
return View(new FeaturesViewModel {Features = features});
|
||||
}
|
||||
|
||||
[ValidateAntiForgeryTokenOrchard]
|
||||
public ActionResult Enable(string id) {
|
||||
[HttpPost]
|
||||
public ActionResult Enable(string id, bool? force) {
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageFeatures, T("Not allowed to manage features")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
if (string.IsNullOrEmpty(id))
|
||||
return new NotFoundResult();
|
||||
|
||||
_moduleService.EnableFeatures(new [] {id});
|
||||
Services.Notifier.Information(T("{0} was enabled", id));
|
||||
_moduleService.EnableFeatures(new[] {id}, force != null && (bool) force);
|
||||
|
||||
return RedirectToAction("Features");
|
||||
}
|
||||
|
||||
[ValidateAntiForgeryTokenOrchard]
|
||||
public ActionResult Disable(string id) {
|
||||
[HttpPost]
|
||||
public ActionResult Disable(string id, bool? force) {
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageFeatures, T("Not allowed to manage features")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
if (string.IsNullOrEmpty(id))
|
||||
return new NotFoundResult();
|
||||
|
||||
_moduleService.DisableFeatures(new[] { id });
|
||||
//Services.Notifier.Information(T("{0} was disabled", featureName));
|
||||
_moduleService.DisableFeatures(new[] {id}, force != null && (bool) force);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Utility.Extensions;
|
||||
|
||||
namespace Orchard.Modules.Extensions {
|
||||
public static class StringExtensions {
|
||||
public static string AsFeatureId(this string text, Func<string, LocalizedString> localize) {
|
||||
return string.IsNullOrEmpty(text)
|
||||
? ""
|
||||
: string.Format(localize("{0} feature").ToString(), text).HtmlClassify();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
||||
features:
|
||||
Orchard.Modules:
|
||||
Description: Standard module and feature management.
|
||||
Dependencies: Common
|
||||
Category: Core
|
||||
@@ -64,6 +64,7 @@
|
||||
<Compile Include="AdminMenu.cs" />
|
||||
<Compile Include="Commands\FeatureCommand.cs" />
|
||||
<Compile Include="Controllers\AdminController.cs" />
|
||||
<Compile Include="Extensions\StringExtensions.cs" />
|
||||
<Compile Include="Models\ModuleFeature.cs" />
|
||||
<Compile Include="ViewModels\FeaturesViewModel.cs" />
|
||||
<Compile Include="Models\Module.cs" />
|
||||
@@ -89,7 +90,6 @@
|
||||
<Content Include="Content\Admin\images\enabled.gif" />
|
||||
<Content Include="styles\admin.css" />
|
||||
<Content Include="Views\Admin\Features.ascx" />
|
||||
<Content Include="Views\Admin\Edit.ascx" />
|
||||
<Content Include="Views\Web.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
|
||||
@@ -6,7 +6,9 @@ using Orchard.Environment.Extensions;
|
||||
using Orchard.Environment.Extensions.Models;
|
||||
using Orchard.Environment.Topology;
|
||||
using Orchard.Environment.Topology.Models;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Modules.Models;
|
||||
using Orchard.UI.Notify;
|
||||
|
||||
namespace Orchard.Modules.Services {
|
||||
public class ModuleService : IModuleService {
|
||||
@@ -14,21 +16,32 @@ namespace Orchard.Modules.Services {
|
||||
private readonly IExtensionManager _extensionManager;
|
||||
private readonly IShellDescriptorManager _shellDescriptorManager;
|
||||
|
||||
public ModuleService(IExtensionManager extensionManager, IShellDescriptorManager shellDescriptorManager) {
|
||||
public ModuleService(IOrchardServices orchardServices, IExtensionManager extensionManager,
|
||||
IShellDescriptorManager shellDescriptorManager) {
|
||||
Services = orchardServices;
|
||||
_extensionManager = extensionManager;
|
||||
_shellDescriptorManager = shellDescriptorManager;
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
private Localizer T { get; set; }
|
||||
public IOrchardServices Services { get; set; }
|
||||
|
||||
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(
|
||||
descriptor => AssembleModuleFromDescriptor(descriptor)).FirstOrDefault();
|
||||
return
|
||||
_extensionManager.AvailableExtensions().Where(
|
||||
e =>
|
||||
string.Equals(e.Name, moduleName, StringComparison.OrdinalIgnoreCase) &&
|
||||
string.Equals(e.ExtensionType, ModuleExtensionType, StringComparison.OrdinalIgnoreCase)).Select(
|
||||
descriptor => AssembleModuleFromDescriptor(descriptor)).FirstOrDefault();
|
||||
}
|
||||
|
||||
public IEnumerable<IModule> GetInstalledModules() {
|
||||
return
|
||||
_extensionManager.AvailableExtensions().Where(
|
||||
e => String.Equals(e.ExtensionType, ModuleExtensionType, StringComparison.OrdinalIgnoreCase)).Select(
|
||||
descriptor => AssembleModuleFromDescriptor(descriptor));
|
||||
e => String.Equals(e.ExtensionType, ModuleExtensionType, StringComparison.OrdinalIgnoreCase)).Select
|
||||
(
|
||||
descriptor => AssembleModuleFromDescriptor(descriptor));
|
||||
}
|
||||
|
||||
public void InstallModule(HttpPostedFileBase file) {
|
||||
@@ -39,52 +52,145 @@ namespace Orchard.Modules.Services {
|
||||
_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() {
|
||||
var enabledFeatures = _shellDescriptorManager.GetShellDescriptor().EnabledFeatures;
|
||||
return GetInstalledModules()
|
||||
.SelectMany(m => _extensionManager.LoadFeatures(m.Features))
|
||||
.Select(f => AssembleModuleFromDescriptor(f, enabledFeatures.FirstOrDefault(sf => string.Equals(sf.Name, f.Descriptor.Name, StringComparison.OrdinalIgnoreCase)) != null));
|
||||
}
|
||||
|
||||
public IEnumerable<Feature> GetAvailableFeaturesByModule(string moduleName) {
|
||||
throw new NotImplementedException();
|
||||
.Select(
|
||||
f =>
|
||||
AssembleModuleFromDescriptor(f,
|
||||
enabledFeatures.FirstOrDefault(
|
||||
sf =>
|
||||
string.Equals(sf.Name, f.Descriptor.Name,
|
||||
StringComparison.OrdinalIgnoreCase)) != null));
|
||||
}
|
||||
|
||||
public void EnableFeatures(IEnumerable<string> featureNames) {
|
||||
EnableFeatures(featureNames, false);
|
||||
}
|
||||
|
||||
public void EnableFeatures(IEnumerable<string> features, bool force) {
|
||||
var shellDescriptor = _shellDescriptorManager.GetShellDescriptor();
|
||||
var enabledFeatures = shellDescriptor.EnabledFeatures.ToList();
|
||||
|
||||
var enabledFeatures = shellDescriptor.EnabledFeatures
|
||||
.Union(featureNames.Select(s => new ShellFeature {Name = s}));
|
||||
var featuresToEnable =
|
||||
features.Select(s => EnableFeature(s, GetAvailableFeatures(), force)).
|
||||
SelectMany(ies => ies.Select(s => s));
|
||||
|
||||
_shellDescriptorManager.UpdateShellDescriptor(shellDescriptor.SerialNumber, enabledFeatures, shellDescriptor.Parameters);
|
||||
if (featuresToEnable.Count() == 0)
|
||||
return;
|
||||
|
||||
foreach (var featureToEnable in featuresToEnable) {
|
||||
enabledFeatures.Add(new ShellFeature {Name = featureToEnable});
|
||||
Services.Notifier.Information(T("{0} was enabled", featureToEnable));
|
||||
}
|
||||
|
||||
_shellDescriptorManager.UpdateShellDescriptor(shellDescriptor.SerialNumber, enabledFeatures,
|
||||
shellDescriptor.Parameters);
|
||||
}
|
||||
|
||||
public void DisableFeatures(IEnumerable<string> featureNames) {
|
||||
DisableFeatures(featureNames, false);
|
||||
}
|
||||
|
||||
public void DisableFeatures(IEnumerable<string> features, bool force) {
|
||||
var shellDescriptor = _shellDescriptorManager.GetShellDescriptor();
|
||||
var enabledFeatures = shellDescriptor.EnabledFeatures.ToList();
|
||||
var features = GetAvailableFeatures().ToList();
|
||||
|
||||
foreach (var featureName in featureNames) {
|
||||
var feature = featureName;
|
||||
var dependants = features.Where(f => f.IsEnabled && f.Descriptor.Dependencies != null && f.Descriptor.Dependencies.Contains(feature));
|
||||
var featuresToDisable =
|
||||
features.Select(s => DisableFeature(s, GetAvailableFeatures(), force)).SelectMany(
|
||||
ies => ies.Select(s => s));
|
||||
|
||||
if (dependants.Count() == 0) {
|
||||
enabledFeatures.RemoveAll(f => f.Name == feature);
|
||||
}
|
||||
else {
|
||||
// list what else will be disabled with ok/cancel
|
||||
}
|
||||
if (featuresToDisable.Count() == 0)
|
||||
return;
|
||||
|
||||
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);
|
||||
_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,
|
||||
featuresToEnable.Where(fn => fn != featureName));
|
||||
return Enumerable.Empty<string>();
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ModuleEditViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||
<%@ Import Namespace="Orchard.Modules.ViewModels"%>
|
||||
<h1><%=Html.TitleForPage(T("Edit Module: {0}", Model.Name).ToString()) %></h1>
|
||||
<p><%=_Encoded("Edit the module. Maybe show module's features.") %></p>
|
||||
@@ -1,4 +1,5 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<FeaturesViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Modules.Extensions" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||
<%@ Import Namespace="Orchard.Modules.ViewModels"%>
|
||||
<%@ Import Namespace="Orchard.Utility.Extensions" %><%
|
||||
@@ -13,14 +14,17 @@
|
||||
if (featureGroup == featureGroups.First())
|
||||
categoryClassName += " first";
|
||||
if (featureGroup == featureGroups.Last())
|
||||
categoryClassName += " last"; %>
|
||||
categoryClassName += " last";
|
||||
|
||||
//temporarily "disable" actions on core features
|
||||
var showActions = categoryName.ToString() != "Core"; %>
|
||||
<li class="<%=categoryClassName %>">
|
||||
<h2><%=Html.Encode(categoryName) %></h2>
|
||||
<ul><%
|
||||
var features = featureGroup.OrderBy(f => f.Descriptor.Name);
|
||||
foreach (var feature in features) {
|
||||
//hmmm...I feel like I've done this before...
|
||||
var featureId = string.Format("{0} feature", feature.Descriptor.Name).HtmlClassify();
|
||||
var featureId = feature.Descriptor.Name.AsFeatureId(n => T(n));
|
||||
var featureState = feature.IsEnabled ? "enabled" : "disabled";
|
||||
var featureClassName = string.Format("feature {0}", featureState);
|
||||
if (feature == features.First())
|
||||
@@ -36,26 +40,30 @@
|
||||
<h4><%=_Encoded("Depends on:")%></h4>
|
||||
<%=Html.UnorderedList(
|
||||
feature.Descriptor.Dependencies.OrderBy(s => s),
|
||||
(s, i) => Html.Link(s, string.Format("#{0}", string.Format("{0} feature", s).HtmlClassify())),
|
||||
(s, i) => Html.Link(s, string.Format("#{0}", s.AsFeatureId(n => T(n)))),
|
||||
"",
|
||||
"dependency",
|
||||
"") %>
|
||||
</div><%
|
||||
} %>
|
||||
</div>
|
||||
</div><%
|
||||
if (showActions) { %>
|
||||
<div class="actions"><%
|
||||
if (feature.IsEnabled) {
|
||||
using (Html.BeginFormAntiForgeryPost(string.Format("{0}#{1}", Url.Action("Disable", new { area = "Orchard.Modules" }), featureId), 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"})) { %>
|
||||
<%=Html.Hidden("id", feature.Descriptor.Name, new { id = "" })%>
|
||||
<%=Html.Hidden("force", true)%>
|
||||
<button type="submit"><%=_Encoded("Disable") %></button><%
|
||||
}
|
||||
} else {
|
||||
using (Html.BeginFormAntiForgeryPost(string.Format("{0}#{1}", Url.Action("Enable", new { area = "Orchard.Modules" }), featureId), FormMethod.Post, new {@class = "inline link"})) { %>
|
||||
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("Enable") %></button><%
|
||||
}
|
||||
} %>
|
||||
</div>
|
||||
</div><%
|
||||
} %>
|
||||
</div>
|
||||
</li><%
|
||||
} %>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ModulesIndexViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Modules.Extensions" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||
<%@ Import Namespace="Orchard.Modules.ViewModels"%>
|
||||
<h1><%=Html.TitleForPage(T("Installed Modules").ToString()) %></h1>
|
||||
@@ -14,15 +15,11 @@
|
||||
<h3><%=Html.Encode(module.DisplayName) %></h3>
|
||||
<ul class="pageStatus" style="color:#666">
|
||||
<li><%=T("Version: {0}", !string.IsNullOrEmpty(module.Version) ? Html.Encode(module.Version) : T("1.0")) %></li>
|
||||
<li> | <%=T("Features: {0}", string.Join(", ", module.Features.Select(f => Html.Link(Html.Encode(f.Name), string.Format("{0}#{1}", Url.Action("features", new { area = "Orchard.Modules" }), Html.Encode(f.Name)) )).OrderBy(s => s).ToArray())) %></li>
|
||||
<li> | <%=T("Features: {0}", string.Join(", ", module.Features.Select(f => Html.Link(Html.Encode(f.Name), string.Format("{0}#{1}", Url.Action("features", new { area = "Orchard.Modules" }), f.Name.AsFeatureId(n => T(n))) )).OrderBy(s => s).ToArray())) %></li>
|
||||
<li> | <%=T("Author: {0}", !string.IsNullOrEmpty(module.Author) ? Html.Encode(module.Author) : (new []{"Bradley", "Bertrand", "Renaud", "Suha", "Sebastien", "Jon", "Nathan", "Erik"})[(module.DisplayName.Length + (new Random()).Next()) % 7]) %></li><%-- very efficient, I know --%>
|
||||
<li> | <%=T("Website: {0}", !string.IsNullOrEmpty(module.HomePage) ? Html.Encode(module.HomePage) : T("<a href=\"http://orchardproject.net\">http://orchardproject.net</a>"))%></li>
|
||||
</ul>
|
||||
</div>
|
||||
<%--<div class="related">
|
||||
<%=Html.ActionLink(T("Edit").ToString(), "edit", new {moduleName = module.ModuleName, area = "Orchard.Modules"}) %><%=_Encoded(" | ")%>
|
||||
<a href="#">Delete</a>
|
||||
</div>--%>
|
||||
</div><%
|
||||
if (!string.IsNullOrEmpty(module.Description)) { %>
|
||||
<p><%=Html.Encode(module.Description) %></p><%
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
.features .category {
|
||||
.orchard-modules #main h2 {
|
||||
border:0;
|
||||
margin-bottom:.2em;
|
||||
}
|
||||
|
||||
.features .category {
|
||||
overflow:hidden;
|
||||
}
|
||||
.features .feature {
|
||||
border:1px solid #EAEAEA;
|
||||
-moz-border-radius:3px;
|
||||
-webkit-border-radius:3px;
|
||||
display:block;
|
||||
float:left;
|
||||
height:10em;
|
||||
height:5em;
|
||||
margin:0 .5% 1% .5%;
|
||||
position:relative;
|
||||
width:32.1%;
|
||||
}
|
||||
.features .feature:nth-child(3n+1),
|
||||
@@ -29,10 +33,53 @@
|
||||
}
|
||||
|
||||
.features .enabled.feature {
|
||||
background:#D1F2A5;
|
||||
border-color:#BCD994;
|
||||
background:#FFF;
|
||||
border-color:#CFE493;cfe493
|
||||
}
|
||||
.features .disabled.feature {
|
||||
background:#EAEAEA;
|
||||
border-color:#CCC;
|
||||
}
|
||||
.features .feature .summary {
|
||||
overflow:hidden;
|
||||
padding:.4em .5em;
|
||||
}
|
||||
.features .dependencies li,
|
||||
.features .actions {
|
||||
font-size:1.4em;
|
||||
}
|
||||
.features .dependencies {
|
||||
font-size:.9em;
|
||||
margin:.44em 0 0;
|
||||
}
|
||||
.features .dependencies>* {
|
||||
display:inline;
|
||||
}
|
||||
.features .dependencies li {
|
||||
display:inline;
|
||||
margin-left:.5em;
|
||||
}
|
||||
.features .dependencies li::after {
|
||||
content:", ";
|
||||
}
|
||||
.features .dependencies li:last-child::after {
|
||||
content:"";
|
||||
}
|
||||
.features .feature .actions {
|
||||
position:absolute;
|
||||
right:.4em;
|
||||
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:
|
||||
Orchard.MultiTenancy:
|
||||
Description: Configure multiple site tenants.
|
||||
Dependencies: Common
|
||||
Category: Core
|
||||
Category: Hosting
|
||||
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
||||
features:
|
||||
Orchard.Pages:
|
||||
Description: Simple pages.
|
||||
Dependencies: Common
|
||||
Category: Content
|
||||
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
||||
features:
|
||||
Orchard.Roles:
|
||||
Description: Standard user roles.
|
||||
Dependencies: Common
|
||||
Category: Core
|
||||
@@ -84,6 +84,8 @@ namespace Orchard.Roles.Services {
|
||||
|
||||
context.Adjusted = false;
|
||||
_authorizationServiceEventHandler.Adjust(context);
|
||||
if (!context.Adjusted)
|
||||
break;
|
||||
}
|
||||
|
||||
_authorizationServiceEventHandler.Complete(context);
|
||||
|
||||
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
||||
features:
|
||||
Orchard.Sandbox:
|
||||
Description: A module to mess around with. Currently wiki-like.
|
||||
Dependencies: Common
|
||||
Category: Developer
|
||||
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
||||
features:
|
||||
Orchard.Setup:
|
||||
Description: Standard site setup.
|
||||
Dependencies: Common
|
||||
Category: Core
|
||||
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
||||
features:
|
||||
Orchard.Tags:
|
||||
Description: Tag a content item.
|
||||
Dependencies: Common
|
||||
Category: Navigation
|
||||
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
||||
features:
|
||||
Orchard.Themes:
|
||||
Description: Basic theming capability.
|
||||
Dependencies: Common
|
||||
Category: Display
|
||||
@@ -7,5 +7,4 @@ orchardversion: 0.1.2010.0312
|
||||
features:
|
||||
Orchard.Users:
|
||||
Description: Standard users.
|
||||
Dependencies: Common
|
||||
Category: Core
|
||||
Reference in New Issue
Block a user