-
@Html.ItemAdminLink(contentItem)
-
@contentItem.ContentType
+
@Html.ItemAdminLink(contentItem)
-
@contentItem.TypeDefinition.DisplayName
@if (Model.Header != null) {
}
diff --git a/src/Orchard.Web/Modules/Markdown/Scripts/orchard-markdown.js b/src/Orchard.Web/Modules/Markdown/Scripts/orchard-markdown.js
index a6fb815d4..121228a35 100644
--- a/src/Orchard.Web/Modules/Markdown/Scripts/orchard-markdown.js
+++ b/src/Orchard.Web/Modules/Markdown/Scripts/orchard-markdown.js
@@ -1,7 +1,9 @@
(function () {
var marker = '';
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) {
// see if there's an image selected that they intend on editing
diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/RemoteBlogPublishingController.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/RemoteBlogPublishingController.cs
index f5da96177..73f9c3d4d 100644
--- a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/RemoteBlogPublishingController.cs
+++ b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/RemoteBlogPublishingController.cs
@@ -6,6 +6,7 @@ using Orchard.Blogs.Models;
using Orchard.Blogs.Services;
using Orchard.Environment.Extensions;
using Orchard.Logging;
+using Orchard.Mvc.Extensions;
namespace Orchard.Blogs.Controllers {
[OrchardFeature("Orchard.Blogs.RemotePublishing")]
@@ -32,7 +33,7 @@ namespace Orchard.Blogs.Controllers {
const string manifestUri = "http://archipelago.phrasewise.com/rsd";
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(
XName.Get("service", manifestUri),
diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.ContentTypes/Controllers/AdminController.cs
index be8c8e78b..db04dadad 100644
--- a/src/Orchard.Web/Modules/Orchard.ContentTypes/Controllers/AdminController.cs
+++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/Controllers/AdminController.cs
@@ -159,13 +159,7 @@ namespace Orchard.ContentTypes.Controllers {
if (typeViewModel == null)
return HttpNotFound();
- _contentDefinitionManager.DeleteTypeDefinition(id);
-
- // delete all content items (but keep versions)
- var contentItems = Services.ContentManager.Query(id).List();
- foreach (var contentItem in contentItems) {
- Services.ContentManager.Remove(contentItem);
- }
+ _contentDefinitionService.RemoveType(id, true);
Services.Notifier.Information(T("\"{0}\" has been removed.", typeViewModel.DisplayName));
@@ -348,7 +342,8 @@ namespace Orchard.ContentTypes.Controllers {
if (partViewModel == null)
return HttpNotFound();
- _contentDefinitionManager.DeletePartDefinition(id);
+ _contentDefinitionService.RemovePart(id);
+
Services.Notifier.Information(T("\"{0}\" has been removed.", partViewModel.DisplayName));
return RedirectToAction("ListParts");
@@ -434,15 +429,15 @@ namespace Orchard.ContentTypes.Controllers {
}
try {
- _contentDefinitionService.AddFieldToPart(viewModel.Name, viewModel.FieldTypeName, partViewModel.Name);
+ _contentDefinitionService.AddFieldToPart(viewModel.Name, viewModel.DisplayName, viewModel.FieldTypeName, partViewModel.Name);
}
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();
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) {
return RedirectToAction("Edit", new {id});
diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/Services/ContentDefinitionService.cs b/src/Orchard.Web/Modules/Orchard.ContentTypes/Services/ContentDefinitionService.cs
index b10db015a..8db21adb0 100644
--- a/src/Orchard.Web/Modules/Orchard.ContentTypes/Services/ContentDefinitionService.cs
+++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/Services/ContentDefinitionService.cs
@@ -145,8 +145,30 @@ namespace Orchard.ContentTypes.Services {
});
}
- public void RemoveType(string name) {
- throw new NotImplementedException();
+ public void RemoveType(string name, bool deleteContent) {
+
+ // 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) {
@@ -211,7 +233,13 @@ namespace Orchard.ContentTypes.Services {
}
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
GetFields() {
@@ -219,12 +247,16 @@ namespace Orchard.ContentTypes.Services {
}
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();
if (string.IsNullOrEmpty(fieldName)) {
throw new OrchardException(T("Fields must have a name containing no spaces or symbols."));
}
_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) {
diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/Services/IContentDefinitionService.cs b/src/Orchard.Web/Modules/Orchard.ContentTypes/Services/IContentDefinitionService.cs
index 646876140..a7ee5136d 100644
--- a/src/Orchard.Web/Modules/Orchard.ContentTypes/Services/IContentDefinitionService.cs
+++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/Services/IContentDefinitionService.cs
@@ -10,7 +10,7 @@ namespace Orchard.ContentTypes.Services {
EditTypeViewModel GetType(string name);
ContentTypeDefinition AddType(string name, string displayName);
void AlterType(EditTypeViewModel typeViewModel, IUpdateModel updater);
- void RemoveType(string name);
+ void RemoveType(string name, bool deleteContent);
void AddPartToType(string partName, string typeName);
void RemovePartFromType(string partName, string typeName);
string GenerateContentTypeNameFromDisplayName(string displayName);
@@ -24,6 +24,7 @@ namespace Orchard.ContentTypes.Services {
IEnumerable GetFields();
void AddFieldToPart(string fieldName, string fieldTypeName, string partName);
+ void AddFieldToPart(string fieldName, string displayName, string fieldTypeName, string partName);
void RemoveFieldFromPart(string fieldName, string partName);
}
}
\ No newline at end of file
diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Services/ShapeTracingFactory.cs b/src/Orchard.Web/Modules/Orchard.DesignerTools/Services/ShapeTracingFactory.cs
index 31e09dc84..730690920 100644
--- a/src/Orchard.Web/Modules/Orchard.DesignerTools/Services/ShapeTracingFactory.cs
+++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Services/ShapeTracingFactory.cs
@@ -21,6 +21,8 @@ namespace Orchard.DesignerTools.Services {
private readonly IThemeManager _themeManager;
private readonly IWebSiteFolder _webSiteFolder;
private readonly IAuthorizer _authorizer;
+ private bool _processing;
+
private int _shapeId;
public ShapeTracingFactory(
@@ -57,6 +59,13 @@ namespace Orchard.DesignerTools.Services {
return;
}
+ // prevent reentrance as some methods could create new shapes, and trigger this event
+ if(_processing) {
+ return;
+ }
+
+ _processing = true;
+
if (context.ShapeType != "Layout"
&& context.ShapeType != "DocumentZone"
&& context.ShapeType != "PlaceChildContent"
@@ -66,16 +75,19 @@ namespace Orchard.DesignerTools.Services {
&& context.ShapeType != "DateTimeRelative") {
var shapeMetadata = (ShapeMetadata)context.Shape.Metadata;
- var currentTheme = _themeManager.GetRequestTheme(_workContext.HttpContext.Request.RequestContext);
+ var currentTheme = _workContext.CurrentTheme;
var shapeTable = _shapeTableManager.GetShapeTable(currentTheme.Id);
if (!shapeTable.Descriptors.ContainsKey(shapeMetadata.Type)) {
+ _processing = false;
return;
}
shapeMetadata.Wrappers.Add("ShapeTracingWrapper");
shapeMetadata.OnDisplaying(OnDisplaying);
}
+
+ _processing = false;
}
public void Displaying(ShapeDisplayingContext context) {}
diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Orchard.Packaging.csproj b/src/Orchard.Web/Modules/Orchard.Packaging/Orchard.Packaging.csproj
index 71fb5c29f..3b74bc760 100644
--- a/src/Orchard.Web/Modules/Orchard.Packaging/Orchard.Packaging.csproj
+++ b/src/Orchard.Web/Modules/Orchard.Packaging/Orchard.Packaging.csproj
@@ -36,8 +36,7 @@
-
- False
+
..\..\..\..\lib\nuget\NuGet.Core.dll
True
diff --git a/src/Orchard.Web/Modules/Orchard.Users/Drivers/UserPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Users/Drivers/UserPartDriver.cs
index c5e8723ae..9adfdf6c4 100644
--- a/src/Orchard.Web/Modules/Orchard.Users/Drivers/UserPartDriver.cs
+++ b/src/Orchard.Web/Modules/Orchard.Users/Drivers/UserPartDriver.cs
@@ -4,6 +4,10 @@ using Orchard.ContentManagement.Drivers;
using Orchard.Users.Models;
namespace Orchard.Users.Drivers {
+ ///
+ /// This class intentionnaly has no Display method to prevent external access to this information through standard
+ /// Content Item display methods.
+ ///
public class UserPartDriver : ContentPartDriver {
protected override void Importing(UserPart part, ContentManagement.Handlers.ImportContentContext context) {
diff --git a/src/Orchard.Web/Modules/Orchard.Users/ViewModels/UserCreateViewModel.cs b/src/Orchard.Web/Modules/Orchard.Users/ViewModels/UserCreateViewModel.cs
index e4ce8eef7..6ab786368 100644
--- a/src/Orchard.Web/Modules/Orchard.Users/ViewModels/UserCreateViewModel.cs
+++ b/src/Orchard.Web/Modules/Orchard.Users/ViewModels/UserCreateViewModel.cs
@@ -16,7 +16,5 @@ namespace Orchard.Users.ViewModels {
[Required, DataType(DataType.Password)]
public string ConfirmPassword { get; set; }
-
- public IContent User { get; set; }
}
}
\ No newline at end of file
diff --git a/src/Orchard.Web/Orchard.Web.csproj b/src/Orchard.Web/Orchard.Web.csproj
index 4f7b7f18b..4cbb3bf28 100644
--- a/src/Orchard.Web/Orchard.Web.csproj
+++ b/src/Orchard.Web/Orchard.Web.csproj
@@ -59,6 +59,10 @@
False
..\..\lib\fluentnhibernate\NHibernate.ByteCode.Castle.dll
+
+ ..\..\lib\nuget\NuGet.Core.dll
+ True
+
False
..\..\lib\sqlce\System.Data.SqlServerCe.dll
diff --git a/src/Orchard/Utility/Position.cs b/src/Orchard/Utility/Position.cs
index 66fc7aa19..88b369583 100644
--- a/src/Orchard/Utility/Position.cs
+++ b/src/Orchard/Utility/Position.cs
@@ -10,15 +10,19 @@ namespace Orchard.Utility {
public static string GetNext(IEnumerable