mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Merge
--HG-- branch : autoroute
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ bce623c333ca90f0f815843c04c8d124f2c7b6d9 src/Orchard.Web/Modules/Orchard.Autorou
|
|||||||
67bf9897ee9dd9483369aece729ad7c6f042941c src/Orchard.Web/Modules/Orchard.Forms
|
67bf9897ee9dd9483369aece729ad7c6f042941c src/Orchard.Web/Modules/Orchard.Forms
|
||||||
6033664adc404a22f311029b69fbf1e34dc4ff2a src/Orchard.Web/Modules/Orchard.Projections
|
6033664adc404a22f311029b69fbf1e34dc4ff2a src/Orchard.Web/Modules/Orchard.Projections
|
||||||
a1ef39ba4e2d0cd78b3c91d6150e841793acb34b src/Orchard.Web/Modules/Orchard.Routable
|
a1ef39ba4e2d0cd78b3c91d6150e841793acb34b src/Orchard.Web/Modules/Orchard.Routable
|
||||||
f2a3984789ebe5caf2822ccb9e1d2c953add9c35 src/Orchard.Web/Modules/Orchard.Rules
|
204bdef384f41bb5e463bed6b98a056945a7d839 src/Orchard.Web/Modules/Orchard.Rules
|
||||||
ce578373f907c0a55fd91229a344f0755f290174 src/Orchard.Web/Modules/Orchard.TaskLease
|
ce578373f907c0a55fd91229a344f0755f290174 src/Orchard.Web/Modules/Orchard.TaskLease
|
||||||
42d34730d8bb22052585ca94e3e945111aea3b9d src/Orchard.Web/Modules/Orchard.Tokens
|
42d34730d8bb22052585ca94e3e945111aea3b9d src/Orchard.Web/Modules/Orchard.Tokens
|
||||||
08eadecb5e5fae52e8b4c7d1c60f29e51c63b2ca src/orchard.web/modules/Orchard.Fields
|
08eadecb5e5fae52e8b4c7d1c60f29e51c63b2ca src/orchard.web/modules/Orchard.Fields
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<div class="summary" itemscope="itemscope" itemid="@contentItem.Id" itemtype="http://orchardproject.net/data/ContentItem">
|
<div class="summary" itemscope="itemscope" itemid="@contentItem.Id" itemtype="http://orchardproject.net/data/ContentItem">
|
||||||
<div class="properties">
|
<div class="properties">
|
||||||
<input type="checkbox" value="@contentItem.Id" name="itemIds"/>
|
<input type="checkbox" value="@contentItem.Id" name="itemIds"/>
|
||||||
<h3>@Html.ItemAdminLink(contentItem)</h3> - <div class="contentType">@contentItem.ContentType</div>
|
<h3>@Html.ItemAdminLink(contentItem)</h3> - <div class="contentType">@contentItem.TypeDefinition.DisplayName</div>
|
||||||
@if (Model.Header != null) {
|
@if (Model.Header != null) {
|
||||||
<div class="header">@Display(Model.Header)</div>
|
<div class="header">@Display(Model.Header)</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
(function () {
|
(function () {
|
||||||
var marker = '<!-- markdown -->';
|
var marker = '<!-- markdown -->';
|
||||||
var converter = Markdown.getSanitizingConverter();
|
var converter = Markdown.getSanitizingConverter();
|
||||||
var editor = new Markdown.Editor(converter, "", function () { alert("Do you need help?"); });
|
var editor = new Markdown.Editor(converter, "", {
|
||||||
|
handler: function () { window.open("http://daringfireball.net/projects/markdown/syntax"); }
|
||||||
|
});
|
||||||
|
|
||||||
editor.hooks.set("insertImageDialog", function (callback) {
|
editor.hooks.set("insertImageDialog", function (callback) {
|
||||||
// see if there's an image selected that they intend on editing
|
// see if there's an image selected that they intend on editing
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using Orchard.Blogs.Models;
|
|||||||
using Orchard.Blogs.Services;
|
using Orchard.Blogs.Services;
|
||||||
using Orchard.Environment.Extensions;
|
using Orchard.Environment.Extensions;
|
||||||
using Orchard.Logging;
|
using Orchard.Logging;
|
||||||
|
using Orchard.Mvc.Extensions;
|
||||||
|
|
||||||
namespace Orchard.Blogs.Controllers {
|
namespace Orchard.Blogs.Controllers {
|
||||||
[OrchardFeature("Orchard.Blogs.RemotePublishing")]
|
[OrchardFeature("Orchard.Blogs.RemotePublishing")]
|
||||||
@@ -32,7 +33,7 @@ namespace Orchard.Blogs.Controllers {
|
|||||||
const string manifestUri = "http://archipelago.phrasewise.com/rsd";
|
const string manifestUri = "http://archipelago.phrasewise.com/rsd";
|
||||||
|
|
||||||
var urlHelper = new UrlHelper(ControllerContext.RequestContext, _routeCollection);
|
var urlHelper = new UrlHelper(ControllerContext.RequestContext, _routeCollection);
|
||||||
var url = urlHelper.Action("", "", new { Area = "XmlRpc" });
|
var url = urlHelper.AbsoluteAction("", "", new { Area = "XmlRpc" });
|
||||||
|
|
||||||
var options = new XElement(
|
var options = new XElement(
|
||||||
XName.Get("service", manifestUri),
|
XName.Get("service", manifestUri),
|
||||||
|
|||||||
@@ -159,13 +159,7 @@ namespace Orchard.ContentTypes.Controllers {
|
|||||||
if (typeViewModel == null)
|
if (typeViewModel == null)
|
||||||
return HttpNotFound();
|
return HttpNotFound();
|
||||||
|
|
||||||
_contentDefinitionManager.DeleteTypeDefinition(id);
|
_contentDefinitionService.RemoveType(id, true);
|
||||||
|
|
||||||
// delete all content items (but keep versions)
|
|
||||||
var contentItems = Services.ContentManager.Query(id).List();
|
|
||||||
foreach (var contentItem in contentItems) {
|
|
||||||
Services.ContentManager.Remove(contentItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
Services.Notifier.Information(T("\"{0}\" has been removed.", typeViewModel.DisplayName));
|
Services.Notifier.Information(T("\"{0}\" has been removed.", typeViewModel.DisplayName));
|
||||||
|
|
||||||
@@ -348,7 +342,8 @@ namespace Orchard.ContentTypes.Controllers {
|
|||||||
if (partViewModel == null)
|
if (partViewModel == null)
|
||||||
return HttpNotFound();
|
return HttpNotFound();
|
||||||
|
|
||||||
_contentDefinitionManager.DeletePartDefinition(id);
|
_contentDefinitionService.RemovePart(id);
|
||||||
|
|
||||||
Services.Notifier.Information(T("\"{0}\" has been removed.", partViewModel.DisplayName));
|
Services.Notifier.Information(T("\"{0}\" has been removed.", partViewModel.DisplayName));
|
||||||
|
|
||||||
return RedirectToAction("ListParts");
|
return RedirectToAction("ListParts");
|
||||||
@@ -434,15 +429,15 @@ namespace Orchard.ContentTypes.Controllers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
_contentDefinitionService.AddFieldToPart(viewModel.Name, viewModel.FieldTypeName, partViewModel.Name);
|
_contentDefinitionService.AddFieldToPart(viewModel.Name, viewModel.DisplayName, viewModel.FieldTypeName, partViewModel.Name);
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
Services.Notifier.Information(T("The \"{0}\" field was not added. {1}", viewModel.Name, ex.Message));
|
Services.Notifier.Information(T("The \"{0}\" field was not added. {1}", viewModel.DisplayName, ex.Message));
|
||||||
Services.TransactionManager.Cancel();
|
Services.TransactionManager.Cancel();
|
||||||
return AddFieldTo(id);
|
return AddFieldTo(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Services.Notifier.Information(T("The \"{0}\" field has been added.", viewModel.Name));
|
Services.Notifier.Information(T("The \"{0}\" field has been added.", viewModel.DisplayName));
|
||||||
|
|
||||||
if (typeViewModel != null) {
|
if (typeViewModel != null) {
|
||||||
return RedirectToAction("Edit", new {id});
|
return RedirectToAction("Edit", new {id});
|
||||||
|
|||||||
@@ -145,8 +145,30 @@ namespace Orchard.ContentTypes.Services {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveType(string name) {
|
public void RemoveType(string name, bool deleteContent) {
|
||||||
throw new NotImplementedException();
|
|
||||||
|
// first remove all attached parts
|
||||||
|
var typeDefinition = _contentDefinitionManager.GetTypeDefinition(name);
|
||||||
|
var partDefinitions = typeDefinition.Parts.ToArray();
|
||||||
|
foreach (var partDefinition in partDefinitions) {
|
||||||
|
RemovePartFromType(partDefinition.PartDefinition.Name, name);
|
||||||
|
|
||||||
|
// delete the part if it's its own part
|
||||||
|
if(partDefinition.PartDefinition.Name == name) {
|
||||||
|
RemovePart(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_contentDefinitionManager.DeleteTypeDefinition(name);
|
||||||
|
|
||||||
|
// delete all content items (but keep versions)
|
||||||
|
if (deleteContent) {
|
||||||
|
var contentItems = Services.ContentManager.Query(name).List();
|
||||||
|
foreach (var contentItem in contentItems) {
|
||||||
|
Services.ContentManager.Remove(contentItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddPartToType(string partName, string typeName) {
|
public void AddPartToType(string partName, string typeName) {
|
||||||
@@ -211,7 +233,13 @@ namespace Orchard.ContentTypes.Services {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void RemovePart(string name) {
|
public void RemovePart(string name) {
|
||||||
throw new NotImplementedException();
|
var partDefinition = _contentDefinitionManager.GetPartDefinition(name);
|
||||||
|
var fieldDefinitions = partDefinition.Fields.ToArray();
|
||||||
|
foreach(var fieldDefinition in fieldDefinitions) {
|
||||||
|
RemoveFieldFromPart(fieldDefinition.Name, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
_contentDefinitionManager.DeletePartDefinition(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<ContentFieldInfo> GetFields() {
|
public IEnumerable<ContentFieldInfo> GetFields() {
|
||||||
@@ -219,12 +247,16 @@ namespace Orchard.ContentTypes.Services {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void AddFieldToPart(string fieldName, string fieldTypeName, string partName) {
|
public void AddFieldToPart(string fieldName, string fieldTypeName, string partName) {
|
||||||
|
AddFieldToPart(fieldName, fieldName, fieldTypeName, partName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddFieldToPart(string fieldName, string displayName, string fieldTypeName, string partName) {
|
||||||
fieldName = fieldName.ToSafeName();
|
fieldName = fieldName.ToSafeName();
|
||||||
if (string.IsNullOrEmpty(fieldName)) {
|
if (string.IsNullOrEmpty(fieldName)) {
|
||||||
throw new OrchardException(T("Fields must have a name containing no spaces or symbols."));
|
throw new OrchardException(T("Fields must have a name containing no spaces or symbols."));
|
||||||
}
|
}
|
||||||
_contentDefinitionManager.AlterPartDefinition(partName,
|
_contentDefinitionManager.AlterPartDefinition(partName,
|
||||||
partBuilder => partBuilder.WithField(fieldName, fieldBuilder => fieldBuilder.OfType(fieldTypeName)));
|
partBuilder => partBuilder.WithField(fieldName, fieldBuilder => fieldBuilder.OfType(fieldTypeName).WithDisplayName(displayName)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveFieldFromPart(string fieldName, string partName) {
|
public void RemoveFieldFromPart(string fieldName, string partName) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace Orchard.ContentTypes.Services {
|
|||||||
EditTypeViewModel GetType(string name);
|
EditTypeViewModel GetType(string name);
|
||||||
ContentTypeDefinition AddType(string name, string displayName);
|
ContentTypeDefinition AddType(string name, string displayName);
|
||||||
void AlterType(EditTypeViewModel typeViewModel, IUpdateModel updater);
|
void AlterType(EditTypeViewModel typeViewModel, IUpdateModel updater);
|
||||||
void RemoveType(string name);
|
void RemoveType(string name, bool deleteContent);
|
||||||
void AddPartToType(string partName, string typeName);
|
void AddPartToType(string partName, string typeName);
|
||||||
void RemovePartFromType(string partName, string typeName);
|
void RemovePartFromType(string partName, string typeName);
|
||||||
string GenerateContentTypeNameFromDisplayName(string displayName);
|
string GenerateContentTypeNameFromDisplayName(string displayName);
|
||||||
@@ -24,6 +24,7 @@ namespace Orchard.ContentTypes.Services {
|
|||||||
|
|
||||||
IEnumerable<ContentFieldInfo> GetFields();
|
IEnumerable<ContentFieldInfo> GetFields();
|
||||||
void AddFieldToPart(string fieldName, string fieldTypeName, string partName);
|
void AddFieldToPart(string fieldName, string fieldTypeName, string partName);
|
||||||
|
void AddFieldToPart(string fieldName, string displayName, string fieldTypeName, string partName);
|
||||||
void RemoveFieldFromPart(string fieldName, string partName);
|
void RemoveFieldFromPart(string fieldName, string partName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,6 +21,8 @@ namespace Orchard.DesignerTools.Services {
|
|||||||
private readonly IThemeManager _themeManager;
|
private readonly IThemeManager _themeManager;
|
||||||
private readonly IWebSiteFolder _webSiteFolder;
|
private readonly IWebSiteFolder _webSiteFolder;
|
||||||
private readonly IAuthorizer _authorizer;
|
private readonly IAuthorizer _authorizer;
|
||||||
|
private bool _processing;
|
||||||
|
|
||||||
private int _shapeId;
|
private int _shapeId;
|
||||||
|
|
||||||
public ShapeTracingFactory(
|
public ShapeTracingFactory(
|
||||||
@@ -57,6 +59,13 @@ namespace Orchard.DesignerTools.Services {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// prevent reentrance as some methods could create new shapes, and trigger this event
|
||||||
|
if(_processing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_processing = true;
|
||||||
|
|
||||||
if (context.ShapeType != "Layout"
|
if (context.ShapeType != "Layout"
|
||||||
&& context.ShapeType != "DocumentZone"
|
&& context.ShapeType != "DocumentZone"
|
||||||
&& context.ShapeType != "PlaceChildContent"
|
&& context.ShapeType != "PlaceChildContent"
|
||||||
@@ -66,16 +75,19 @@ namespace Orchard.DesignerTools.Services {
|
|||||||
&& context.ShapeType != "DateTimeRelative") {
|
&& context.ShapeType != "DateTimeRelative") {
|
||||||
|
|
||||||
var shapeMetadata = (ShapeMetadata)context.Shape.Metadata;
|
var shapeMetadata = (ShapeMetadata)context.Shape.Metadata;
|
||||||
var currentTheme = _themeManager.GetRequestTheme(_workContext.HttpContext.Request.RequestContext);
|
var currentTheme = _workContext.CurrentTheme;
|
||||||
var shapeTable = _shapeTableManager.GetShapeTable(currentTheme.Id);
|
var shapeTable = _shapeTableManager.GetShapeTable(currentTheme.Id);
|
||||||
|
|
||||||
if (!shapeTable.Descriptors.ContainsKey(shapeMetadata.Type)) {
|
if (!shapeTable.Descriptors.ContainsKey(shapeMetadata.Type)) {
|
||||||
|
_processing = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
shapeMetadata.Wrappers.Add("ShapeTracingWrapper");
|
shapeMetadata.Wrappers.Add("ShapeTracingWrapper");
|
||||||
shapeMetadata.OnDisplaying(OnDisplaying);
|
shapeMetadata.OnDisplaying(OnDisplaying);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_processing = false;
|
||||||
}
|
}
|
||||||
public void Displaying(ShapeDisplayingContext context) {}
|
public void Displaying(ShapeDisplayingContext context) {}
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="NuGet.Core, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="NuGet.Core, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
|
||||||
<HintPath>..\..\..\..\lib\nuget\NuGet.Core.dll</HintPath>
|
<HintPath>..\..\..\..\lib\nuget\NuGet.Core.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ using Orchard.ContentManagement.Drivers;
|
|||||||
using Orchard.Users.Models;
|
using Orchard.Users.Models;
|
||||||
|
|
||||||
namespace Orchard.Users.Drivers {
|
namespace Orchard.Users.Drivers {
|
||||||
|
/// <summary>
|
||||||
|
/// This class intentionnaly has no Display method to prevent external access to this information through standard
|
||||||
|
/// Content Item display methods.
|
||||||
|
/// </summary>
|
||||||
public class UserPartDriver : ContentPartDriver<UserPart> {
|
public class UserPartDriver : ContentPartDriver<UserPart> {
|
||||||
|
|
||||||
protected override void Importing(UserPart part, ContentManagement.Handlers.ImportContentContext context) {
|
protected override void Importing(UserPart part, ContentManagement.Handlers.ImportContentContext context) {
|
||||||
|
|||||||
@@ -16,7 +16,5 @@ namespace Orchard.Users.ViewModels {
|
|||||||
|
|
||||||
[Required, DataType(DataType.Password)]
|
[Required, DataType(DataType.Password)]
|
||||||
public string ConfirmPassword { get; set; }
|
public string ConfirmPassword { get; set; }
|
||||||
|
|
||||||
public IContent User { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -59,6 +59,10 @@
|
|||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\lib\fluentnhibernate\NHibernate.ByteCode.Castle.dll</HintPath>
|
<HintPath>..\..\lib\fluentnhibernate\NHibernate.ByteCode.Castle.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="NuGet.Core, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\lib\nuget\NuGet.Core.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\lib\sqlce\System.Data.SqlServerCe.dll</HintPath>
|
<HintPath>..\..\lib\sqlce\System.Data.SqlServerCe.dll</HintPath>
|
||||||
|
|||||||
@@ -10,15 +10,19 @@ namespace Orchard.Utility {
|
|||||||
public static string GetNext(IEnumerable<MenuItem> menuItems) {
|
public static string GetNext(IEnumerable<MenuItem> menuItems) {
|
||||||
|
|
||||||
var maxMenuItem = menuItems.Where(mi => PositionHasMajorNumber(mi)).OrderByDescending(mi => mi.Position, new FlatPositionComparer()).FirstOrDefault();
|
var maxMenuItem = menuItems.Where(mi => PositionHasMajorNumber(mi)).OrderByDescending(mi => mi.Position, new FlatPositionComparer()).FirstOrDefault();
|
||||||
var positionParts = maxMenuItem.Position.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries).Where(s => s.Trim().Length > 0);
|
|
||||||
if (positionParts.Count() > 0) {
|
// are there any menu item ?
|
||||||
int result;
|
if (maxMenuItem != null) {
|
||||||
if (int.TryParse(positionParts.ElementAt(0), out result)) {
|
|
||||||
return (result + 1).ToString();
|
var positionParts = maxMenuItem.Position.Split(new[] {'.'}, StringSplitOptions.RemoveEmptyEntries).Where(s => s.Trim().Length > 0).ToList();
|
||||||
|
if (positionParts.Any()) {
|
||||||
|
int result;
|
||||||
|
if (int.TryParse(positionParts.ElementAt(0), out result)) {
|
||||||
|
return (result + 1).ToString(CultureInfo.InvariantCulture);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return "1";
|
return "1";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,7 +34,7 @@ namespace Orchard.Utility {
|
|||||||
// first one in this major position number
|
// first one in this major position number
|
||||||
return majorStr;
|
return majorStr;
|
||||||
}
|
}
|
||||||
var positionParts = maxMenuItem.Position.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries).Where(s => s.Trim().Length > 0);
|
var positionParts = maxMenuItem.Position.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries).Where(s => s.Trim().Length > 0).ToList();
|
||||||
if (positionParts.Count() > 1) {
|
if (positionParts.Count() > 1) {
|
||||||
int result;
|
int result;
|
||||||
if (int.TryParse(positionParts.ElementAt(1), out result)) {
|
if (int.TryParse(positionParts.ElementAt(1), out result)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user