mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Setting default name for form element.
This commit is contained in:
@@ -10,6 +10,7 @@ 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;
|
||||
|
||||
@@ -47,6 +48,7 @@ namespace Orchard.DynamicForms.Drivers {
|
||||
Id: "FormName",
|
||||
Name: "FormName",
|
||||
Title: "Name",
|
||||
Value: "Untitled",
|
||||
Classes: new[] { "text", "medium" },
|
||||
Description: T("The name of the form.")),
|
||||
_FormAction: shape.Textbox(
|
||||
|
@@ -8,7 +8,7 @@ namespace Orchard.DynamicForms.Elements {
|
||||
}
|
||||
|
||||
public string Name {
|
||||
get { return State.Get("FormName"); }
|
||||
get { return State.Get("FormName", "Untitled"); }
|
||||
set { State["FormName"] = value; }
|
||||
}
|
||||
|
||||
|
@@ -10,7 +10,7 @@ namespace Orchard.Layouts.Helpers {
|
||||
private static readonly string[] _elementStateBlackList = {"ElementState", "__RequestVerificationToken"};
|
||||
|
||||
public static string Get(this StateDictionary state, string key, string defaultValue = null) {
|
||||
return state == null ? null : state.ContainsKey(key) ? state[key] : null;
|
||||
return state != null ? state.ContainsKey(key) ? state[key] : defaultValue : defaultValue;
|
||||
}
|
||||
|
||||
public static string Serialize(this StateDictionary state) {
|
||||
|
Reference in New Issue
Block a user