Standard doc type properties no longer prefixed with @ in "Insert Umbraco page field" dialogue
Fixed #U4-859
This commit is contained in:
@@ -1417,7 +1417,9 @@
|
||||
</Content>
|
||||
<Content Include="umbraco\cacheBrowser.aspx" />
|
||||
<Content Include="umbraco\config\create\UI.xml" />
|
||||
<Content Include="umbraco\config\lang\en.xml" />
|
||||
<Content Include="umbraco\config\lang\en.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="umbraco\developer\Python\editPython.aspx" />
|
||||
<Content Include="umbraco\images\developer\customControlIcon.png" />
|
||||
<Content Include="umbraco\images\developer\pythonIcon.png" />
|
||||
|
||||
@@ -728,6 +728,7 @@ To manage your website, simply open the umbraco back office and start adding con
|
||||
<key alias="chooseField">Choose field</key>
|
||||
<key alias="convertLineBreaks">Convert Linebreaks</key>
|
||||
<key alias="convertLineBreaksHelp">Replaces linebreaks with html-tag &lt;br&gt;</key>
|
||||
<key alias="customFields">Custom Fields</key>
|
||||
<key alias="dateOnly">Yes, Date only</key>
|
||||
<key alias="formatAsDate">Format as date</key>
|
||||
<key alias="htmlEncode">HTML encode</key>
|
||||
@@ -741,6 +742,7 @@ To manage your website, simply open the umbraco back office and start adding con
|
||||
<key alias="recursive">Recursive</key>
|
||||
<key alias="removeParagraph">Remove Paragraph tags</key>
|
||||
<key alias="removeParagraphHelp">Will remove any &lt;P&gt; in the beginning and end of the text</key>
|
||||
<key alias="standardFields">Standard Fields</key>
|
||||
<key alias="uppercase">Uppercase</key>
|
||||
<key alias="urlEncode">URL encode</key>
|
||||
<key alias="urlEncodeHelp">Will format special characters in URLs</key>
|
||||
|
||||
@@ -1937,7 +1937,9 @@
|
||||
<Content Include="umbraco.presentation\umbraco\dialogs\rollBack.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\dialogs\sendToTranslation.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\dialogs\treePicker.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\dialogs\umbracoField.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\dialogs\umbracoField.aspx">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Content>
|
||||
<Content Include="umbraco.presentation\umbraco\dialogs\uploadImage.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\dialogs\viewAuditTrail.aspx" />
|
||||
<Content Include="umbraco.presentation\install\steps\defaultUser.ascx">
|
||||
|
||||
@@ -86,11 +86,11 @@
|
||||
<input type="hidden" name="tagName" runat="server" id="tagName" value="?UMBRACO_GETITEM">
|
||||
<cc1:Pane ID="pane_form" runat="server">
|
||||
<cc1:PropertyPanel ID="pp_insertField" runat="server">
|
||||
<asp:ListBox ID="fieldPicker" Width="170px" Rows="1" runat="server"></asp:ListBox>
|
||||
<cc1:FieldDropDownList ID="fieldPicker" Width="170px" Rows="1" runat="server"></cc1:FieldDropDownList>
|
||||
<input type="text" size="25" name="field" class="guiInputTextTiny">
|
||||
</cc1:PropertyPanel>
|
||||
<cc1:PropertyPanel ID="pp_insertAltField" runat="server">
|
||||
<asp:ListBox ID="altFieldPicker" Width="170px" Rows="1" runat="server"></asp:ListBox>
|
||||
<cc1:FieldDropDownList ID="altFieldPicker" Width="170px" Rows="1" runat="server"></cc1:FieldDropDownList>
|
||||
<input type="text" size="25" name="useIfEmpty" class="guiInputTextTiny"><br />
|
||||
<span class="guiDialogTiny">
|
||||
<%=umbraco.ui.Text("templateEditor", "usedIfEmpty")%></span>
|
||||
|
||||
@@ -59,9 +59,13 @@ namespace umbraco.dialogs
|
||||
else
|
||||
{
|
||||
fieldSql = "select distinct alias from cmsPropertyType order by alias";
|
||||
pp_insertField.Text = umbraco.ui.Text("templateEditor", "chooseField");
|
||||
pp_insertField.Text = ui.Text("templateEditor", "chooseField");
|
||||
}
|
||||
|
||||
|
||||
fieldPicker.ChooseText = ui.Text("templateEditor", "chooseField");
|
||||
fieldPicker.StandardPropertiesLabel = ui.Text("templateEditor", "standardFields");
|
||||
fieldPicker.CustomPropertiesLabel = ui.Text("templateEditor", "customFields");
|
||||
|
||||
IRecordsReader dataTypes = SqlHelper.ExecuteReader(fieldSql);
|
||||
fieldPicker.DataTextField = "alias";
|
||||
fieldPicker.DataValueField = "alias";
|
||||
@@ -70,6 +74,10 @@ namespace umbraco.dialogs
|
||||
fieldPicker.Attributes.Add("onChange", "document.forms[0].field.value = document.forms[0]." + fieldPicker.ClientID + "[document.forms[0]." + fieldPicker.ClientID + ".selectedIndex].value;");
|
||||
dataTypes.Close();
|
||||
|
||||
altFieldPicker.ChooseText = ui.Text("templateEditor", "chooseField");
|
||||
altFieldPicker.StandardPropertiesLabel = ui.Text("templateEditor", "standardFields");
|
||||
altFieldPicker.CustomPropertiesLabel = ui.Text("templateEditor", "customFields");
|
||||
|
||||
IRecordsReader dataTypes2 = SqlHelper.ExecuteReader(fieldSql);
|
||||
altFieldPicker.DataTextField = "alias";
|
||||
altFieldPicker.DataValueField = "alias";
|
||||
@@ -78,9 +86,6 @@ namespace umbraco.dialogs
|
||||
altFieldPicker.Attributes.Add("onChange", "document.forms[0].useIfEmpty.value = document.forms[0]." + altFieldPicker.ClientID + "[document.forms[0]." + altFieldPicker.ClientID + ".selectedIndex].value;");
|
||||
dataTypes2.Close();
|
||||
|
||||
fieldPicker.Items.Insert(0,new ListItem(ui.Text("general", "choose", base.getUser())));
|
||||
altFieldPicker.Items.Insert(0,new ListItem(ui.Text("general", "choose", base.getUser())));
|
||||
|
||||
// Pre values
|
||||
if (!m_IsDictionaryMode)
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace umbraco.dialogs {
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ListBox fieldPicker;
|
||||
protected global::umbraco.uicontrols.FieldDropDownList fieldPicker;
|
||||
|
||||
/// <summary>
|
||||
/// pp_insertAltField control.
|
||||
@@ -73,7 +73,7 @@ namespace umbraco.dialogs {
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ListBox altFieldPicker;
|
||||
protected global::umbraco.uicontrols.FieldDropDownList altFieldPicker;
|
||||
|
||||
/// <summary>
|
||||
/// pp_insertAltText control.
|
||||
|
||||
72
src/umbraco.controls/FieldDropDownList.cs
Normal file
72
src/umbraco.controls/FieldDropDownList.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace umbraco.uicontrols
|
||||
{
|
||||
public class FieldDropDownList : DropDownList
|
||||
{
|
||||
private bool _customOptionsStarted;
|
||||
private bool _standardOptionsStarted;
|
||||
|
||||
public string CustomPropertiesLabel { get; set; }
|
||||
public string StandardPropertiesLabel { get; set; }
|
||||
public string ChooseText { get; set; }
|
||||
|
||||
protected override void RenderContents(HtmlTextWriter writer)
|
||||
{
|
||||
if (Items.Count > 0 && Items[0].Text.StartsWith("#"))
|
||||
{
|
||||
Items.Insert(0, new ListItem(ChooseText, ""));
|
||||
SelectedIndex = 0;
|
||||
|
||||
base.RenderContents(writer);
|
||||
return;
|
||||
}
|
||||
|
||||
writer.Write("<option value=\"\">{0}</option>", ChooseText);
|
||||
|
||||
foreach (ListItem item in Items)
|
||||
{
|
||||
if (!_customOptionsStarted)
|
||||
{
|
||||
RenderOptionGroupBeginTag(CustomPropertiesLabel, writer);
|
||||
_customOptionsStarted = true;
|
||||
}
|
||||
else if (item.Text.StartsWith("@") && !_standardOptionsStarted)
|
||||
{
|
||||
_standardOptionsStarted = true;
|
||||
RenderOptionGroupEndTag(writer);
|
||||
RenderOptionGroupBeginTag(StandardPropertiesLabel, writer);
|
||||
}
|
||||
|
||||
writer.WriteBeginTag("option");
|
||||
writer.WriteAttribute("value", item.Value, true);
|
||||
|
||||
foreach (string key in item.Attributes.Keys)
|
||||
writer.WriteAttribute(key, item.Attributes[key]);
|
||||
|
||||
writer.Write(HtmlTextWriter.TagRightChar);
|
||||
HttpUtility.HtmlEncode(item.Text.Replace("@", ""), writer);
|
||||
writer.WriteEndTag("option");
|
||||
writer.WriteLine();
|
||||
}
|
||||
|
||||
RenderOptionGroupEndTag(writer);
|
||||
}
|
||||
|
||||
private void RenderOptionGroupBeginTag(string name, HtmlTextWriter writer)
|
||||
{
|
||||
writer.WriteBeginTag("optgroup");
|
||||
writer.WriteAttribute("label", name);
|
||||
writer.Write(HtmlTextWriter.TagRightChar);
|
||||
writer.WriteLine();
|
||||
}
|
||||
|
||||
private void RenderOptionGroupEndTag(HtmlTextWriter writer)
|
||||
{
|
||||
writer.WriteEndTag("optgroup");
|
||||
writer.WriteLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,6 +86,7 @@
|
||||
<Link>Properties\SolutionInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="DatePicker\DateTimePicker.cs" />
|
||||
<Compile Include="FieldDropDownList.cs" />
|
||||
<Compile Include="ProgressBar.cs" />
|
||||
<Compile Include="TreePicker\BaseTreePicker.cs" />
|
||||
<Compile Include="TreePicker\BaseTreePickerScripts.Designer.cs">
|
||||
|
||||
Reference in New Issue
Block a user