mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Merge branch '1.9.x' into dev
Conflicts: README.md src/Orchard.Web/Modules/Orchard.DynamicForms/Controllers/FormController.cs src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/CheckboxElementDriver.cs src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/EmailFieldElementDriver.cs src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/EnumerationElementDriver.cs src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/HiddenFieldElementDriver.cs src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/RadioButtonElementDriver.cs src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/TextAreaElementDriver.cs src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/TextFieldElementDriver.cs src/Orchard.Web/Modules/Orchard.Layouts/Drivers/HeadingElementDriver.cs src/Orchard.Web/Modules/Orchard.Layouts/Drivers/HtmlElementDriver.cs src/Orchard.Web/Modules/Orchard.Layouts/Drivers/MarkdownElementDriver.cs src/Orchard.Web/Modules/Orchard.Layouts/Drivers/TextElementDriver.cs src/Orchard.Web/Modules/Orchard.Layouts/Filters/TokensFilter.cs src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj src/Orchard.Web/Modules/Orchard.Layouts/Views/Elements/Html.cshtml src/Orchard/Orchard.Framework.csproj
This commit is contained in:
@@ -8,15 +8,15 @@ Orchard is a free, open source, community-focused Content Management System buil
|
||||
|
||||
#### Please visit our website at http://orchardproject.net for the most current information about this project.
|
||||
|
||||
Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
|
||||
Orchard is a free, open source, community-focused **Content Management System** built on the ASP.NET MVC platform.
|
||||
|
||||
Orchard is built on a modern architecture that puts extensibility up-front, as its number one concern. All components in Orchard can be replaced or extended. Content is built from easily composable building blocks. Modules extend the system in a very decoupled fashion, where a commenting module for example can as easily apply to pages, blog posts, photos or products. A rich UI composition system completes the picture and ensures that you can get the exact presentation that you need for your content.
|
||||
|
||||
Orchard is delivered under the .NET Foundation. It is licensed under a New BSD license, which is approved by the OSI.
|
||||
Orchard is delivered under the [.NET Foundation](http://www.dotnetfoundation.org/orchard). It is licensed under a [New BSD license](http://www.opensource.org/licenses/bsd-license.php), which is approved by the OSI.
|
||||
|
||||
Our mission is to empower our users and foster a dedicated and diverse community that builds the CMS that we all want to use.
|
||||
|
||||
There are many ways you can contribute to Orchard: you can fix bugs, contribute modules and themes to our gallery, write documentation, translate Orchard, or answer questions on our forums and on Stack Overflow.
|
||||
There are many ways you can [contribute to Orchard](http://orchardproject.net/contribution): you can [fix bugs](https://github.com/OrchardCMS/Orchard/issues), contribute modules and themes to [our gallery](http://gallery.orchardproject.net/), [write documentation](https://github.com/OrchardCMS/OrchardDoc), [translate Orchard](http://orchardproject.net/localize), or answer questions [on our forums](http://orchard.codeplex.com/discussions) and [on Stack Overflow](http://stackoverflow.com/questions/tagged/orchardcms).
|
||||
|
||||
## Project Status
|
||||
Orchard is currently in version 1.9. We invite participation by the developer community in shaping the project’s direction, so that we can publicly validate our designs and development approach.
|
||||
|
@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
@@ -0,0 +1,43 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Localization.Services;
|
||||
|
||||
namespace Orchard.Tests.Localization {
|
||||
|
||||
[TestFixture]
|
||||
public class LocalizationStreamParserTests {
|
||||
|
||||
[Test]
|
||||
public void ShouldTrimLeadingQuotes() {
|
||||
var parser = new LocalizationStreamParser();
|
||||
|
||||
var text = new StringBuilder();
|
||||
text.AppendLine("#: ~/Themes/MyTheme/Views/MyView.cshtml");
|
||||
text.AppendLine("msgctxt \"~/Themes/MyTheme/Views/MyView.cshtml\"");
|
||||
text.AppendLine("msgid \"\\\"{0}\\\" Foo\"");
|
||||
text.AppendLine("msgstr \"\\\"{0}\\\" Foo\"");
|
||||
|
||||
var translations = new Dictionary<string, string>();
|
||||
parser.ParseLocalizationStream(text.ToString(), translations, false);
|
||||
|
||||
Assert.AreEqual("\"{0}\" Foo", translations["~/themes/mytheme/views/myview.cshtml|\"{0}\" foo"]);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldTrimTrailingQuotes() {
|
||||
var parser = new LocalizationStreamParser();
|
||||
|
||||
var text = new StringBuilder();
|
||||
text.AppendLine("#: ~/Themes/MyTheme/Views/MyView.cshtml");
|
||||
text.AppendLine("msgctxt \"~/Themes/MyTheme/Views/MyView.cshtml\"");
|
||||
text.AppendLine("msgid \"Foo \\\"{0}\\\"\"");
|
||||
text.AppendLine("msgstr \"Foo \\\"{0}\\\"\"");
|
||||
|
||||
var translations = new Dictionary<string, string>();
|
||||
parser.ParseLocalizationStream(text.ToString(), translations, false);
|
||||
|
||||
Assert.AreEqual("Foo \"{0}\"", translations["~/themes/mytheme/views/myview.cshtml|foo \"{0}\""]);
|
||||
}
|
||||
}
|
||||
}
|
@@ -259,6 +259,7 @@
|
||||
<Compile Include="FileSystems\Dependencies\AssemblyProbingFolderTests.cs" />
|
||||
<Compile Include="FileSystems\Dependencies\DependenciesFolderTests.cs" />
|
||||
<Compile Include="FileSystems\VirtualPath\DefaultVirtualPathProviderTests.cs" />
|
||||
<Compile Include="Localization\LocalizationStreamParserTests.cs" />
|
||||
<Compile Include="Localization\TextTests.cs" />
|
||||
<Compile Include="Localization\CurrentCultureWorkContextTests.cs" />
|
||||
<Compile Include="Localization\CultureManagerTests.cs" />
|
||||
|
@@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
@@ -32,8 +32,8 @@ using System.Security;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
||||
// Enable web application to call this assembly in Full Trust
|
||||
[assembly: AllowPartiallyTrustedCallers]
|
||||
|
@@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The common module introduces content parts that are going to be used by most content types (common, body, identity).
|
||||
FeatureDescription: Core content parts.
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The containers module introduces container and containable behaviors for content items.
|
||||
FeatureDescription: Container and containable parts to enable parent-child relationships between content items.
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The contents module enables the creation of custom content types.
|
||||
Features:
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The dashboard module is providing the dashboard screen of the admininstration UI of the application.
|
||||
FeatureDescription: Standard admin dashboard.
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The Feeds module is providing RSS feeds to content items.
|
||||
FeatureDescription: RSS feeds for content items.
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The navigation module creates and manages a simple navigation menu for the front-end of the application and allows you to add content items to the admin menu.
|
||||
FeatureDescription: Menu management.
|
||||
|
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The dashboard module is providing the reports screen of the application.
|
||||
FeatureDescription: Reports management.
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The scheduling module enables background task scheduling.
|
||||
FeatureDescription: Scheduled background tasks.
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The settings module creates site settings that other modules can contribute to.
|
||||
FeatureDescription: Site settings.
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The shapes module contains core shape templates and display hooks.
|
||||
FeatureDescription: Core shape templates and display hooks.
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The title module enables content items to have titles.
|
||||
FeatureDescription: Title content part.
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The XmlRpc module enables creation of contents from client applications such as LiveWriter.
|
||||
FeatureDescription: XML-RPC opt-in implementation.
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The Lucene module enables the site to be indexed using Lucene.NET. The index generated by this module can then be used by the search module to provide an integrated full-text search experience to a web site.
|
||||
FeatureDescription: Lucene indexing services.
|
||||
|
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The Markdown module enables rich text contents to be created using the Markdown syntax.
|
||||
FeatureDescription: Markdown editor.
|
||||
|
@@ -26,6 +26,6 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
||||
|
@@ -2,7 +2,7 @@ Name: Alias
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Maps friendly urls to specific module actions.
|
||||
FeatureDescription: Maps friendly urls to specific module actions.
|
||||
|
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
||||
|
@@ -2,7 +2,7 @@ Name: AntiSpam
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Provides anti-spam services to protect your content from malicious submissions.
|
||||
Features:
|
||||
|
@@ -29,6 +29,6 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
||||
|
@@ -3,7 +3,7 @@ Path: ArchiveLater
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The ArchiveLater module introduces scheduled archiving functionality.
|
||||
FeatureDescription: Scheduled archiving.
|
||||
|
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Provides a log for recording and viewing back-end changes.
|
||||
Features:
|
||||
|
@@ -2,7 +2,7 @@ Name: Autoroute
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Description for the module
|
||||
Features:
|
||||
|
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: Microsoft Open Technologies, Inc
|
||||
Website: http://msopentech.com
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Provides integration of Microsoft Azure Media Services functionality into Orchard.
|
||||
Features:
|
||||
|
@@ -32,6 +32,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
||||
|
@@ -75,7 +75,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0"/>
|
||||
+ <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Provides a set of Orchard service implementations targeting Microsoft Azure services.
|
||||
Category: Hosting
|
||||
|
@@ -31,6 +31,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The Orchard Blogs module is implementing basic blogging features.
|
||||
FeatureDescription: A simple web log.
|
||||
|
@@ -29,6 +29,6 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: Sébastien Ros
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Provides an API to cache business data.
|
||||
Features:
|
||||
|
@@ -31,6 +31,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Tools to create Orchard components.
|
||||
FeatureDescription: Tools to create Orchard components.
|
||||
|
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: The comments system implemented by this module can be applied to arbitrary Orchard content types, such as blogs and pages. It includes comment validation and spam protection through the Akismet service.
|
||||
Features:
|
||||
|
@@ -30,5 +30,5 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
@@ -2,7 +2,7 @@ Name: Orchard.ContentPermissions
|
||||
AntiForgery: enabled
|
||||
Author: Chris Pyle, S<>bastien Ros
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Allows item-level front end view permissions.
|
||||
Features:
|
||||
|
@@ -31,5 +31,5 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
@@ -2,7 +2,7 @@ Name: Orchard.ContentPicker
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardcontentpicker.codeplex.com
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: UI for selecting Content Items.
|
||||
Features:
|
||||
|
@@ -31,6 +31,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: ContentTypes modules enables the creation and alteration of content types not based on code.
|
||||
Dependencies: Contents
|
||||
|
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
||||
|
@@ -2,7 +2,7 @@ Name: Custom Forms
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardcustomforms.codeplex.com
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Create custom forms like contact forms or content contributions.
|
||||
Features:
|
||||
|
@@ -31,5 +31,5 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Contains designer tools to ease the Themes development process
|
||||
FeatureName: Shape Tracing
|
||||
|
@@ -31,5 +31,5 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.9.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0")]
|
||||
[assembly: AssemblyVersion("1.9.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.1")]
|
||||
|
@@ -6,6 +6,7 @@ using Orchard.DynamicForms.Services;
|
||||
using Orchard.Layouts.Services;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Tokens;
|
||||
using Orchard.UI.Notify;
|
||||
using Orchard.Utility.Extensions;
|
||||
using IController = Orchard.DynamicForms.Services.IController;
|
||||
@@ -15,15 +16,18 @@ namespace Orchard.DynamicForms.Controllers {
|
||||
private readonly INotifier _notifier;
|
||||
private readonly ILayoutManager _layoutManager;
|
||||
private readonly IFormService _formService;
|
||||
private readonly ITokenizer _tokenizer;
|
||||
|
||||
public FormController(
|
||||
INotifier notifier,
|
||||
ILayoutManager layoutManager,
|
||||
IFormService formService) {
|
||||
IFormService formService,
|
||||
ITokenizer tokenizer) {
|
||||
|
||||
_notifier = notifier;
|
||||
_layoutManager = layoutManager;
|
||||
_formService = formService;
|
||||
_tokenizer = tokenizer;
|
||||
T = NullLocalizer.Instance;
|
||||
Logger = NullLogger.Instance;
|
||||
}
|
||||
@@ -35,7 +39,7 @@ namespace Orchard.DynamicForms.Controllers {
|
||||
public ActionResult Submit(int contentId, string formName) {
|
||||
var layoutPart = _layoutManager.GetLayout(contentId);
|
||||
var form = _formService.FindForm(layoutPart, formName);
|
||||
var urlReferrer = Request.UrlReferrer != null && Request.IsLocalUrl(Request.UrlReferrer.ToString()) ? Request.UrlReferrer.ToString() : "~/";
|
||||
var urlReferrer = Request.UrlReferrer != null && Url.IsLocalUrl(Request.UrlReferrer.ToString()) ? Request.UrlReferrer.ToString() : "~/";
|
||||
|
||||
if (form == null) {
|
||||
Logger.Warning("The specified form \"{0}\" could not be found.", formName);
|
||||
@@ -43,7 +47,7 @@ namespace Orchard.DynamicForms.Controllers {
|
||||
return Redirect(urlReferrer);
|
||||
}
|
||||
|
||||
var values = _formService.SubmitForm(form, ValueProvider, ModelState, this);
|
||||
var values = _formService.SubmitForm(layoutPart, form, ValueProvider, ModelState, this);
|
||||
this.TransferFormSubmission(form, values);
|
||||
|
||||
if (!ModelState.IsValid)
|
||||
@@ -52,7 +56,7 @@ namespace Orchard.DynamicForms.Controllers {
|
||||
if(Response.IsRequestBeingRedirected)
|
||||
return new EmptyResult();
|
||||
|
||||
var redirectUrl = !String.IsNullOrWhiteSpace(form.RedirectUrl) ? form.RedirectUrl : urlReferrer;
|
||||
var redirectUrl = !String.IsNullOrWhiteSpace(form.RedirectUrl) ? _tokenizer.Replace(form.RedirectUrl, new { Content = layoutPart.ContentItem }) : urlReferrer;
|
||||
return Redirect(redirectUrl);
|
||||
}
|
||||
|
||||
|
@@ -1,11 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.DynamicForms.Elements;
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Tokens;
|
||||
using DescribeContext = Orchard.Forms.Services.DescribeContext;
|
||||
|
||||
namespace Orchard.DynamicForms.Drivers {
|
||||
public class ButtonElementDriver : FormsElementDriver<Button> {
|
||||
public ButtonElementDriver(IFormManager formManager) : base(formManager) { }
|
||||
private readonly ITokenizer _tokenizer;
|
||||
|
||||
public ButtonElementDriver(IFormManager formManager, ITokenizer tokenizer) : base(formManager) {
|
||||
_tokenizer = tokenizer;
|
||||
}
|
||||
|
||||
protected override IEnumerable<string> FormNames {
|
||||
get { yield return "Button"; }
|
||||
@@ -21,11 +29,16 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
Name: "Text",
|
||||
Title: "Text",
|
||||
Value: "Submit",
|
||||
Classes: new[] { "text", "medium" },
|
||||
Classes: new[] { "text", "medium", "tokenized" },
|
||||
Description: T("The button text.")));
|
||||
|
||||
return form;
|
||||
});
|
||||
}
|
||||
|
||||
protected override void OnDisplaying(Button element, ElementDisplayContext context) {
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData());
|
||||
context.ElementShape.ProcessedText = _tokenizer.Replace(element.Text, context.GetTokenData());
|
||||
}
|
||||
}
|
||||
}
|
@@ -2,6 +2,7 @@
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Tokens;
|
||||
using DescribeContext = Orchard.Forms.Services.DescribeContext;
|
||||
|
||||
@@ -65,7 +66,9 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
}
|
||||
|
||||
protected override void OnDisplaying(CheckBox element, ElementDisplayingContext context) {
|
||||
context.ElementShape.TokenizedValue = _tokenizer.Replace(element.RuntimeValue, null);
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData());
|
||||
context.ElementShape.ProcessedValue = _tokenizer.Replace(element.RuntimeValue, context.GetTokenData());
|
||||
}
|
||||
}
|
||||
}
|
@@ -2,6 +2,7 @@
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Tokens;
|
||||
using DescribeContext = Orchard.Forms.Services.DescribeContext;
|
||||
|
||||
@@ -76,7 +77,9 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
}
|
||||
|
||||
protected override void OnDisplaying(EmailField element, ElementDisplayingContext context) {
|
||||
context.ElementShape.TokenizedValue = _tokenizer.Replace(element.RuntimeValue, null);
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData());
|
||||
context.ElementShape.ProcessedValue = _tokenizer.Replace(element.RuntimeValue, context.GetTokenData());
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.DynamicForms.Elements;
|
||||
@@ -7,8 +6,8 @@ using Orchard.DynamicForms.Helpers;
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Tokens;
|
||||
using Orchard.Utility.Extensions;
|
||||
using DescribeContext = Orchard.Forms.Services.DescribeContext;
|
||||
|
||||
namespace Orchard.DynamicForms.Drivers {
|
||||
@@ -80,11 +79,13 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
}
|
||||
|
||||
protected override void OnDisplaying(Enumeration element, ElementDisplayingContext context) {
|
||||
var tokenizedOptions = _tokenizer.Replace(element.Options).ToArray();
|
||||
var typeName = element.GetType().Name;
|
||||
var displayType = context.DisplayType;
|
||||
var tokenData = context.GetTokenData();
|
||||
|
||||
context.ElementShape.TokenizedOptions = tokenizedOptions;
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, tokenData);
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, tokenData);
|
||||
context.ElementShape.ProcessedOptions = _tokenizer.Replace(element.Options, tokenData).ToArray();
|
||||
context.ElementShape.Metadata.Alternates.Add(String.Format("Elements_{0}__{1}", typeName, element.InputType));
|
||||
context.ElementShape.Metadata.Alternates.Add(String.Format("Elements_{0}_{1}__{2}", typeName, displayType, element.InputType));
|
||||
}
|
||||
|
@@ -1,7 +1,19 @@
|
||||
using Orchard.DynamicForms.Elements;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Tokens;
|
||||
|
||||
namespace Orchard.DynamicForms.Drivers {
|
||||
public class FieldsetElementDriver : ElementDriver<Fieldset> {
|
||||
private readonly ITokenizer _tokenizer;
|
||||
|
||||
public FieldsetElementDriver(ITokenizer tokenizer) {
|
||||
_tokenizer = tokenizer;
|
||||
}
|
||||
|
||||
protected override void OnDisplaying(Fieldset element, ElementDisplayContext context) {
|
||||
context.ElementShape.ProcessedLegend = _tokenizer.Replace(element.Legend, context.GetTokenData());
|
||||
}
|
||||
}
|
||||
}
|
@@ -10,9 +10,10 @@ using Orchard.DynamicForms.Services;
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Framework.Elements;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Layouts.Services;
|
||||
using Orchard.Tokens;
|
||||
using DescribeContext = Orchard.Forms.Services.DescribeContext;
|
||||
|
||||
namespace Orchard.DynamicForms.Drivers {
|
||||
public class FormElementDriver : FormsElementDriver<Form> {
|
||||
@@ -20,19 +21,22 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
private readonly IFormService _formService;
|
||||
private readonly ICurrentControllerAccessor _currentControllerAccessor;
|
||||
private readonly ICultureAccessor _cultureAccessor;
|
||||
private readonly ITokenizer _tokenizer;
|
||||
|
||||
public FormElementDriver(
|
||||
IFormManager formManager,
|
||||
IContentDefinitionManager contentDefinitionManager,
|
||||
IFormService formService,
|
||||
ICurrentControllerAccessor currentControllerAccessor,
|
||||
ICultureAccessor cultureAccessor)
|
||||
ICultureAccessor cultureAccessor,
|
||||
ITokenizer tokenizer)
|
||||
|
||||
: base(formManager) {
|
||||
_contentDefinitionManager = contentDefinitionManager;
|
||||
_formService = formService;
|
||||
_currentControllerAccessor = currentControllerAccessor;
|
||||
_cultureAccessor = cultureAccessor;
|
||||
_tokenizer = tokenizer;
|
||||
}
|
||||
|
||||
protected override IEnumerable<string> FormNames {
|
||||
@@ -145,6 +149,10 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
foreach (var child in element.Elements.Flatten().Where(x => x is FormElement).Cast<FormElement>()) {
|
||||
child.FormBindingContentType = element.CreateContent == true ? element.FormBindingContentType : default(string);
|
||||
}
|
||||
|
||||
// Set tokenized properties.
|
||||
var tokenData = context.GetTokenData();
|
||||
context.ElementShape.ProcessedAction = _tokenizer.Replace(element.Action, tokenData);
|
||||
}
|
||||
|
||||
private static bool IsFormBindingContentType(ContentTypeDefinition contentTypeDefinition) {
|
||||
|
@@ -3,6 +3,7 @@ using Orchard.DynamicForms.Elements;
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Tokens;
|
||||
using DescribeContext = Orchard.Forms.Services.DescribeContext;
|
||||
|
||||
@@ -34,7 +35,8 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
}
|
||||
|
||||
protected override void OnDisplaying(HiddenField element, ElementDisplayingContext context) {
|
||||
context.ElementShape.TokenizedValue = _tokenizer.Replace(element.Value, null);
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData());
|
||||
context.ElementShape.ProcessedValue = _tokenizer.Replace(element.Value, context.GetTokenData());
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.DynamicForms.Elements;
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Tokens;
|
||||
using DescribeContext = Orchard.Forms.Services.DescribeContext;
|
||||
|
||||
namespace Orchard.DynamicForms.Drivers {
|
||||
public class LabelElementDriver : FormsElementDriver<Label> {
|
||||
public LabelElementDriver(IFormManager formManager) : base(formManager) {}
|
||||
private readonly ITokenizer _tokenizer;
|
||||
|
||||
public LabelElementDriver(IFormManager formManager, ITokenizer tokenizer) : base(formManager) {
|
||||
_tokenizer = tokenizer;
|
||||
}
|
||||
|
||||
protected override IEnumerable<string> FormNames {
|
||||
get { yield return "Label"; }
|
||||
@@ -20,17 +28,22 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
Id: "LabelText",
|
||||
Name: "LabelText",
|
||||
Title: "Text",
|
||||
Classes: new[] { "text", "large" },
|
||||
Classes: new[] { "text", "large", "tokenized" },
|
||||
Description: T("The label text.")),
|
||||
_LabelFor: shape.Textbox(
|
||||
Id: "LabelFor",
|
||||
Name: "LabelFor",
|
||||
Title: "For",
|
||||
Classes: new[] { "text", "large" },
|
||||
Classes: new[] { "text", "large", "tokenized" },
|
||||
Description: T("The name of the field this label is for.")));
|
||||
|
||||
return form;
|
||||
});
|
||||
}
|
||||
|
||||
protected override void OnDisplaying(Label element, ElementDisplayContext context) {
|
||||
context.ElementShape.ProcessedText = _tokenizer.Replace(element.Text, context.GetTokenData());
|
||||
context.ElementShape.ProcessedFor = _tokenizer.Replace(element.For, context.GetTokenData());
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +1,18 @@
|
||||
using Orchard.DynamicForms.Elements;
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Tokens;
|
||||
using DescribeContext = Orchard.Forms.Services.DescribeContext;
|
||||
|
||||
namespace Orchard.DynamicForms.Drivers {
|
||||
public class PasswordFieldElementDriver : FormsElementDriver<PasswordField>{
|
||||
public PasswordFieldElementDriver(IFormManager formManager) : base(formManager) {}
|
||||
private readonly ITokenizer _tokenizer;
|
||||
|
||||
public PasswordFieldElementDriver(IFormManager formManager, ITokenizer tokenizer) : base(formManager) {
|
||||
_tokenizer = tokenizer;
|
||||
}
|
||||
|
||||
protected override EditorResult OnBuildEditor(PasswordField element, ElementEditorContext context) {
|
||||
var autoLabelEditor = BuildForm(context, "AutoLabel");
|
||||
@@ -65,5 +72,10 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
return form;
|
||||
});
|
||||
}
|
||||
|
||||
protected override void OnDisplaying(PasswordField element, ElementDisplayContext context) {
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData());
|
||||
}
|
||||
}
|
||||
}
|
@@ -6,10 +6,12 @@ using System.Web.Mvc;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Title.Models;
|
||||
using Orchard.DynamicForms.Elements;
|
||||
using Orchard.DynamicForms.Helpers;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Projections.Models;
|
||||
using Orchard.Projections.Services;
|
||||
using Orchard.Tokens;
|
||||
@@ -119,25 +121,27 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
protected override void OnDisplaying(Query element, ElementDisplayingContext context) {
|
||||
var queryId = element.QueryId;
|
||||
var typeName = element.GetType().Name;
|
||||
var category = element.Category.ToSafeName();
|
||||
var displayType = context.DisplayType;
|
||||
var tokenData = context.GetTokenData();
|
||||
|
||||
context.ElementShape.Options = GetOptions(element, queryId).ToArray();
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, tokenData);
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, tokenData);
|
||||
context.ElementShape.Options = GetOptions(element, context.DisplayType, queryId, tokenData).ToArray();
|
||||
context.ElementShape.Metadata.Alternates.Add(String.Format("Elements_{0}__{1}", typeName, element.InputType));
|
||||
context.ElementShape.Metadata.Alternates.Add(String.Format("Elements_{0}_{1}__{2}", typeName, displayType, element.InputType));
|
||||
}
|
||||
|
||||
private IEnumerable<SelectListItem> GetOptions(Query element, int? queryId) {
|
||||
private IEnumerable<SelectListItem> GetOptions(Query element, string displayType, int? queryId, IDictionary<string, object> tokenData) {
|
||||
var optionLabel = element.OptionLabel;
|
||||
var runtimeValues = GetRuntimeValues(element);
|
||||
|
||||
if (!String.IsNullOrWhiteSpace(optionLabel)) {
|
||||
yield return new SelectListItem { Text = optionLabel };
|
||||
yield return new SelectListItem { Text = displayType != "Design" ? _tokenizer.Replace(optionLabel, tokenData) : optionLabel };
|
||||
}
|
||||
|
||||
if (queryId == null)
|
||||
yield break;
|
||||
|
||||
|
||||
var contentItems = _projectionManager.GetContentItems(queryId.Value).ToArray();
|
||||
var valueExpression = !String.IsNullOrWhiteSpace(element.ValueExpression) ? element.ValueExpression : "{Content.Id}";
|
||||
var textExpression = !String.IsNullOrWhiteSpace(element.TextExpression) ? element.TextExpression : "{Content.DisplayText}";
|
||||
@@ -149,9 +153,15 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
|
||||
yield return new SelectListItem {
|
||||
Text = text,
|
||||
Value = value
|
||||
Value = value,
|
||||
Selected = runtimeValues.Contains(value, StringComparer.OrdinalIgnoreCase)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<string> GetRuntimeValues(Query element) {
|
||||
var runtimeValue = element.RuntimeValue;
|
||||
return runtimeValue != null ? runtimeValue.Split(new[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries) : Enumerable.Empty<string>();
|
||||
}
|
||||
}
|
||||
}
|
@@ -3,6 +3,7 @@ using Orchard.DynamicForms.Elements;
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Tokens;
|
||||
using DescribeContext = Orchard.Forms.Services.DescribeContext;
|
||||
|
||||
@@ -40,7 +41,9 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
}
|
||||
|
||||
protected override void OnDisplaying(RadioButton element, ElementDisplayingContext context) {
|
||||
context.ElementShape.TokenizedValue = _tokenizer.Replace(element.Value, null);
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData());
|
||||
context.ElementShape.ProcessedValue = _tokenizer.Replace(element.Value, context.GetTokenData());
|
||||
}
|
||||
}
|
||||
}
|
@@ -5,14 +5,19 @@ using Orchard.Environment.Extensions;
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Tokens;
|
||||
using DescribeContext = Orchard.Forms.Services.DescribeContext;
|
||||
|
||||
namespace Orchard.DynamicForms.Drivers {
|
||||
[OrchardFeature("Orchard.DynamicForms.AntiSpam")]
|
||||
public class ReCaptchaElementDriver : FormsElementDriver<ReCaptcha>{
|
||||
private readonly IOrchardServices _services;
|
||||
private readonly ITokenizer _tokenizer;
|
||||
|
||||
public ReCaptchaElementDriver(IFormManager formManager, IOrchardServices services) : base(formManager) {
|
||||
public ReCaptchaElementDriver(IFormManager formManager, IOrchardServices services, ITokenizer tokenizer) : base(formManager) {
|
||||
_services = services;
|
||||
_tokenizer = tokenizer;
|
||||
}
|
||||
|
||||
protected override EditorResult OnBuildEditor(ReCaptcha element, ElementEditorContext context) {
|
||||
@@ -51,6 +56,7 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
return;
|
||||
}
|
||||
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData());
|
||||
context.ElementShape.PublicKey = settings.PublicKey;
|
||||
}
|
||||
}
|
||||
|
@@ -8,9 +8,9 @@ using Orchard.Environment.Extensions;
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Taxonomies.Services;
|
||||
using Orchard.Tokens;
|
||||
using Orchard.Utility.Extensions;
|
||||
using DescribeContext = Orchard.Forms.Services.DescribeContext;
|
||||
|
||||
namespace Orchard.DynamicForms.Drivers {
|
||||
@@ -124,17 +124,21 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
var taxonomyId = element.TaxonomyId;
|
||||
var typeName = element.GetType().Name;
|
||||
var displayType = context.DisplayType;
|
||||
var tokenData = context.GetTokenData();
|
||||
|
||||
context.ElementShape.TermOptions = GetTermOptions(element, taxonomyId).ToArray();
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, tokenData);
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, tokenData);
|
||||
context.ElementShape.TermOptions = GetTermOptions(element, context.DisplayType, taxonomyId, tokenData).ToArray();
|
||||
context.ElementShape.Metadata.Alternates.Add(String.Format("Elements_{0}__{1}", typeName, element.InputType));
|
||||
context.ElementShape.Metadata.Alternates.Add(String.Format("Elements_{0}_{1}__{2}", typeName, displayType, element.InputType));
|
||||
}
|
||||
|
||||
private IEnumerable<SelectListItem> GetTermOptions(Taxonomy element, int? taxonomyId) {
|
||||
private IEnumerable<SelectListItem> GetTermOptions(Taxonomy element, string displayType, int? taxonomyId, IDictionary<string, object> tokenData) {
|
||||
var optionLabel = element.OptionLabel;
|
||||
var runtimeValues = GetRuntimeValues(element);
|
||||
|
||||
if (!String.IsNullOrWhiteSpace(optionLabel)) {
|
||||
yield return new SelectListItem { Text = optionLabel };
|
||||
yield return new SelectListItem { Text = displayType != "Design" ? _tokenizer.Replace(optionLabel, tokenData) : optionLabel };
|
||||
}
|
||||
|
||||
if (taxonomyId == null)
|
||||
@@ -151,7 +155,8 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
|
||||
return new SelectListItem {
|
||||
Text = text,
|
||||
Value = value
|
||||
Value = value,
|
||||
Selected = runtimeValues.Contains(value, StringComparer.OrdinalIgnoreCase)
|
||||
};
|
||||
});
|
||||
|
||||
@@ -168,5 +173,10 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
yield return item;
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<string> GetRuntimeValues(Taxonomy element) {
|
||||
var runtimeValue = element.RuntimeValue;
|
||||
return runtimeValue != null ? runtimeValue.Split(new[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries) : Enumerable.Empty<string>();
|
||||
}
|
||||
}
|
||||
}
|
@@ -3,6 +3,7 @@ using Orchard.DynamicForms.Elements;
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Tokens;
|
||||
using DescribeContext = Orchard.Forms.Services.DescribeContext;
|
||||
|
||||
@@ -88,7 +89,9 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
}
|
||||
|
||||
protected override void OnDisplaying(TextArea element, ElementDisplayingContext context) {
|
||||
context.ElementShape.TokenizedValue = _tokenizer.Replace(element.RuntimeValue, null);
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData());
|
||||
context.ElementShape.ProcessedValue = _tokenizer.Replace(element.RuntimeValue, context.GetTokenData());
|
||||
}
|
||||
}
|
||||
}
|
@@ -2,6 +2,7 @@
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Tokens;
|
||||
using DescribeContext = Orchard.Forms.Services.DescribeContext;
|
||||
|
||||
@@ -50,13 +51,13 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
Id: "MinimumLength",
|
||||
Name: "MinimumLength",
|
||||
Title: "Minimum Length",
|
||||
Classes: new[] { "text", "medium", "tokenized" },
|
||||
Classes: new[] { "text", "medium" },
|
||||
Description: T("The minimum length required.")),
|
||||
_MaximumLength: shape.Textbox(
|
||||
Id: "MaximumLength",
|
||||
Name: "MaximumLength",
|
||||
Title: "Maximum Length",
|
||||
Classes: new[] { "text", "medium", "tokenized" },
|
||||
Classes: new[] { "text", "medium" },
|
||||
Description: T("The maximum length allowed.")),
|
||||
_CustomValidationMessage: shape.Textbox(
|
||||
Id: "CustomValidationMessage",
|
||||
@@ -76,7 +77,9 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
}
|
||||
|
||||
protected override void OnDisplaying(TextField element, ElementDisplayingContext context) {
|
||||
context.ElementShape.TokenizedValue = _tokenizer.Replace(element.RuntimeValue, null);
|
||||
context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, context.GetTokenData());
|
||||
context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, context.GetTokenData());
|
||||
context.ElementShape.ProcessedValue = _tokenizer.Replace(element.RuntimeValue, context.GetTokenData());
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.DynamicForms.Elements;
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Tokens;
|
||||
using DescribeContext = Orchard.Forms.Services.DescribeContext;
|
||||
|
||||
namespace Orchard.DynamicForms.Drivers {
|
||||
public class ValidationMessageElementDriver : FormsElementDriver<ValidationMessage> {
|
||||
public ValidationMessageElementDriver(IFormManager formManager) : base(formManager) {}
|
||||
private readonly ITokenizer _tokenizer;
|
||||
|
||||
public ValidationMessageElementDriver(IFormManager formManager, ITokenizer tokenizer) : base(formManager) {
|
||||
_tokenizer = tokenizer;
|
||||
}
|
||||
|
||||
protected override IEnumerable<string> FormNames {
|
||||
get { yield return "ValidationMessage"; }
|
||||
@@ -20,11 +28,15 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
Id: "For",
|
||||
Name: "For",
|
||||
Title: "For",
|
||||
Classes: new[] { "text", "large" },
|
||||
Classes: new[] { "text", "large", "tokenized" },
|
||||
Description: T("The name of the field this validation message is for.")));
|
||||
|
||||
return form;
|
||||
});
|
||||
}
|
||||
|
||||
protected override void OnDisplaying(ValidationMessage element, ElementDisplayContext context) {
|
||||
context.ElementShape.ProcessedFor = _tokenizer.Replace(element.For, context.GetTokenData());
|
||||
}
|
||||
}
|
||||
}
|
@@ -9,15 +9,21 @@ using Orchard.Layouts.Helpers;
|
||||
namespace Orchard.DynamicForms.Elements {
|
||||
public class Enumeration : LabeledFormElement {
|
||||
private readonly Lazy<IEnumerable<SelectListItem>> _options;
|
||||
private readonly Lazy<IEnumerable<string>> _runtimeValues;
|
||||
|
||||
public Enumeration() {
|
||||
_options = new Lazy<IEnumerable<SelectListItem>>(GetOptions);
|
||||
_runtimeValues = new Lazy<IEnumerable<string>>(ParseRuntimeValues);
|
||||
}
|
||||
|
||||
public IEnumerable<SelectListItem> Options {
|
||||
get { return _options.Value; }
|
||||
}
|
||||
|
||||
public IEnumerable<string> RuntimeValues {
|
||||
get { return _runtimeValues.Value; }
|
||||
}
|
||||
|
||||
public string InputType {
|
||||
get { return this.Retrieve(x => x.InputType, () => "SelectList"); }
|
||||
set { this.Store(x => x.InputType, value); }
|
||||
@@ -31,13 +37,18 @@ namespace Orchard.DynamicForms.Elements {
|
||||
return ParseOptionsText();
|
||||
}
|
||||
|
||||
private IEnumerable<string> ParseRuntimeValues() {
|
||||
var runtimeValue = RuntimeValue;
|
||||
return runtimeValue != null ? runtimeValue.Split(new[] {',', ';'}, StringSplitOptions.RemoveEmptyEntries) : Enumerable.Empty<string>();
|
||||
}
|
||||
|
||||
private IEnumerable<SelectListItem> ParseOptionsText() {
|
||||
var data = this.Retrieve("Options", () => "");
|
||||
var lines = Regex.Split(data, @"(?:\r\n|[\r\n])", RegexOptions.Multiline);
|
||||
return lines.Select(ParseLine).Where(x => x != null);
|
||||
}
|
||||
|
||||
private static SelectListItem ParseLine(string line) {
|
||||
private SelectListItem ParseLine(string line) {
|
||||
if (String.IsNullOrWhiteSpace(line))
|
||||
return null;
|
||||
|
||||
@@ -47,7 +58,8 @@ namespace Orchard.DynamicForms.Elements {
|
||||
var value = parts[0].Trim();
|
||||
return new SelectListItem {
|
||||
Text = value,
|
||||
Value = value
|
||||
Value = value,
|
||||
Selected = RuntimeValues.Contains(value, StringComparer.OrdinalIgnoreCase)
|
||||
};
|
||||
}
|
||||
else {
|
||||
@@ -55,7 +67,8 @@ namespace Orchard.DynamicForms.Elements {
|
||||
var value = String.Join(":", parts.Skip(1)).Trim();
|
||||
return new SelectListItem {
|
||||
Text = text,
|
||||
Value = value
|
||||
Value = value,
|
||||
Selected = RuntimeValues.Contains(value, StringComparer.OrdinalIgnoreCase)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@@ -35,9 +35,10 @@ namespace Orchard.DynamicForms.Handlers {
|
||||
ModelState = context.ModelState,
|
||||
PostedValues = values
|
||||
};
|
||||
var tokensData = new Dictionary<string, object>(formValuesDictionary) {
|
||||
var tokenData = new Dictionary<string, object>(formValuesDictionary) {
|
||||
{"Updater", context.Updater},
|
||||
{"FormSubmission", formTokenContext},
|
||||
{"Content", context.Content }
|
||||
};
|
||||
|
||||
// Store the submission.
|
||||
@@ -53,10 +54,10 @@ namespace Orchard.DynamicForms.Handlers {
|
||||
|
||||
// Notifiy.
|
||||
if (!String.IsNullOrWhiteSpace(form.Notification))
|
||||
_notifier.Information(T(_tokenizer.Replace(T(form.Notification).Text, tokensData)));
|
||||
_notifier.Information(T(_tokenizer.Replace(T(form.Notification).Text, tokenData)));
|
||||
|
||||
// Trigger workflow event.
|
||||
_workflowManager.TriggerEvent(DynamicFormSubmittedActivity.EventName, contentItem, () => tokensData);
|
||||
_workflowManager.TriggerEvent(DynamicFormSubmittedActivity.EventName, contentItem, () => tokenData);
|
||||
}
|
||||
}
|
||||
}
|
@@ -5,9 +5,9 @@ using Orchard.Tokens;
|
||||
|
||||
namespace Orchard.DynamicForms.Helpers {
|
||||
public static class TokenizerExtensions {
|
||||
public static IEnumerable<SelectListItem> Replace(this ITokenizer tokenizer, IEnumerable<SelectListItem> items) {
|
||||
public static IEnumerable<SelectListItem> Replace(this ITokenizer tokenizer, IEnumerable<SelectListItem> items, IDictionary<string, object> data) {
|
||||
return items.Select(item => new SelectListItem {
|
||||
Text = tokenizer.Replace(item.Text, null),
|
||||
Text = tokenizer.Replace(item.Text, data),
|
||||
Value = item.Value,
|
||||
Disabled = item.Disabled,
|
||||
Group = item.Group,
|
||||
|
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardcustomforms.codeplex.com
|
||||
Version: 1.9.0
|
||||
Version: 1.9.1
|
||||
OrchardVersion: 1.9
|
||||
Description: Create custom forms like contact forms using layouts.
|
||||
Features:
|
||||
|
@@ -104,6 +104,9 @@
|
||||
<Content Include="Styles\menu.dynamicforms-admin.css" />
|
||||
<Content Include="Styles\menu.dynamicforms-admin.min.css" />
|
||||
<Content Include="Styles\menu.dynamicforms.png" />
|
||||
<Content Include="Styles\workflows-activity-dynamic-form-validating.css" />
|
||||
<Content Include="Styles\workflows-activity-dynamic-form-submitted.css" />
|
||||
<Content Include="Styles\workflows-activity-add-model-error.css" />
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Scripts\Web.config" />
|
||||
<Content Include="Styles\Web.config" />
|
||||
@@ -516,6 +519,12 @@
|
||||
<ItemGroup>
|
||||
<Content Include="package.json" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Elements\Button.Design.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Elements\Label.Design.cshtml" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
|
@@ -77,10 +77,11 @@ namespace Orchard.DynamicForms.Services {
|
||||
return GetFormElements(form).Select(x => x.Name).Where(x => !String.IsNullOrWhiteSpace(x)).Distinct();
|
||||
}
|
||||
|
||||
public NameValueCollection SubmitForm(Form form, IValueProvider valueProvider, ModelStateDictionary modelState, IUpdateModel updater) {
|
||||
public NameValueCollection SubmitForm(IContent content, Form form, IValueProvider valueProvider, ModelStateDictionary modelState, IUpdateModel updater) {
|
||||
var values = ReadElementValues(form, valueProvider);
|
||||
|
||||
_formEventHandler.Submitted(new FormSubmittedEventContext {
|
||||
Content = content,
|
||||
Form = form,
|
||||
FormService = this,
|
||||
ValueProvider = valueProvider,
|
||||
@@ -89,6 +90,7 @@ namespace Orchard.DynamicForms.Services {
|
||||
});
|
||||
|
||||
_formEventHandler.Validating(new FormValidatingEventContext {
|
||||
Content = content,
|
||||
Form = form,
|
||||
FormService = this,
|
||||
Values = values,
|
||||
@@ -98,6 +100,7 @@ namespace Orchard.DynamicForms.Services {
|
||||
});
|
||||
|
||||
_formEventHandler.Validated(new FormValidatedEventContext {
|
||||
Content = content,
|
||||
Form = form,
|
||||
FormService = this,
|
||||
Values = values,
|
||||
|
@@ -15,7 +15,7 @@ namespace Orchard.DynamicForms.Services {
|
||||
Form FindForm(LayoutPart layoutPart, string formName = null);
|
||||
IEnumerable<FormElement> GetFormElements(Form form);
|
||||
IEnumerable<string> GetFormElementNames(Form form);
|
||||
NameValueCollection SubmitForm(Form form, IValueProvider valueProvider, ModelStateDictionary modelState, IUpdateModel updater);
|
||||
NameValueCollection SubmitForm(IContent content, Form form, IValueProvider valueProvider, ModelStateDictionary modelState, IUpdateModel updater);
|
||||
Submission CreateSubmission(string formName, NameValueCollection values);
|
||||
Submission CreateSubmission(Submission submission);
|
||||
Submission GetSubmission(int id);
|
||||
|
@@ -5,6 +5,7 @@ using Orchard.DynamicForms.Elements;
|
||||
|
||||
namespace Orchard.DynamicForms.Services.Models {
|
||||
public class FormEventContext {
|
||||
public IContent Content { get; set; }
|
||||
public Form Form { get; set; }
|
||||
public NameValueCollection Values { get; set; }
|
||||
public IFormService FormService { get; set; }
|
||||
|
@@ -0,0 +1 @@
|
||||
|
@@ -0,0 +1 @@
|
||||
|
@@ -0,0 +1 @@
|
||||
|
@@ -0,0 +1,11 @@
|
||||
@using Orchard.DynamicForms.Elements
|
||||
@using Orchard.Layouts.Helpers
|
||||
@{
|
||||
var element = (Button)Model.Element;
|
||||
var tagBuilder = TagBuilderExtensions.CreateElementTagBuilder(Model, "button");
|
||||
|
||||
tagBuilder.Attributes["type"] = "submit";
|
||||
tagBuilder.Attributes["name"] = element.Name;
|
||||
tagBuilder.SetInnerText(element.Text);
|
||||
}
|
||||
@tagBuilder.ToHtmlString()
|
@@ -1,11 +1,9 @@
|
||||
@using Orchard.DynamicForms.Elements
|
||||
@using Orchard.Layouts.Helpers
|
||||
@using Orchard.Layouts.Helpers
|
||||
@{
|
||||
var element = (Button)Model.Element;
|
||||
var tagBuilder = TagBuilderExtensions.CreateElementTagBuilder(Model, "button");
|
||||
|
||||
tagBuilder.Attributes["type"] = "submit";
|
||||
tagBuilder.Attributes["name"] = element.Name;
|
||||
tagBuilder.SetInnerText(element.Text);
|
||||
tagBuilder.Attributes["name"] = Model.ProcessedName;
|
||||
tagBuilder.SetInnerText(Model.ProcessedText);
|
||||
}
|
||||
@tagBuilder.ToHtmlString()
|
||||
|
@@ -6,8 +6,8 @@
|
||||
var tagBuilder = (OrchardTagBuilder)TagBuilderExtensions.CreateElementTagBuilder(Model, "input");
|
||||
|
||||
tagBuilder.Attributes["type"] = "checkbox";
|
||||
tagBuilder.Attributes["name"] = element.Name;
|
||||
tagBuilder.Attributes["value"] = Model.TokenizedValue;
|
||||
tagBuilder.Attributes["name"] = Model.ProcessedName;
|
||||
tagBuilder.Attributes["value"] = Model.ProcessedValue;
|
||||
tagBuilder.AddClientValidationAttributes((IDictionary<string, string>)Model.ClientValidationAttributes);
|
||||
|
||||
if (!String.IsNullOrWhiteSpace(element.PostedValue)) {
|
||||
@@ -17,12 +17,12 @@
|
||||
@if (element.ShowLabel) {
|
||||
<label>
|
||||
@tagBuilder.ToHtmlString(TagRenderMode.SelfClosing)
|
||||
@Html.Raw(element.Label)
|
||||
@Html.Raw(Model.ProcessedLabel)
|
||||
</label>
|
||||
}
|
||||
else {
|
||||
@tagBuilder.ToHtmlString(TagRenderMode.SelfClosing)
|
||||
}
|
||||
@if (element.ValidationSettings.ShowValidationMessage == true) {
|
||||
@Html.ValidationMessage(element.Name)
|
||||
@Html.ValidationMessage((string)Model.ProcessedName)
|
||||
}
|
@@ -7,19 +7,19 @@
|
||||
|
||||
tagBuilder.AddCssClass("text");
|
||||
tagBuilder.Attributes["type"] = "email";
|
||||
tagBuilder.Attributes["value"] = Model.TokenizedValue;
|
||||
tagBuilder.Attributes["name"] = element.Name;
|
||||
tagBuilder.Attributes["value"] = Model.ProcessedValue;
|
||||
tagBuilder.Attributes["name"] = Model.ProcessedName;
|
||||
tagBuilder.AddClientValidationAttributes((IDictionary<string, string>)Model.ClientValidationAttributes);
|
||||
|
||||
if (!ViewData.ModelState.IsValidField(element.Name)) {
|
||||
if (!ViewData.ModelState.IsValidField(Model.ProcessedName)) {
|
||||
tagBuilder.AddCssClass("input-validation-error");
|
||||
}
|
||||
}
|
||||
|
||||
@if (element.ShowLabel) {
|
||||
<label for="@element.HtmlId">@element.Label</label>
|
||||
<label for="@element.HtmlId">@Model.ProcessedLabel</label>
|
||||
}
|
||||
@tagBuilder.ToHtmlString(TagRenderMode.SelfClosing)
|
||||
@if (element.ValidationSettings.ShowValidationMessage == true) {
|
||||
@Html.ValidationMessage(element.Name)
|
||||
@Html.ValidationMessage((string)Model.ProcessedName)
|
||||
}
|
@@ -8,7 +8,7 @@
|
||||
<label>@Html.Raw(element.Label)</label>
|
||||
}
|
||||
@tagBuilder.StartElement
|
||||
@foreach (var option in Model.TokenizedOptions) {
|
||||
@foreach (var option in element.Options) {
|
||||
<li>
|
||||
<label>
|
||||
<input type="checkbox" name="@element.Name" value="@option.Value" />
|
||||
|
@@ -7,14 +7,19 @@
|
||||
var index = 0;
|
||||
}
|
||||
@if (element.ShowLabel) {
|
||||
<label>@Html.Raw(element.Label)</label>
|
||||
<label>@Html.Raw(Model.ProcessedLabel)</label>
|
||||
}
|
||||
@tagBuilder.StartElement
|
||||
@foreach (var option in Model.TokenizedOptions) {
|
||||
@foreach (var option in Model.ProcessedOptions) {
|
||||
var inputTagBuilder = new OrchardTagBuilder("input");
|
||||
inputTagBuilder.Attributes["type"] = "checkbox";
|
||||
inputTagBuilder.Attributes["name"] = element.Name;
|
||||
inputTagBuilder.Attributes["name"] = Model.ProcessedName;
|
||||
inputTagBuilder.Attributes["value"] = option.Value;
|
||||
|
||||
if (option.Selected) {
|
||||
inputTagBuilder.Attributes["checked"] = "checked";
|
||||
}
|
||||
|
||||
if (element.ValidationSettings.Required == true && index == 0) {
|
||||
inputTagBuilder.AddClientValidationAttributes((IDictionary<string, string>)Model.ClientValidationAttributes);
|
||||
}
|
||||
@@ -28,5 +33,5 @@
|
||||
}
|
||||
@tagBuilder.EndElement
|
||||
@if (element.ValidationSettings.ShowValidationMessage == true) {
|
||||
@Html.ValidationMessage(element.Name)
|
||||
@Html.ValidationMessage((string)Model.ProcessedName)
|
||||
}
|
@@ -4,7 +4,7 @@
|
||||
var element = (Enumeration)Model.Element;
|
||||
var attributes = (IDictionary<string, object>)TagBuilderExtensions.GetCommonElementAttributes(Model);
|
||||
var name = String.IsNullOrWhiteSpace(element.Name) ? "MultiSelectList1" : element.Name;
|
||||
var options = (IEnumerable<SelectListItem>)Model.TokenizedOptions;
|
||||
var options = element.Options;
|
||||
}
|
||||
@if (element.ShowLabel) {
|
||||
<label for="@element.HtmlId">@Html.Raw(element.Label)</label>
|
||||
|
@@ -3,8 +3,8 @@
|
||||
@{
|
||||
var element = (Enumeration)Model.Element;
|
||||
var attributes = (IDictionary<string, object>)TagBuilderExtensions.GetCommonElementAttributes(Model);
|
||||
var name = String.IsNullOrWhiteSpace(element.Name) ? "MultiSelectList1" : element.Name;
|
||||
var options = (IEnumerable<SelectListItem>)Model.TokenizedOptions;
|
||||
var name = (string)(String.IsNullOrWhiteSpace(Model.ProcessedName) ? "MultiSelectList1" : Model.ProcessedName);
|
||||
var options = (IEnumerable<SelectListItem>)Model.ProcessedOptions;
|
||||
var clientValidationAttributes = (IDictionary<string, string>)Model.ClientValidationAttributes;
|
||||
var htmlId = !String.IsNullOrWhiteSpace(element.HtmlId) ? element.HtmlId : name;
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
}
|
||||
}
|
||||
@if (element.ShowLabel) {
|
||||
<label for="@htmlId">@Html.Raw(element.Label)</label>
|
||||
<label for="@htmlId">@Html.Raw(Model.ProcessedLabel)</label>
|
||||
}
|
||||
@Html.ListBox(name, options, attributes)
|
||||
@if (element.ValidationSettings.ShowValidationMessage == true) {
|
||||
@Html.ValidationMessage(element.Name)
|
||||
@Html.ValidationMessage((string)Model.ProcessedName)
|
||||
}
|
@@ -8,7 +8,7 @@
|
||||
<label>@Html.Raw(element.Label)</label>
|
||||
}
|
||||
@tagBuilder.StartElement
|
||||
@foreach (var option in Model.TokenizedOptions) {
|
||||
@foreach (var option in element.Options) {
|
||||
<li>
|
||||
<label>
|
||||
<input type="radio" name="@element.Name" value="@option.Value" />
|
||||
|
@@ -7,14 +7,19 @@
|
||||
var index = 0;
|
||||
}
|
||||
@if (element.ShowLabel) {
|
||||
<label>@Html.Raw(element.Label)</label>
|
||||
<label>@Html.Raw(Model.ProcessedLabel)</label>
|
||||
}
|
||||
@tagBuilder.StartElement
|
||||
@foreach (var option in Model.TokenizedOptions) {
|
||||
@foreach (var option in Model.ProcessedOptions) {
|
||||
var inputTagBuilder = new OrchardTagBuilder("input");
|
||||
inputTagBuilder.Attributes["type"] = "radio";
|
||||
inputTagBuilder.Attributes["name"] = element.Name;
|
||||
inputTagBuilder.Attributes["name"] = Model.ProcessedName;
|
||||
inputTagBuilder.Attributes["value"] = option.Value;
|
||||
|
||||
if (option.Selected) {
|
||||
inputTagBuilder.Attributes["checked"] = "checked";
|
||||
}
|
||||
|
||||
if (element.ValidationSettings.Required == true && index == 0) {
|
||||
inputTagBuilder.AddClientValidationAttributes((IDictionary<string, string>) Model.ClientValidationAttributes);
|
||||
}
|
||||
@@ -28,5 +33,5 @@
|
||||
}
|
||||
@tagBuilder.EndElement
|
||||
@if (element.ValidationSettings.ShowValidationMessage == true) {
|
||||
@Html.ValidationMessage(element.Name)
|
||||
@Html.ValidationMessage((string)Model.ProcessedName)
|
||||
}
|
@@ -4,7 +4,7 @@
|
||||
var element = (Enumeration)Model.Element;
|
||||
var attributes = (IDictionary<string, object>)TagBuilderExtensions.GetCommonElementAttributes(Model);
|
||||
var name = String.IsNullOrWhiteSpace(element.Name) ? "SelectList1" : element.Name;
|
||||
var options = (IEnumerable<SelectListItem>)Model.TokenizedOptions;
|
||||
var options = element.Options;
|
||||
}
|
||||
@if (element.ShowLabel) {
|
||||
<label for="@element.HtmlId">@Html.Raw(element.Label)</label>
|
||||
|
@@ -3,8 +3,8 @@
|
||||
@{
|
||||
var element = (Enumeration)Model.Element;
|
||||
var attributes = (IDictionary<string, object>)TagBuilderExtensions.GetCommonElementAttributes(Model);
|
||||
var name = String.IsNullOrWhiteSpace(element.Name) ? "SelectList1" : element.Name;
|
||||
var options = (IEnumerable<SelectListItem>)Model.TokenizedOptions;
|
||||
var name = (String.IsNullOrWhiteSpace((string)Model.ProcessedName) ? "SelectList1" : (string)Model.ProcessedName);
|
||||
var options = (IEnumerable<SelectListItem>)Model.ProcessedOptions;
|
||||
var clientValidationAttributes = (IDictionary<string, string>)Model.ClientValidationAttributes;
|
||||
var htmlId = !String.IsNullOrWhiteSpace(element.HtmlId) ? element.HtmlId : name;
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
}
|
||||
}
|
||||
@if (element.ShowLabel) {
|
||||
<label for="@htmlId">@Html.Raw(element.Label)</label>
|
||||
<label for="@htmlId">@Html.Raw(Model.ProcessedLabel)</label>
|
||||
}
|
||||
@Html.DropDownList(name, options, attributes)
|
||||
@if (element.ValidationSettings.ShowValidationMessage == true) {
|
||||
@Html.ValidationMessage(element.Name)
|
||||
@Html.ValidationMessage(name)
|
||||
}
|
@@ -3,7 +3,7 @@
|
||||
@{
|
||||
var element = (Fieldset) Model.Element;
|
||||
var tagBuilder = TagBuilderExtensions.CreateElementTagBuilder(Model, "fieldset");
|
||||
var legend = element.Legend;
|
||||
var legend = Model.ProcessedLegend;
|
||||
}
|
||||
@tagBuilder.StartElement
|
||||
<legend>@legend</legend>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user