mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -45,11 +45,13 @@ namespace Orchard.Tests.Commands {
|
|||||||
var builder = new CommandHandlerDescriptorBuilder();
|
var builder = new CommandHandlerDescriptorBuilder();
|
||||||
var descriptor = builder.Build(typeof(PublicMethodsOnly));
|
var descriptor = builder.Build(typeof(PublicMethodsOnly));
|
||||||
Assert.That(descriptor, Is.Not.Null);
|
Assert.That(descriptor, Is.Not.Null);
|
||||||
Assert.That(descriptor.Commands.Count(), Is.EqualTo(3));
|
Assert.That(descriptor.Commands.Count(), Is.EqualTo(1));
|
||||||
Assert.That(descriptor.Commands.Single(d => d.Name == "Method"), Is.Not.Null);
|
Assert.That(descriptor.Commands.Single(d => d.Name == "Method"), Is.Not.Null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma warning disable 660,661
|
||||||
public class PublicMethodsOnly {
|
public class PublicMethodsOnly {
|
||||||
|
#pragma warning restore 660,661
|
||||||
public bool Bar { get; set; } // no accessors
|
public bool Bar { get; set; } // no accessors
|
||||||
public bool Field = true; // no field
|
public bool Field = true; // no field
|
||||||
|
|
||||||
@@ -70,14 +72,6 @@ namespace Orchard.Tests.Commands {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetHashCode() {
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Equals(Object obj) {
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Method() {
|
public void Method() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -42,8 +42,9 @@ namespace Orchard.Core.Localization.Drivers {
|
|||||||
ContentLocalizations = new ContentLocalizationsViewModel(part) { Localizations = localizations }
|
ContentLocalizations = new ContentLocalizationsViewModel(part) { Localizations = localizations }
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: andrerod convert to new shape API. Location code kept for reference.
|
return ContentShape("Parts_Localization_ContentTranslations_Edit", () => {
|
||||||
return ContentPartTemplate(model, "Parts/Localization.Translation", TemplatePrefix); //.Location(part.GetLocation("Editor"));
|
return shapeHelper.EditorTemplate(TemplateName: "Parts/Localization.ContentTranslations.Edit", Model: model, Prefix: TemplatePrefix);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override DriverResult Editor(LocalizationPart part, IUpdateModel updater, dynamic shapeHelper) {
|
protected override DriverResult Editor(LocalizationPart part, IUpdateModel updater, dynamic shapeHelper) {
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
<Placement>
|
<Placement>
|
||||||
<Place Parts_Localization_ContentTranslations="-"/>
|
<Place Parts_Localization_ContentTranslations="-"/>
|
||||||
<Place Parts_Localization_ContentTranslations_Summary="-"/>
|
<Place Parts_Localization_ContentTranslations_Summary="-"/>
|
||||||
|
<Place Parts_Localization_ContentTranslations_Edit="Primary:before.1"/>
|
||||||
<Match DisplayType="Detail">
|
<Match DisplayType="Detail">
|
||||||
<Place Parts_Localization_ContentTranslations="Content:before.5"/>
|
<Place Parts_Localization_ContentTranslations="Content:before.5"/>
|
||||||
</Match>
|
</Match>
|
||||||
@@ -8,6 +9,6 @@
|
|||||||
<Place Parts_Localization_ContentTranslations_Summary="Content:after.5"/>
|
<Place Parts_Localization_ContentTranslations_Summary="Content:after.5"/>
|
||||||
</Match>
|
</Match>
|
||||||
<Match DisplayType="SummaryAdmin">
|
<Match DisplayType="SummaryAdmin">
|
||||||
<Place Parts_Localization_ContentTranslations_Summary="Content:after.5"/>
|
<Place Parts_Localization_ContentTranslations_Summary="Meta:after.1"/>
|
||||||
</Match>
|
</Match>
|
||||||
</Placement>
|
</Placement>
|
@@ -256,7 +256,7 @@
|
|||||||
<Content Include="Contents\Views\Admin\Edit.cshtml" />
|
<Content Include="Contents\Views\Admin\Edit.cshtml" />
|
||||||
<Content Include="Contents\Views\Admin\List.cshtml" />
|
<Content Include="Contents\Views\Admin\List.cshtml" />
|
||||||
<Content Include="Feeds\Views\Feed.cshtml" />
|
<Content Include="Feeds\Views\Feed.cshtml" />
|
||||||
<Content Include="Localization\Views\EditorTemplates\Parts\Localization.Translation.cshtml" />
|
<Content Include="Localization\Views\EditorTemplates\Parts\Localization.ContentTranslations.Edit.cshtml" />
|
||||||
<Content Include="Contents\Views\Parts\Contents.Publish.cshtml" />
|
<Content Include="Contents\Views\Parts\Contents.Publish.cshtml" />
|
||||||
<Content Include="Contents\Views\Parts\Contents.Publish.SummaryAdmin.cshtml" />
|
<Content Include="Contents\Views\Parts\Contents.Publish.SummaryAdmin.cshtml" />
|
||||||
<Content Include="Messaging\Module.txt" />
|
<Content Include="Messaging\Module.txt" />
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
@model Orchard.Packaging.ViewModels.PackagingModulesViewModel
|
@model Orchard.Packaging.ViewModels.PackagingModulesViewModel
|
||||||
|
@using System.Linq;
|
||||||
|
|
||||||
@{ Style.Require("PackagingAdmin"); }
|
@{ Style.Require("PackagingAdmin"); }
|
||||||
|
|
||||||
<h1>@Html.TitleForPage(T("Browse Gallery - Modules").ToString())</h1>
|
<h1>@Html.TitleForPage(T("Browse Gallery - Modules").ToString())</h1>
|
||||||
@@ -10,7 +12,7 @@
|
|||||||
<select id="sourceId" name="sourceId">
|
<select id="sourceId" name="sourceId">
|
||||||
@Html.SelectOption("", Model.SelectedSource == null, T("Any (show all feeds)").ToString())
|
@Html.SelectOption("", Model.SelectedSource == null, T("Any (show all feeds)").ToString())
|
||||||
@foreach (var source in Model.Sources) {
|
@foreach (var source in Model.Sources) {
|
||||||
Html.SelectOption(source.Id, Model.SelectedSource != null && Model.SelectedSource.Id == source.Id, source.FeedTitle);
|
@Html.SelectOption(source.Id, Model.SelectedSource != null && Model.SelectedSource.Id == source.Id, source.FeedTitle)
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
<button type="submit">@T("Apply")</button>
|
<button type="submit">@T("Apply")</button>
|
||||||
@@ -23,7 +25,7 @@
|
|||||||
@foreach (var item in Model.Modules) {
|
@foreach (var item in Model.Modules) {
|
||||||
<li>
|
<li>
|
||||||
<div class="moduleName">
|
<div class="moduleName">
|
||||||
<h2>@(item.SyndicationItem.Title == null ? T("(No title)").Text : item.SyndicationItem.Title.Text)<span> - @T("Version: {0}", "1.0")</span></h2>
|
<h2>@(item.SyndicationItem.Title == null ? T("(No title)").Text : item.SyndicationItem.Title.Text)<span> - @T("Version: {0}", item.SyndicationItem.ElementExtensions.ReadElementExtensions<string>("Version", "http://orchardproject.net").FirstOrDefault() ?? T("N/A").Text)</span></h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="related">
|
<div class="related">
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
<select id="sourceId" name="sourceId">
|
<select id="sourceId" name="sourceId">
|
||||||
@Html.SelectOption("", Model.SelectedSource == null, T("Any (show all feeds)").ToString())
|
@Html.SelectOption("", Model.SelectedSource == null, T("Any (show all feeds)").ToString())
|
||||||
@foreach (var source in Model.Sources) {
|
@foreach (var source in Model.Sources) {
|
||||||
Html.SelectOption(source.Id, Model.SelectedSource != null && Model.SelectedSource.Id == source.Id, source.FeedTitle);
|
@Html.SelectOption(source.Id, Model.SelectedSource != null && Model.SelectedSource.Id == source.Id, source.FeedTitle)
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
<button type="submit">@T("Apply")</button>
|
<button type="submit">@T("Apply")</button>
|
||||||
|
@@ -1,33 +0,0 @@
|
|||||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %>
|
|
||||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
|
||||||
|
|
||||||
<%--//todo: get the settings from the cookie to class-ify parts of the menu that should be closed on load--%>
|
|
||||||
<%--<ul id="navigation" role="navigation">
|
|
||||||
<%if (Model.Menu != null) {
|
|
||||||
foreach (var menuSection in Model.Menu) {
|
|
||||||
// todo: (heskew) need some help(er)
|
|
||||||
var firstSectionItem = menuSection.Items.FirstOrDefault();
|
|
||||||
var sectionHeaderMarkup = firstSectionItem != null
|
|
||||||
? Html.ActionLink(menuSection.Text, (string)firstSectionItem.RouteValues["action"], firstSectionItem.RouteValues).ToHtmlString()
|
|
||||||
: string.Format("<span>{0}</span>", Html.Encode(menuSection.Text));
|
|
||||||
var classification = "";
|
|
||||||
if (menuSection == Model.Menu.First())
|
|
||||||
classification = "first ";
|
|
||||||
if (menuSection == Model.Menu.Last())
|
|
||||||
classification += "last ";
|
|
||||||
|
|
||||||
%>
|
|
||||||
<li<%=!string.IsNullOrEmpty(classification) ? string.Format(" class=\"{0}\"", classification.TrimEnd()) : "" %>><h3><%=sectionHeaderMarkup %></h3><ul class="menuItems"><%foreach (var menuItem in menuSection.Items) { %>
|
|
||||||
<li><%: Html.ActionLink(menuItem.Text, (string)menuItem.RouteValues["action"], menuItem.RouteValues)%></li>
|
|
||||||
<%} %></ul></li>
|
|
||||||
<%
|
|
||||||
}
|
|
||||||
}%>
|
|
||||||
</ul>
|
|
||||||
<% using (this.Capture("end-of-page-scripts")) { %>
|
|
||||||
<script type="text/javascript">
|
|
||||||
(function ($) {
|
|
||||||
$("#navigation h3").expandoControl(function(controller) { return controller.next(); }, { key: "N42", path: "<%:ResolveUrl("~/") %>" });
|
|
||||||
})(jQuery);
|
|
||||||
</script>
|
|
||||||
<% } %>--%>
|
|
@@ -1,14 +1,44 @@
|
|||||||
<ul id="navigation">
|
@using System.Web.Routing;
|
||||||
|
@{
|
||||||
|
Script.Require("jQuery");
|
||||||
|
Script.Include("admin.js");
|
||||||
|
IEnumerable<dynamic> firstLevelMenuItems = Model;
|
||||||
|
}
|
||||||
|
<ul id="navigation" role="navigation">
|
||||||
@foreach(var firstLevelMenuItem in Model) {
|
@foreach(var firstLevelMenuItem in Model) {
|
||||||
<li>
|
IEnumerable<dynamic> secondLevelMenuItems = firstLevelMenuItem;
|
||||||
<h3><a href="#">@firstLevelMenuItem.Text</a></h3>
|
|
||||||
|
var firstOfTheSecond = secondLevelMenuItems.FirstOrDefault();
|
||||||
|
var sectionHeaderMarkup = firstOfTheSecond != null
|
||||||
|
? Html.ActionLink((string)firstLevelMenuItem.Text, (string)firstOfTheSecond.RouteValues["action"], (RouteValueDictionary)firstOfTheSecond.RouteValues)
|
||||||
|
: new HtmlString(string.Format("<span>{0}</span>", Html.Encode(firstLevelMenuItem.Text)));
|
||||||
|
|
||||||
|
if (firstLevelMenuItem == firstLevelMenuItems.First()) {
|
||||||
|
firstLevelMenuItem.Classes.Add("first");
|
||||||
|
}
|
||||||
|
if (firstLevelMenuItem == firstLevelMenuItems.Last()) {
|
||||||
|
firstLevelMenuItem.Classes.Add("last");
|
||||||
|
}
|
||||||
|
|
||||||
|
var firstLevelTag = Tag(firstLevelMenuItem, "li");
|
||||||
|
@firstLevelTag.StartElement
|
||||||
|
<h3>@sectionHeaderMarkup</h3>
|
||||||
<ul class="menuItems">
|
<ul class="menuItems">
|
||||||
@foreach(var secondLevelMenuItem in firstLevelMenuItem) {
|
@foreach(var secondLevelMenuItem in secondLevelMenuItems) {
|
||||||
<li>
|
<li>
|
||||||
<a href="@secondLevelMenuItem.Href">@secondLevelMenuItem.Text</a>
|
<a href="@secondLevelMenuItem.Href">@secondLevelMenuItem.Text</a>
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
@firstLevelTag.EndElement
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
|
@using(Script.Foot()) {
|
||||||
|
<script type="text/javascript">
|
||||||
|
//<![CDATA[
|
||||||
|
(function ($) {
|
||||||
|
$("#navigation h3").expandoControl(function(controller) { return controller.next(); }, { key: "N42", path: "@Url.Content("~/")" });
|
||||||
|
})(jQuery);
|
||||||
|
//]]>
|
||||||
|
</script>
|
||||||
|
}
|
@@ -68,6 +68,7 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="TheThemeMachine\Views\User.cshtml" />
|
<Content Include="TheThemeMachine\Views\User.cshtml" />
|
||||||
|
<None Include="TheAdmin\Views\Menu.cshtml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="TheAdmin\Styles\images\icons.png" />
|
<Content Include="TheAdmin\Styles\images\icons.png" />
|
||||||
|
@@ -6,6 +6,7 @@ using System.Web.Mvc;
|
|||||||
using System.Web.Routing;
|
using System.Web.Routing;
|
||||||
using Autofac;
|
using Autofac;
|
||||||
using Orchard.Caching;
|
using Orchard.Caching;
|
||||||
|
using Orchard.Data;
|
||||||
using Orchard.Environment;
|
using Orchard.Environment;
|
||||||
using Orchard.Environment.Configuration;
|
using Orchard.Environment.Configuration;
|
||||||
using Orchard.Environment.State;
|
using Orchard.Environment.State;
|
||||||
@@ -48,6 +49,8 @@ namespace Orchard.Commands {
|
|||||||
tenant = tenant ?? "Default";
|
tenant = tenant ?? "Default";
|
||||||
|
|
||||||
using (var env = CreateStandaloneEnvironment(tenant)) {
|
using (var env = CreateStandaloneEnvironment(tenant)) {
|
||||||
|
var commandManager = env.Resolve<ICommandManager>();
|
||||||
|
var transactionManager = env.Resolve<ITransactionManager>();
|
||||||
|
|
||||||
var parameters = new CommandParameters {
|
var parameters = new CommandParameters {
|
||||||
Arguments = args,
|
Arguments = args,
|
||||||
@@ -56,7 +59,16 @@ namespace Orchard.Commands {
|
|||||||
Output = output
|
Output = output
|
||||||
};
|
};
|
||||||
|
|
||||||
env.Resolve<ICommandManager>().Execute(parameters);
|
try {
|
||||||
|
commandManager.Execute(parameters);
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
// any database changes in this using(env) scope are invalidated
|
||||||
|
transactionManager.Cancel();
|
||||||
|
|
||||||
|
// exception handling performed below
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// in effect "pump messages" see PostMessage circa 1980
|
// in effect "pump messages" see PostMessage circa 1980
|
||||||
|
@@ -42,11 +42,11 @@ namespace Orchard.ContentManagement.Drivers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ContentShapeResult ContentShape(string shapeType, Func<dynamic, dynamic> factory) {
|
public ContentShapeResult ContentShape(string shapeType, Func<dynamic, dynamic> factory) {
|
||||||
return ContentShapeImplementation(shapeType, null, ctx=>factory(CreateShape(ctx, shapeType)));
|
return ContentShapeImplementation(shapeType, null, ctx => factory(CreateShape(ctx, shapeType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContentShapeResult ContentShape(string shapeType, string defaultLocation, Func<dynamic, dynamic> factory) {
|
public ContentShapeResult ContentShape(string shapeType, string defaultLocation, Func<dynamic, dynamic> factory) {
|
||||||
return ContentShapeImplementation(shapeType, defaultLocation, factory);
|
return ContentShapeImplementation(shapeType, defaultLocation, ctx => factory(CreateShape(ctx, shapeType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private ContentShapeResult ContentShapeImplementation(string shapeType, string defaultLocation, Func<BuildShapeContext, object> shapeBuilder) {
|
private ContentShapeResult ContentShapeImplementation(string shapeType, string defaultLocation, Func<BuildShapeContext, object> shapeBuilder) {
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
using Autofac;
|
using Autofac;
|
||||||
|
using Orchard.Data;
|
||||||
using Orchard.Environment;
|
using Orchard.Environment;
|
||||||
using Orchard.Logging;
|
using Orchard.Logging;
|
||||||
|
|
||||||
@@ -57,10 +58,21 @@ namespace Orchard.Tasks {
|
|||||||
public void DoWork() {
|
public void DoWork() {
|
||||||
// makes an inner container, similar to the per-request container
|
// makes an inner container, similar to the per-request container
|
||||||
using (var scope = _workContextAccessor.CreateWorkContextScope()) {
|
using (var scope = _workContextAccessor.CreateWorkContextScope()) {
|
||||||
|
var transactionManager = scope.Resolve<ITransactionManager>();
|
||||||
|
|
||||||
|
try {
|
||||||
// resolve the manager and invoke it
|
// resolve the manager and invoke it
|
||||||
var manager = scope.Resolve<IBackgroundService>();
|
var manager = scope.Resolve<IBackgroundService>();
|
||||||
manager.Sweep();
|
manager.Sweep();
|
||||||
}
|
}
|
||||||
|
catch {
|
||||||
|
// any database changes in this using scope are invalidated
|
||||||
|
transactionManager.Cancel();
|
||||||
|
|
||||||
|
// pass exception along to actual handler
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -103,6 +103,10 @@ namespace PackageIndexReferenceImplementation.Controllers {
|
|||||||
item.Summary = new TextSyndicationContent(packageProperties.Description);
|
item.Summary = new TextSyndicationContent(packageProperties.Description);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !string.IsNullOrEmpty(packageProperties.Version) ) {
|
||||||
|
item.ElementExtensions.Add("Version", "http://orchardproject.net", packageProperties.Version);
|
||||||
|
}
|
||||||
|
|
||||||
var mediaIdentifier = packageProperties.Identifier + "-" + packageProperties.Version + ".zip";
|
var mediaIdentifier = packageProperties.Identifier + "-" + packageProperties.Version + ".zip";
|
||||||
|
|
||||||
var mediaUrl = Url.Action("Resource", "Media", new RouteValueDictionary { { "Id", mediaIdentifier }, { "ContentType", "application/x-package" } });
|
var mediaUrl = Url.Action("Resource", "Media", new RouteValueDictionary { { "Id", mediaIdentifier }, { "ContentType", "application/x-package" } });
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<appSettings>
|
<appSettings>
|
||||||
<add key="Title" value="Orchard Modules Gallery"/>
|
<add key="Title" value="Orchard Extensions Gallery"/>
|
||||||
</appSettings>
|
</appSettings>
|
||||||
|
|
||||||
<system.web>
|
<system.web>
|
||||||
|
Reference in New Issue
Block a user