Merge 1.x

--HG--
branch : autoroute
This commit is contained in:
randompete
2012-01-20 03:34:25 +00:00
25 changed files with 121 additions and 34 deletions

1
.hgsub
View File

@@ -5,6 +5,7 @@ src/Orchard.Web/Modules/Orchard.Tokens = https://hg01.codeplex.com/forks/randomp
src/Orchard.Web/Modules/Orchard.TaskLease = https://hg01.codeplex.com/orchardtasklease
src/Orchard.Web/Modules/Orchard.Projections = https://hg01.codeplex.com/forks/randompete/autorouteprojections
src/Orchard.Web/Modules/Orchard.Alias = https://hg01.codeplex.com/forks/randompete/autoroutedevelopment
src/orchard.web/modules/Orchard.Fields = https://hg01.codeplex.com/orchardfields
src/Orchard.Web/Modules/Orchard.Routable = https://hg01.codeplex.com/forks/randompete/routablealias
src/Orchard.Web/Modules/Orchard.Autoroute = https://hg01.codeplex.com/orchardautoroute

View File

@@ -3,6 +3,7 @@ adfb0bb67faf7fa2d01e43cbb82af8f62342f697 src/Orchard.Web/Modules/Orchard.Alias
67bf9897ee9dd9483369aece729ad7c6f042941c src/Orchard.Web/Modules/Orchard.Forms
1d093e0b3327ecd5851a878e1eb6c64fbd683e05 src/Orchard.Web/Modules/Orchard.Projections
a1ef39ba4e2d0cd78b3c91d6150e841793acb34b src/Orchard.Web/Modules/Orchard.Routable
75b2107eb093154b35832e3ea6e8514d4a66426a src/Orchard.Web/Modules/Orchard.Rules
f2a3984789ebe5caf2822ccb9e1d2c953add9c35 src/Orchard.Web/Modules/Orchard.Rules
ce578373f907c0a55fd91229a344f0755f290174 src/Orchard.Web/Modules/Orchard.TaskLease
28251b07a1c122ff34c0aa9c05cd8c8fce9b3c7a src/Orchard.Web/Modules/Orchard.Tokens
7fa9f5cc93bd4e9f88caef9f4060f4f65b3902b9 src/orchard.web/modules/Orchard.Fields

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using System.Linq;
@@ -36,7 +37,13 @@ namespace Orchard.Specs.Hosting {
catch { }
// Trying the two known relative paths to the Orchard.Web directory.
// The second one is for the target "spec" in orchard.proj.
_orchardWebPath = baseDir.Up(3).Combine("Orchard.Web");
if (ConfigurationManager.AppSettings["orchardHosting"] != null) {
_orchardWebPath = baseDir.Combine(ConfigurationManager.AppSettings["orchardHosting"]).Combine("Orchard.Web");
}
else {
_orchardWebPath = baseDir.Up(3).Combine("Orchard.Web");
}
if (!_orchardWebPath.Exists) {
_orchardWebPath = baseDir.Parent.Combine("stage");
}

View File

@@ -2,6 +2,10 @@
namespace Orchard.Core.Common.ViewModels {
public class TextFieldSettingsEventsViewModel {
public TextFieldSettingsEventsViewModel() {
Flavors = new string[0];
}
public TextFieldSettings Settings { get; set; }
public string[] Flavors { get; set; }
}

View File

@@ -1,13 +1,13 @@
@model Orchard.Core.Common.ViewModels.TextFieldDriverViewModel
<label for="@Html.FieldIdFor(m => m.Text)">@Model.Field.DisplayName</label>
<fieldset>
@if (String.IsNullOrWhiteSpace(Model.Settings.Flavor)) {
@Html.TextBoxFor(m => m.Text, new { @class = "text" })
@Html.ValidationMessageFor(m => m.Text)
}
else {
@Display.Body_Editor(Text: Model.Text, EditorFlavor: Model.Settings.Flavor)
}
<span class="hint">@Model.Settings.Hint</span>
<label for="@Html.FieldIdFor(m => m.Text)">@Model.Field.DisplayName</label>
@if (String.IsNullOrWhiteSpace(Model.Settings.Flavor)) {
@Html.TextBoxFor(m => m.Text, new { @class = "text" })
@Html.ValidationMessageFor(m => m.Text)
}
else {
@Display.Body_Editor(Text: Model.Text, EditorFlavor: Model.Settings.Flavor)
}
<span class="hint">@Model.Settings.Hint</span>
</fieldset>

View File

@@ -17,7 +17,7 @@
@Html.SelectOption(Model.Part.OrderByProperty, "ContainablePart.Weight", T("Weight").Text)
@Html.SelectOption(Model.Part.OrderByProperty, "CommonPart.CreatedUtc", T("Date Created").Text)
@Html.SelectOption(Model.Part.OrderByProperty, "CommonPart.PublishedUtc", T("Date Published").Text)
@Html.SelectOption(Model.Part.OrderByProperty, "TitlePart.Title", T("Title").Text)
@Html.SelectOption(Model.Part.OrderByProperty, "TitlePart.Title", T("Title (Title Part)").Text)
@Html.SelectOption(Model.Part.OrderByProperty, "CustomPropertiesPart.CustomOne", T("Custom 1").Text)
@Html.SelectOption(Model.Part.OrderByProperty, "CustomPropertiesPart.CustomTwo", T("Custom 2").Text)
@Html.SelectOption(Model.Part.OrderByProperty, "CustomPropertiesPart.CustomThree", T("Custom 3").Text)

View File

@@ -18,7 +18,7 @@
<select id="@Html.FieldIdFor(m => m.Part.Record.OrderByProperty)" name="@Html.FieldNameFor(m => m.Part.Record.OrderByProperty)">
@Html.SelectOption(Model.Part.Record.OrderByProperty, "CommonPart.CreatedUtc", T("Date Created").Text)
@Html.SelectOption(Model.Part.Record.OrderByProperty, "CommonPart.PublishedUtc", T("Date Published").Text)
@Html.SelectOption(Model.Part.Record.OrderByProperty, "TitlePart.Title", T("Title").Text)
@Html.SelectOption(Model.Part.Record.OrderByProperty, "TitlePart.Title", T("Title (Title Part)").Text)
@Html.SelectOption(Model.Part.Record.OrderByProperty, "CustomPropertiesPart.CustomOne", T("Custom 1").Text)
@Html.SelectOption(Model.Part.Record.OrderByProperty, "CustomPropertiesPart.CustomTwo", T("Custom 2").Text)
@Html.SelectOption(Model.Part.Record.OrderByProperty, "CustomPropertiesPart.CustomThree", T("Custom 3").Text)
@@ -38,7 +38,7 @@
<select id="@Html.FieldIdFor(m => m.Part.Record.FilterByProperty)" name="@Html.FieldNameFor(m => m.Part.Record.FilterByProperty)">
@Html.SelectOption(Model.Part.Record.FilterByProperty, "CommonPart.CreatedUtx", T("Date Created").Text)
@Html.SelectOption(Model.Part.Record.FilterByProperty, "CommonPart.PublishedUtc", T("Date Published").Text)
@Html.SelectOption(Model.Part.Record.FilterByProperty, "TitlePart.Title", T("Title").Text)
@Html.SelectOption(Model.Part.Record.FilterByProperty, "TitlePart.Title", T("Title (Title Part)").Text)
@Html.SelectOption(Model.Part.Record.FilterByProperty, "CustomPropertiesPart.CustomOne", T("Custom 1").Text)
@Html.SelectOption(Model.Part.Record.FilterByProperty, "CustomPropertiesPart.CustomTwo", T("Custom 2").Text)
@Html.SelectOption(Model.Part.Record.FilterByProperty, "CustomPropertiesPart.CustomThree", T("Custom 3").Text)

View File

@@ -212,7 +212,7 @@ namespace Orchard.Core.Contents.Controllers {
[HttpPost, ActionName("Create")]
[FormValueRequired("submit.Publish")]
public ActionResult CreateAndPublishPOST(string id, string returnUrl) {
if (!Services.Authorizer.Authorize(Permissions.PublishOwnContent, T("Couldn't create content")))
if (!Services.Authorizer.Authorize(Permissions.PublishContent, T("Couldn't create content")))
return new HttpUnauthorizedResult();
return CreatePOST(id, returnUrl, contentItem => _contentManager.Publish(contentItem));
@@ -329,6 +329,7 @@ namespace Orchard.Core.Contents.Controllers {
return this.RedirectLocal(returnUrl, () => RedirectToAction("Edit", new RouteValueDictionary { { "Id", contentItem.Id } }));
}
[HttpPost]
public ActionResult Remove(int id, string returnUrl) {
var contentItem = _contentManager.Get(id, VersionOptions.Latest);

View File

@@ -1,4 +1,5 @@
@using Orchard.ContentManagement;
@using Orchard.Core.Contents
@using Orchard.Utility.Extensions;
@{
ContentItem contentItem = Model.ContentItem;
@@ -17,8 +18,12 @@
</div>
<div class="related">
@Display(Model.Actions)
@Html.ItemEditLink(T("Edit").Text, contentItem) @T(" | ")
@Html.Link(T("Delete").Text, Url.ItemRemoveUrl(contentItem, new { returnUrl }), new { itemprop = "RemoveUrl UnsafeUrl" })
@if (Authorizer.Authorize(Permissions.EditContent, contentItem)) {
@Html.ItemEditLink(T("Edit").Text, contentItem)@T(" | ")
}
@if (Authorizer.Authorize(Permissions.DeleteContent, contentItem)) {
@Html.Link(T("Delete").Text, Url.ItemRemoveUrl(contentItem, new {returnUrl}), new {itemprop = "RemoveUrl UnsafeUrl"})
}
</div>
@if (Model.Content != null) {
<div class="primary">@Display(Model.Content)</div>

View File

@@ -1,4 +1,5 @@
@using Orchard.ContentManagement;
@using Orchard.Core.Contents
@using Orchard.Utility.Extensions;
@{
Script.Require("ShapesBase");
@@ -12,18 +13,24 @@
@Html.Link(T("Publish Draft").Text, Url.Action("Publish", "Admin", new { area = "Contents", id = contentPart.ContentItem.Id, returnUrl = Request.ToUrlString() }), new { itemprop = "UnsafeUrl" })
@T(" | ")
@Html.ActionLink(T("Preview").Text, "Preview", "Item", new { area = "Contents", id = ((ContentItem)Model.ContentPart.ContentItem).Id }, new { })
@T(" | ")
if (Authorizer.Authorize(Permissions.PublishContent, contentPart)) {
@Html.ActionLink(T("Preview").Text, "Preview", "Item", new {area = "Contents", id = ((ContentItem) Model.ContentPart.ContentItem).Id}, new {})
@T(" | ")
}
}
@Html.Link(T("Unpublish").Text, Url.Action("Unpublish", "Admin", new { area = "Contents", id = contentPart.ContentItem.Id, returnUrl = Request.ToUrlString() }), new { itemprop = "UnsafeUrl" })
@T(" | ")
if (Authorizer.Authorize(Permissions.PublishContent, contentPart)) {
@Html.Link(T("Unpublish").Text, Url.Action("Unpublish", "Admin", new {area = "Contents", id = contentPart.ContentItem.Id, returnUrl = Request.ToUrlString()}), new {itemprop = "UnsafeUrl"})
@T(" | ")
}
} else {
if ( contentPart.HasDraft() ) {
@Html.ActionLink(T("Preview").Text, "Preview", "Item", new { area = "Contents", id = ((ContentItem)Model.ContentPart.ContentItem).Id }, new { })
@T(" | ")
}
@Html.Link(T("Publish").Text, Url.Action("Publish", "Admin", new { area = "Contents", id = contentPart.ContentItem.Id, returnUrl = Request.ToUrlString() }), new { itemprop = "UnsafeUrl" })
@T(" | ")
if (Authorizer.Authorize(Permissions.PublishContent, contentPart)) {
@Html.Link(T("Publish").Text, Url.Action("Publish", "Admin", new {area = "Contents", id = contentPart.ContentItem.Id, returnUrl = Request.ToUrlString()}), new {itemprop = "UnsafeUrl"})
@T(" | ")
}
}

View File

@@ -468,6 +468,9 @@
<ItemGroup>
<Content Include="Common\Views\Body-Textarea.Editor.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Shapes\Views\ShapeResult\DisplayPartial.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -137,7 +137,7 @@
var _this = $(this);
var _controllees = $("[data-controllerid=" + _this.attr("id") + "]");
var _controlleesAreHidden = _controllees.is(":hidden");
if (_this.is(":checked")) {
if (_this.is(":checked") || _this.is(":selected")) {
if (_controlleesAreHidden) {
_controllees.hide(); // <- unhook this when the following comment applies
$(_controllees.show()[0]).find("input").focus(); // <- aaaand a slideDown there...eventually
@@ -157,7 +157,7 @@
return;
}
controller.data("isControlling", 1);
if (!controller.is(":checked")) {
if (!controller.is(":checked") && !controller.is(":selected")) {
$("[data-controllerid=" + controller.attr("id") + "]").hide();
}
if (controller.is(":checkbox")) {
@@ -165,6 +165,11 @@
} else if (controller.is(":radio")) {
$("[name=" + controller.attr("name") + "]").click(function () { $("[name=" + $(this).attr("name") + "]").each($(this).toggleWhatYouControl); });
}
else if (controller.is("option")) {
controller.parent().change(function () {
controller.toggleWhatYouControl();
});
}
});
});
// inline form link buttons (form.inline.link button) swapped out for a link that submits said form
@@ -214,7 +219,7 @@
return false;
}
}
form.submit();
return false;
});

View File

@@ -1,3 +1,3 @@
// html5shiv MIT @rem remysharp.com/html5-enabling-script
// iepp v1.5.1 MIT @jon_neal iecss.com/print-protector
/*@cc_on(function(p,e){var q=e.createElement("div");q.innerHTML="<z>i</z>";q.childNodes.length!==1&&function(){function r(a,b){if(g[a])g[a].styleSheet.cssText+=b;else{var c=s[l],d=e[j]("style");d.media=a;c.insertBefore(d,c[l]);g[a]=d;r(a,b)}}function t(a,b){for(var c=new RegExp("\\b("+m+")\\b(?!.*[;}])","gi"),d=function(k){return".iepp_"+k},h=-1;++h<a.length;){b=a[h].media||b;t(a[h].imports,b);r(b,a[h].cssText.replace(c,d))}}for(var s=e.documentElement,i=e.createDocumentFragment(),g={},m="abbr article aside audio canvas details figcaption figure footer header hgroup mark meter nav output progress section summary time video".replace(/ /g, '|'),n=m.split("|"),f=[],o=-1,l="firstChild",j="createElement";++o<n.length;){e[j](n[o]);i[j](n[o])}i=i.appendChild(e[j]("div"));p.attachEvent("onbeforeprint",function(){for(var a,b=e.getElementsByTagName("*"),c,d,h=new RegExp("^"+m+"$","i"),k=-1;++k<b.length;)if((a=b[k])&&(d=a.nodeName.match(h))){c=new RegExp("^\\s*<"+d+"(.*)\\/"+d+">\\s*$","i");i.innerHTML=a.outerHTML.replace(/\r|\n/g," ").replace(c,a.currentStyle.display=="block"?"<div$1/div>":"<span$1/span>");c=i.childNodes[0];c.className+=" iepp_"+d;c=f[f.length]=[a,c];a.parentNode.replaceChild(c[1],c[0])}t(e.styleSheets,"all")});p.attachEvent("onafterprint",function(){for(var a=-1,b;++a<f.length;)f[a][1].parentNode.replaceChild(f[a][0],f[a][1]);for(b in g)s[l].removeChild(g[b]);g={};f=[]})}()})(this,document);@*/
// HTML5 Shiv v3 | @jon_neal @afarkas @rem | MIT/GPL2 Licensed
// Uncompressed source: https://github.com/aFarkas/html5shiv
(function (a, b) { function f(a) { var c, d, e, f; b.documentMode > 7 ? (c = b.createElement("font"), c.setAttribute("data-html5shiv", a.nodeName.toLowerCase())) : c = b.createElement("shiv:" + a.nodeName); while (a.firstChild) c.appendChild(a.childNodes[0]); for (d = a.attributes, e = d.length, f = 0; f < e; ++f) d[f].specified && c.setAttribute(d[f].nodeName, d[f].nodeValue); c.style.cssText = a.style.cssText, a.parentNode.replaceChild(c, a), c.originalElement = a } function g(a) { var b = a.originalElement; while (a.childNodes.length) b.appendChild(a.childNodes[0]); a.parentNode.replaceChild(b, a) } function h(a, b) { b = b || "all"; var c = -1, d = [], e = a.length, f, g; while (++c < e) { f = a[c], g = f.media || b; if (f.disabled || !/print|all/.test(g)) continue; d.push(h(f.imports, g), f.cssText) } return d.join("") } function i(c) { var d = new RegExp("(^|[\\s,{}])(" + a.html5.elements.join("|") + ")", "gi"), e = c.split("{"), f = e.length, g = -1; while (++g < f) e[g] = e[g].split("}"), b.documentMode > 7 ? e[g][e[g].length - 1] = e[g][e[g].length - 1].replace(d, '$1font[data-html5shiv="$2"]') : e[g][e[g].length - 1] = e[g][e[g].length - 1].replace(d, "$1shiv\\:$2"), e[g] = e[g].join("}"); return e.join("{") } var c = function (a) { return a.innerHTML = "<x-element></x-element>", a.childNodes.length === 1 } (b.createElement("a")), d = function (a, b, c) { return b.appendChild(a), (c = (c ? c(a) : a.currentStyle).display) && b.removeChild(a) && c === "block" } (b.createElement("nav"), b.documentElement, a.getComputedStyle), e = { elements: "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "), shivDocument: function (a) { a = a || b; if (a.documentShived) return; a.documentShived = !0; var f = a.createElement, g = a.createDocumentFragment, h = a.getElementsByTagName("head")[0], i = function (a) { f(a) }; c || (e.elements.join(" ").replace(/\w+/g, i), a.createElement = function (a) { var b = f(a); return b.canHaveChildren && e.shivDocument(b.document), b }, a.createDocumentFragment = function () { return e.shivDocument(g()) }); if (!d && h) { var j = f("div"); j.innerHTML = ["x<style>", "article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}", "audio{display:none}", "canvas,video{display:inline-block;*display:inline;*zoom:1}", "[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}", "mark{background:#FF0;color:#000}", "</style>"].join(""), h.insertBefore(j.lastChild, h.firstChild) } return a } }; e.shivDocument(b), a.html5 = e; if (c || !a.attachEvent) return; a.attachEvent("onbeforeprint", function () { if (a.html5.supportsXElement || !b.namespaces) return; b.namespaces.shiv || b.namespaces.add("shiv"); var c = -1, d = new RegExp("^(" + a.html5.elements.join("|") + ")$", "i"), e = b.getElementsByTagName("*"), g = e.length, j, k = i(h(function (a, b) { var c = [], d = a.length; while (d) c.unshift(a[--d]); d = b.length; while (d) c.unshift(b[--d]); c.sort(function (a, b) { return a.sourceIndex - b.sourceIndex }), d = c.length; while (d) c[--d] = c[d].styleSheet; return c } (b.getElementsByTagName("style"), b.getElementsByTagName("link")))); while (++c < g) j = e[c], d.test(j.nodeName) && f(j); b.appendChild(b._shivedStyleSheet = b.createElement("style")).styleSheet.cssText = k }), a.attachEvent("onafterprint", function () { if (a.html5.supportsXElement || !b.namespaces) return; var c = -1, d = b.getElementsByTagName("*"), e = d.length, f; while (++c < e) f = d[c], f.originalElement && g(f); b._shivedStyleSheet && b._shivedStyleSheet.parentNode.removeChild(b._shivedStyleSheet) }) })(this, document)

