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:
@@ -86,7 +86,7 @@ namespace Orchard.Core.Settings.Topology {
|
||||
}
|
||||
|
||||
_eventBus.Notify(
|
||||
typeof(IShellDescriptorManager).FullName + ".UpdateShellDescriptor",
|
||||
"ShellDescriptor_Changed",
|
||||
null);
|
||||
}
|
||||
}
|
||||
|
@@ -1,2 +1,7 @@
|
||||
name: Blogs
|
||||
antiforgery: enabled
|
||||
antiforgery: enabled
|
||||
features:
|
||||
Orchard.Blogs:
|
||||
Description: A simple web log
|
||||
Dependencies: Common, XmlRpc
|
||||
Category: Blog
|
@@ -5,12 +5,12 @@ namespace Orchard.Modules {
|
||||
public string MenuName { get { return "admin"; } }
|
||||
|
||||
public void GetNavigation(NavigationBuilder builder) {
|
||||
builder.Add("Modules", "10",
|
||||
builder.Add("Features", "10",
|
||||
menu => menu
|
||||
.Add("Manage Modules", "1.0", item => item.Action("Index", "Admin", new { area = "Orchard.Modules" })
|
||||
.Permission(Permissions.ManageModules))
|
||||
.Add("Manage Features", "2.0", item => item.Action("Features", "Admin", new { area = "Orchard.Modules" })
|
||||
.Permission(Permissions.ManageFeatures)));
|
||||
.Add("Manage Features", "1.0", item => item.Action("Features", "Admin", new { area = "Orchard.Modules" })
|
||||
.Permission(Permissions.ManageFeatures))
|
||||
.Add("Manage Modules", "2.0", item => item.Action("Index", "Admin", new { area = "Orchard.Modules" })
|
||||
.Permission(Permissions.ManageModules)));
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 603 B |
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
@@ -1,8 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
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 {
|
||||
@@ -39,12 +44,85 @@ namespace Orchard.Modules.Controllers {
|
||||
});
|
||||
}
|
||||
|
||||
public ActionResult Features() {
|
||||
public ActionResult Features(FeaturesOptions options) {
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageFeatures, T("Not allowed to manage features")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
var features = _moduleService.GetAvailableFeatures();
|
||||
return View(new FeatureListViewModel {Features = features});
|
||||
return View(new FeaturesViewModel {Features = features, Options = options});
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("Features")]
|
||||
[FormValueRequired("submit.BulkEdit")]
|
||||
public ActionResult FeaturesPOST(FeaturesOptions options, IList<string> selection) {
|
||||
if (selection != null && selection.Count > 0)
|
||||
{
|
||||
switch (options.BulkAction)
|
||||
{
|
||||
case FeaturesBulkAction.None:
|
||||
break;
|
||||
case FeaturesBulkAction.Enable:
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageFeatures, T("Not allowed to enable features")))
|
||||
return new HttpUnauthorizedResult();
|
||||
_moduleService.EnableFeatures(selection);
|
||||
//todo: (heskew) need better messages
|
||||
//todo: (heskew) hmmm...need a helper to comma-separate all but last, which would get the " and " treatment...all localized, of course
|
||||
Services.Notifier.Information(T("{0} were enabled", string.Join(", ", selection.ToArray())));
|
||||
break;
|
||||
case FeaturesBulkAction.Disable:
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageFeatures, T("Not allowed to disable features")))
|
||||
return new HttpUnauthorizedResult();
|
||||
_moduleService.DisableFeatures(selection);
|
||||
//todo: (heskew) need better messages
|
||||
Services.Notifier.Information(T("{0} were disabled", string.Join(", ", selection.ToArray())));
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
}
|
||||
|
||||
return RedirectToAction("Features");
|
||||
}
|
||||
|
||||
[ValidateAntiForgeryTokenOrchard]
|
||||
public ActionResult Enable(string featureName) {
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageFeatures, T("Not allowed to manage features")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
if (string.IsNullOrEmpty(featureName))
|
||||
return new NotFoundResult();
|
||||
|
||||
_moduleService.EnableFeatures(new [] {featureName});
|
||||
Services.Notifier.Information(T("{0} was enabled", featureName));
|
||||
|
||||
return RedirectToAction("Features");
|
||||
}
|
||||
|
||||
[ValidateAntiForgeryTokenOrchard]
|
||||
public ActionResult Disable(string featureName) {
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageFeatures, T("Not allowed to manage features")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
if (string.IsNullOrEmpty(featureName))
|
||||
return new NotFoundResult();
|
||||
|
||||
_moduleService.DisableFeatures(new[] { featureName });
|
||||
Services.Notifier.Information(T("{0} was disabled", featureName));
|
||||
|
||||
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,8 @@
|
||||
using Orchard.Environment.Extensions.Models;
|
||||
|
||||
namespace Orchard.Modules.Models {
|
||||
public class ModuleFeature : IModuleFeature {
|
||||
public FeatureDescriptor Descriptor { get; set; }
|
||||
public bool IsEnabled { get; set; }
|
||||
}
|
||||
}
|
@@ -63,7 +63,9 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="AdminMenu.cs" />
|
||||
<Compile Include="Controllers\AdminController.cs" />
|
||||
<Compile Include="ViewModels\FeatureListViewModel.cs" />
|
||||
<Compile Include="Models\ModuleFeature.cs" />
|
||||
<Compile Include="Routing\FeatureNameConstraint.cs" />
|
||||
<Compile Include="ViewModels\FeaturesViewModel.cs" />
|
||||
<Compile Include="Models\Module.cs" />
|
||||
<Compile Include="Permissions.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
@@ -85,6 +87,8 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Content\Admin\images\disabled.gif" />
|
||||
<Content Include="Content\Admin\images\enabled.gif" />
|
||||
<Content Include="Views\Admin\Features.ascx" />
|
||||
<Content Include="Views\Admin\Edit.ascx" />
|
||||
<Content Include="Views\Web.config" />
|
||||
|
@@ -7,9 +7,11 @@ using Orchard.Mvc.Routes;
|
||||
namespace Orchard.Modules {
|
||||
public class Routes : IRouteProvider {
|
||||
private readonly IModuleNameConstraint _moduleNameConstraint;
|
||||
private readonly IFeatureNameConstraint _featureNameConstraint;
|
||||
|
||||
public Routes(IModuleNameConstraint moduleNameConstraint) {
|
||||
public Routes(IModuleNameConstraint moduleNameConstraint, IFeatureNameConstraint featureNameConstraint) {
|
||||
_moduleNameConstraint = moduleNameConstraint;
|
||||
_featureNameConstraint = featureNameConstraint;
|
||||
}
|
||||
|
||||
public IEnumerable<RouteDescriptor> GetRoutes() {
|
||||
@@ -29,6 +31,38 @@ namespace Orchard.Modules {
|
||||
{"area", "Orchard.Modules"}
|
||||
},
|
||||
new MvcRouteHandler())
|
||||
},
|
||||
new RouteDescriptor {
|
||||
Route = new Route(
|
||||
"Admin/Modules/Enable/{featureName}",
|
||||
new RouteValueDictionary {
|
||||
{"area", "Orchard.Modules"},
|
||||
{"controller", "Admin"},
|
||||
{"action", "Enable"}
|
||||
},
|
||||
new RouteValueDictionary {
|
||||
{"featureName", _featureNameConstraint}
|
||||
},
|
||||
new RouteValueDictionary {
|
||||
{"area", "Orchard.Modules"}
|
||||
},
|
||||
new MvcRouteHandler())
|
||||
},
|
||||
new RouteDescriptor {
|
||||
Route = new Route(
|
||||
"Admin/Modules/Disable/{featureName}",
|
||||
new RouteValueDictionary {
|
||||
{"area", "Orchard.Modules"},
|
||||
{"controller", "Admin"},
|
||||
{"action", "Disable"}
|
||||
},
|
||||
new RouteValueDictionary {
|
||||
{"featureName", _featureNameConstraint}
|
||||
},
|
||||
new RouteValueDictionary {
|
||||
{"area", "Orchard.Modules"}
|
||||
},
|
||||
new MvcRouteHandler())
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace Orchard.Modules.Routing {
|
||||
public interface IFeatureNameConstraint : IRouteConstraint, ISingletonDependency {
|
||||
}
|
||||
|
||||
public class FeatureNameConstraint : IFeatureNameConstraint {
|
||||
private readonly IModuleService _moduleService;
|
||||
|
||||
public FeatureNameConstraint(IModuleService moduleService) {
|
||||
_moduleService = moduleService;
|
||||
}
|
||||
|
||||
public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection) {
|
||||
if (routeDirection == RouteDirection.UrlGeneration)
|
||||
return true;
|
||||
|
||||
object value;
|
||||
if (values.TryGetValue(parameterName, out value))
|
||||
return _moduleService.GetModuleByFeatureName(Convert.ToString(value)) != null;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@@ -4,19 +4,23 @@ using System.Linq;
|
||||
using System.Web;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Environment.Extensions.Models;
|
||||
using Orchard.Environment.Topology;
|
||||
using Orchard.Environment.Topology.Models;
|
||||
using Orchard.Modules.Models;
|
||||
|
||||
namespace Orchard.Modules.Services {
|
||||
public class ModuleService : IModuleService {
|
||||
private const string ModuleExtensionType = "module";
|
||||
private readonly IExtensionManager _extensionManager;
|
||||
private readonly IShellDescriptorManager _shellDescriptorManager;
|
||||
|
||||
public ModuleService(IExtensionManager extensionManager) {
|
||||
public ModuleService(IExtensionManager extensionManager, IShellDescriptorManager shellDescriptorManager) {
|
||||
_extensionManager = extensionManager;
|
||||
_shellDescriptorManager = shellDescriptorManager;
|
||||
}
|
||||
|
||||
public IModule GetModuleByName(string moduleName) {
|
||||
return _extensionManager.AvailableExtensions().Where(e => string.Equals(e.Name, moduleName, StringComparison.OrdinalIgnoreCase) && string.Equals(e.ExtensionType, "Module", 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();
|
||||
}
|
||||
|
||||
@@ -35,24 +39,41 @@ namespace Orchard.Modules.Services {
|
||||
_extensionManager.UninstallExtension(ModuleExtensionType, moduleName);
|
||||
}
|
||||
|
||||
public IEnumerable<Feature> GetAvailableFeatures() {
|
||||
public IModule GetModuleByFeatureName(string featureName) {
|
||||
return GetInstalledModules()
|
||||
.Where(m => m.Features != null)
|
||||
.SelectMany(m => _extensionManager.LoadFeatures(m.Features));
|
||||
.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) {
|
||||
var module = GetModuleByName(moduleName);
|
||||
if (module == null || module.Features == null)
|
||||
return null;
|
||||
|
||||
return _extensionManager.LoadFeatures(module.Features);
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void EnableFeatures(IEnumerable<string> featureNames) {
|
||||
var shellDescriptor = _shellDescriptorManager.GetShellDescriptor();
|
||||
|
||||
var enabledFeatures = shellDescriptor.EnabledFeatures
|
||||
.Union(featureNames.Select(s => new ShellFeature {Name = s}));
|
||||
|
||||
_shellDescriptorManager.UpdateShellDescriptor(shellDescriptor.SerialNumber, enabledFeatures, shellDescriptor.Parameters);
|
||||
}
|
||||
|
||||
public void DisableFeatures(IEnumerable<string> featureNames) {
|
||||
var shellDescriptor = _shellDescriptorManager.GetShellDescriptor();
|
||||
|
||||
var enabledFeatures = shellDescriptor.EnabledFeatures.ToList();
|
||||
enabledFeatures.RemoveAll(f => featureNames.Contains(f.Name));
|
||||
|
||||
_shellDescriptorManager.UpdateShellDescriptor(shellDescriptor.SerialNumber, enabledFeatures, shellDescriptor.Parameters);
|
||||
}
|
||||
|
||||
private static IModule AssembleModuleFromDescriptor(ExtensionDescriptor extensionDescriptor) {
|
||||
@@ -67,5 +88,12 @@ namespace Orchard.Modules.Services {
|
||||
Features = extensionDescriptor.Features
|
||||
};
|
||||
}
|
||||
|
||||
private static IModuleFeature AssembleModuleFromDescriptor(Feature feature, bool isEnabled) {
|
||||
return new ModuleFeature {
|
||||
Descriptor = feature.Descriptor,
|
||||
IsEnabled = isEnabled
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.Environment.Extensions.Models;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
|
||||
namespace Orchard.Modules.ViewModels {
|
||||
public class FeatureListViewModel : BaseViewModel {
|
||||
public IEnumerable<Feature> Features { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
|
||||
namespace Orchard.Modules.ViewModels {
|
||||
public class FeaturesViewModel : BaseViewModel {
|
||||
public IEnumerable<IModuleFeature> Features { get; set; }
|
||||
public FeaturesOptions Options { get; set; }
|
||||
}
|
||||
|
||||
public class FeaturesOptions {
|
||||
public FeaturesBulkAction BulkAction { get; set; }
|
||||
}
|
||||
|
||||
public enum FeaturesBulkAction {
|
||||
None,
|
||||
Enable,
|
||||
Disable
|
||||
}
|
||||
}
|
@@ -1,33 +1,68 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<FeatureListViewModel>" %>
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<FeaturesViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||
<%@ Import Namespace="Orchard.Modules.ViewModels"%>
|
||||
<h1><%=Html.TitleForPage(T("Manage Features").ToString()) %></h1>
|
||||
<h2><%=T("Available Features") %></h2>
|
||||
<% if (Model.Features.Count() > 0) { %>
|
||||
<ul class="contentItems blogs"><%
|
||||
foreach (var featureGroup in Model.Features.OrderBy(f => f.Descriptor.Name).GroupBy(f => f.Descriptor.Category)) { %>
|
||||
<li>
|
||||
<h3><%=Html.Encode(featureGroup.First().Descriptor.Category ?? T("General")) %></h3>
|
||||
<ul><%
|
||||
foreach (var feature in featureGroup.Select(f => f.Descriptor)) {%>
|
||||
<li>
|
||||
<h4><%=Html.Encode(feature.Name) %></h4>
|
||||
<p><%=T("From: {0}", Html.Encode(feature.Extension.DisplayName)) %></p><%
|
||||
if (!string.IsNullOrEmpty(feature.Description)) { %>
|
||||
<p><%=Html.Encode(feature.Description) %></p><%
|
||||
}
|
||||
if (feature.Dependencies.Count() > 0) {%>
|
||||
<h5><%=_Encoded("Depends on:")%></h5>
|
||||
<div class="manage" style="visibility:hidden"><%=Html.ActionLink(T("∞").ToString(), "Features", new { }, new { @class = "button primaryAction" })%></div>
|
||||
<% if (Model.Features.Count() > 0) {
|
||||
|
||||
using (Html.BeginFormAntiForgeryPost()) { %>
|
||||
<%=Html.ValidationSummary()%>
|
||||
<fieldset class="actions bulk">
|
||||
<label for="publishActions"><%=_Encoded("Actions: ")%></label>
|
||||
<select id="publishActions" name="<%=Html.NameOf(m => m.Options.BulkAction) %>">
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, FeaturesBulkAction.None, _Encoded("Choose action...").ToString())%>
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, FeaturesBulkAction.Enable, _Encoded("Enable").ToString())%>
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, FeaturesBulkAction.Disable, _Encoded("Disable").ToString())%>
|
||||
</select>
|
||||
<input class="button" type="submit" name="submit.BulkEdit" value="<%=_Encoded("Apply") %>" />
|
||||
</fieldset>
|
||||
<fieldset class="pageList">
|
||||
<ul class="contentItems"><%
|
||||
foreach (var featureGroup in Model.Features.OrderBy(f => f.Descriptor.Name).GroupBy(f => f.Descriptor.Category)) { %>
|
||||
<li<%=featureGroup == Model.Features.Last() ? " class=\"last\"" : "" %>>
|
||||
<h2><%=Html.Encode(featureGroup.First().Descriptor.Category ?? T("General")) %></h2>
|
||||
<ul><%
|
||||
foreach (var dependency in feature.Dependencies) { %>
|
||||
<li><%=Html.Encode(dependency) %></li><%
|
||||
foreach (var feature in featureGroup) {%>
|
||||
<li<%=feature == featureGroup.Last() ? " class=\"last\"" : "" %>>
|
||||
<div class="summary">
|
||||
<div class="properties">
|
||||
<input type="checkbox" name="selection" value="<%=Html.Encode(feature.Descriptor.Name) %>" />
|
||||
<h3><%=Html.Encode(feature.Descriptor.Name) %></h3>
|
||||
<ul class="pageStatus">
|
||||
<li><%
|
||||
//enabled or not
|
||||
if (feature.IsEnabled) { %>
|
||||
<img class="icon" src="<%=ResolveUrl("~/Modules/Orchard.Modules/Content/Admin/images/enabled.gif") %>" alt="<%=_Encoded("Enabled") %>" title="<%=_Encoded("This feature is currently enabled") %>" /><%=_Encoded("Enabled") %><%
|
||||
}
|
||||
else { %>
|
||||
<img class="icon" src="<%=ResolveUrl("~/Modules/Orchard.Modules/Content/Admin/images/disabled.gif") %>" alt="<%=_Encoded("Disabled") %>" title="<%=_Encoded("This feature is currently disabled") %>" /><%=_Encoded("Disabled")%><%
|
||||
} %>
|
||||
</li><%
|
||||
//dependencies
|
||||
if (feature.Descriptor.Dependencies.Count() > 0) { %>
|
||||
<li> | <%=_Encoded("Depends on: ") %><%
|
||||
foreach (var dependency in feature.Descriptor.Dependencies) {
|
||||
%><% if (dependency != feature.Descriptor.Dependencies.First()) { %><%=_Encoded(", ") %><% }
|
||||
%><%=Html.Encode(dependency) %><%
|
||||
} %>
|
||||
</li><%
|
||||
} %>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="related"><%
|
||||
if (feature.IsEnabled) { %>
|
||||
<a href="<%=Html.AntiForgeryTokenGetUrl(Url.Action("Disable", new { featureName = feature.Descriptor.Name, area = "Orchard.Modules" })) %>"><%=_Encoded("Disable") %></a><%
|
||||
} else { %>
|
||||
<a href="<%=Html.AntiForgeryTokenGetUrl(Url.Action("Enable", new { featureName = feature.Descriptor.Name, area = "Orchard.Modules" })) %>"><%=_Encoded("Enable") %></a><%
|
||||
} %>
|
||||
</div>
|
||||
</div>
|
||||
</li><%
|
||||
} %>
|
||||
</ul><%
|
||||
}%>
|
||||
</ul>
|
||||
</li><%
|
||||
} %>
|
||||
</ul>
|
||||
</li><%
|
||||
} %>
|
||||
</ul><%
|
||||
} %>
|
||||
</ul><%
|
||||
} %>
|
||||
</fieldset><%
|
||||
} %>
|
@@ -2,8 +2,10 @@
|
||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||
<%@ Import Namespace="Orchard.Modules.ViewModels"%>
|
||||
<h1><%=Html.TitleForPage(T("Manage Modules").ToString()) %></h1>
|
||||
<div class="manage"><%=Html.ActionLink(T("Install a module").ToString(), "Features", new { }, new { @class = "button primaryAction" })%></div>
|
||||
<h2><%=T("Installed Modules") %></h2>
|
||||
<% if (Model.Modules.Count() > 0) { %>
|
||||
<fieldset class="pageList">
|
||||
<ul class="contentItems blogs"><%
|
||||
foreach (var module in Model.Modules.OrderBy(m => m.DisplayName)) { %>
|
||||
<li>
|
||||
@@ -21,5 +23,6 @@
|
||||
} %>
|
||||
</li><%
|
||||
} %>
|
||||
</ul><%
|
||||
</ul>
|
||||
</fieldset><%
|
||||
} %>
|
@@ -12,20 +12,12 @@ namespace Orchard.MultiTenancy.Services {
|
||||
_orchardHost = orchardHost;
|
||||
}
|
||||
|
||||
#region Implementation of ITenantService
|
||||
|
||||
public IEnumerable<ShellSettings> GetTenants() {
|
||||
return _shellSettingsManager.LoadSettings();
|
||||
}
|
||||
|
||||
public void CreateTenant(ShellSettings settings) {
|
||||
_shellSettingsManager.SaveSettings(settings);
|
||||
|
||||
|
||||
// MultiTenancy: This will not be needed when host listens to event bus
|
||||
_orchardHost.Reinitialize_Obsolete();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@@ -11,8 +11,6 @@
|
||||
<input id="Name" class="textMedium" name="Name" type="text" /><br />
|
||||
<label for="RequestUrlHost"><%=_Encoded("Host") %></label>
|
||||
<input id="RequestUrlHost" class="textMedium" name="RequestUrlHost" type="text" /><br />
|
||||
<label for="RequestUrlPrefix"><%=_Encoded("Url Prefix") %></label>
|
||||
<input id="RequestUrlPrefix" class="textMedium" name="RequestUrlPrefix" type="text" /><br />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<input type="submit" class="button primaryAction" value="<%=_Encoded("Save") %>" />
|
||||
|
@@ -607,6 +607,9 @@ button.ibutton {
|
||||
.contentItems li.first {
|
||||
background:#fff url(images/backgroundGradient.gif) repeat-x top left;
|
||||
}
|
||||
.contentItems li li.last {
|
||||
border-bottom:0;
|
||||
}
|
||||
#main .contentItems li h3 {
|
||||
border-bottom:0;
|
||||
margin-top:0;
|
||||
@@ -753,6 +756,7 @@ table.items, textarea, input.text, input.text-box,
|
||||
margin-top:1em;
|
||||
}
|
||||
.summary {
|
||||
overflow:auto;
|
||||
padding:1.2em .4em;
|
||||
}
|
||||
.actions {
|
||||
|
Reference in New Issue
Block a user