View File

@@ -2,7 +2,7 @@
@using Orchard.UI.Resources;
@{
RegisterLink(new LinkEntry {Type = "image/x-icon", Rel = "shortcut icon", Href = Url.Content("~/modules/orchard.themes/Content/orchard.ico")});
Script.Include("html5.js").AtHead();
Script.Include("html5.js").UseCondition("lt IE 9").AtHead();
string title = Convert.ToString(Model.Title);
string siteName = Convert.ToString(WorkContext.CurrentSite.SiteName);

View File

@@ -0,0 +1 @@
@Display(Model)

View File

@@ -1,6 +1,7 @@
@model Orchard.ContentTypes.ViewModels.EditPartFieldViewModel
@using Orchard.Utility.Extensions
@model Orchard.ContentTypes.ViewModels.EditPartFieldViewModel
<fieldset class="manage-field">
<h3>@Model.DisplayName <span>(@Model.FieldDefinition.Name)</span></h3>
<h3>@Model.DisplayName <span>(@Model.FieldDefinition.Name.CamelFriendly())</span></h3>
<div class="manage">
@Html.ActionLink(T("Edit").Text, "EditField", new { area = "Orchard.ContentTypes", id = Model.Part.Name, Model.Name }) |
@Html.ActionLink(T("Remove").Text, "RemoveFieldFrom", new { area = "Orchard.ContentTypes", id = Model.Part.Name, Model.Name }, new { itemprop = "RemoveUrl UnsafeUrl" })

View File

@@ -130,6 +130,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Projections", "Orch
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Projections.Tests", "Orchard.Web\Modules\Orchard.Projections\Tests\Orchard.Projections.Tests.csproj", "{2969635F-D9C3-4D01-890D-437B46659690}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Fields", "Orchard.Web\Modules\Orchard.Fields\Orchard.Fields.csproj", "{3787DDE5-E5C8-4841-BDA7-DCB325388064}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Fields.Specs", "Orchard.Web\Modules\Orchard.Fields\Specs\Orchard.Fields.Specs.csproj", "{34BE9011-A5A9-49DD-9E53-C3D5CA7D7CE3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
CodeCoverage|Any CPU = CodeCoverage|Any CPU
@@ -700,6 +704,26 @@ Global
{2969635F-D9C3-4D01-890D-437B46659690}.FxCop|Any CPU.Build.0 = Release|Any CPU
{2969635F-D9C3-4D01-890D-437B46659690}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2969635F-D9C3-4D01-890D-437B46659690}.Release|Any CPU.Build.0 = Release|Any CPU
{3787DDE5-E5C8-4841-BDA7-DCB325388064}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
{3787DDE5-E5C8-4841-BDA7-DCB325388064}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
{3787DDE5-E5C8-4841-BDA7-DCB325388064}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
{3787DDE5-E5C8-4841-BDA7-DCB325388064}.Coverage|Any CPU.Build.0 = Release|Any CPU
{3787DDE5-E5C8-4841-BDA7-DCB325388064}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3787DDE5-E5C8-4841-BDA7-DCB325388064}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3787DDE5-E5C8-4841-BDA7-DCB325388064}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
{3787DDE5-E5C8-4841-BDA7-DCB325388064}.FxCop|Any CPU.Build.0 = Release|Any CPU
{3787DDE5-E5C8-4841-BDA7-DCB325388064}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3787DDE5-E5C8-4841-BDA7-DCB325388064}.Release|Any CPU.Build.0 = Release|Any CPU
{34BE9011-A5A9-49DD-9E53-C3D5CA7D7CE3}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
{34BE9011-A5A9-49DD-9E53-C3D5CA7D7CE3}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
{34BE9011-A5A9-49DD-9E53-C3D5CA7D7CE3}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
{34BE9011-A5A9-49DD-9E53-C3D5CA7D7CE3}.Coverage|Any CPU.Build.0 = Release|Any CPU
{34BE9011-A5A9-49DD-9E53-C3D5CA7D7CE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{34BE9011-A5A9-49DD-9E53-C3D5CA7D7CE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{34BE9011-A5A9-49DD-9E53-C3D5CA7D7CE3}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
{34BE9011-A5A9-49DD-9E53-C3D5CA7D7CE3}.FxCop|Any CPU.Build.0 = Release|Any CPU
{34BE9011-A5A9-49DD-9E53-C3D5CA7D7CE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34BE9011-A5A9-49DD-9E53-C3D5CA7D7CE3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -746,6 +770,7 @@ Global
{3158C928-888C-4A84-8BC1-4A8257489538} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{3F72A4E9-7B72-4260-B010-C16EC54F9BAF} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{5531E894-D259-45A3-AA61-26DBE720C1CE} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{3787DDE5-E5C8-4841-BDA7-DCB325388064} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{ABC826D4-2FA1-4F2F-87DE-E6095F653810} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
{F112851D-B023-4746-B6B1-8D2E5AD8F7AA} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
{6CB3EB30-F725-45C0-9742-42599BA8E8D2} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
@@ -757,6 +782,7 @@ Global
{0DFA2E10-96C8-4E05-BC10-B710B97ECCDE} = {383DBA32-4A3E-48D1-AAC3-75377A694452}
{94E694A2-D140-468D-A277-C5FCE1D13E9B} = {3E10BF6D-ADA5-417D-B36C-EBB0660B475E}
{7354DF37-934B-46CF-A13C-455D5F5F5413} = {3E10BF6D-ADA5-417D-B36C-EBB0660B475E}
{34BE9011-A5A9-49DD-9E53-C3D5CA7D7CE3} = {3E10BF6D-ADA5-417D-B36C-EBB0660B475E}
{CB70A642-8CEC-4DDE-8C9F-AD08900EC98D} = {74492CBC-7201-417E-BC29-28B4C25A58B0}
EndGlobalSection
EndGlobal

View File

@@ -42,8 +42,13 @@ namespace Orchard.Environment {
}
public void Terminate() {
using (var events = _eventsFactory()) {
events.Value.Terminating();
try {
using (var events = _eventsFactory()) {
events.Value.Terminating();
}
}
catch {
// ignore exceptions while terminating the application
}
}
}

View File

@@ -9,4 +9,13 @@ namespace Orchard.Mvc {
ViewName = "ShapeResult/Display";
}
}
public class ShapePartialResult : PartialViewResult {
public ShapePartialResult(ControllerBase controller, dynamic shape) {
ViewData = controller.ViewData;
TempData = controller.TempData;
ViewData.Model = shape;
ViewName = "ShapeResult/DisplayPartial";
}
}
}

View File

@@ -22,6 +22,13 @@ namespace Orchard.Security {
/// <param name="message">A localized message to display if authorization fails</param>
bool Authorize(Permission permission, LocalizedString message);
/// <summary>
/// Authorize the current user against a permission for a specified content item;
/// </summary>
/// <param name="permission">A permission to authorize against</param>
/// <param name="content">A content item the permission will be checked for</param>
bool Authorize(Permission permission, IContent content);
/// <summary>
/// Authorize the current user against a permission for a specified content item;
/// if authorization fails, the specified message will be displayed
@@ -57,6 +64,10 @@ namespace Orchard.Security {
return Authorize(permission, null, message);
}
public bool Authorize(Permission permission, IContent content) {
return Authorize(permission, content, null);
}
public bool Authorize(Permission permission, IContent content, LocalizedString message) {
if (_authorizationService.TryCheckAccess(permission, _workContextAccessor.GetContext().CurrentUser, content))
return true;