diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml
index 414c45bf13..b5c363ce59 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml
@@ -88,6 +88,7 @@
This item is not published
Last published
Media Type
+ Link to media item(s)
Member Group
Role
Member Type
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs
index 014342b6f8..cf5e924ec3 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs
@@ -2,11 +2,15 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
+using System.IO;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
+using Umbraco.Core.IO;
using umbraco.BasePages;
using umbraco.cms.businesslogic;
+using umbraco.cms.businesslogic.datatype.controls;
+using umbraco.cms.businesslogic.media;
using umbraco.cms.businesslogic.property;
using umbraco.cms.businesslogic.propertytype;
using umbraco.cms.businesslogic.web;
@@ -14,7 +18,7 @@ using umbraco.interfaces;
using umbraco.uicontrols;
using Content = umbraco.cms.businesslogic.Content;
using System.Linq;
-using umbraco.IO;
+using SystemDirectories = umbraco.IO.SystemDirectories;
namespace umbraco.controls
{
@@ -212,9 +216,46 @@ namespace umbraco.controls
ltt.Text = _content.Id.ToString();
PropertiesPane.addProperty("Id", ltt);
- tpProp.Controls.AddAt(0, PropertiesPane);
- tpProp.Style.Add("text-align", "center");
- //tpProp.Style.Add("padding", "10px");
+ if (_content is Media)
+ {
+ PropertiesPane.addProperty(ui.Text("content", "mediatype"), new LiteralControl(_content.ContentType.Alias));
+
+ var uploadField = new Factory().GetNewObject(new Guid("5032a6e6-69e3-491d-bb28-cd31cd11086c"));
+
+ try
+ {
+ var uploadProperties = _content.GenericProperties
+ .Where(p => p.PropertyType.DataTypeDefinition.DataType.Id == uploadField.Id
+ && p.Value.ToString() != ""
+ && File.Exists(IOHelper.MapPath(p.Value.ToString())));
+
+ var properties = uploadProperties as List ?? uploadProperties.ToList();
+
+ if (properties.Any())
+ {
+ var linkProperties = new Pane();
+ var literal = new LiteralControl { Text = String.Empty };
+
+ literal.Text += "";
+
+ foreach (var property in properties)
+ literal.Text += string.Format("| {0} | {1} |
", property.PropertyType.Name, property.Value);
+
+ literal.Text += "
";
+
+ linkProperties.addProperty(ui.Text("content", "mediaLinks"), literal);
+ tpProp.Controls.AddAt(1, linkProperties);
+ }
+ }
+ catch
+ {
+ //the data type definition may not exist anymore at this point because another thread may
+ //have deleted it.
+ }
+
+ tpProp.Controls.AddAt(0, PropertiesPane);
+ tpProp.Style.Add("text-align", "center");
+ }
}
}
@@ -245,7 +286,7 @@ namespace umbraco.controls
df.Save();
}
- if(!string.IsNullOrEmpty(NameTxt.Text))
+ if (!string.IsNullOrEmpty(NameTxt.Text))
_content.Text = NameTxt.Text;
Save(this, new EventArgs());
diff --git a/src/umbraco.editorControls/XPathCheckBoxList/XPathCheckBoxListPreValueEditor.cs b/src/umbraco.editorControls/XPathCheckBoxList/XPathCheckBoxListPreValueEditor.cs
index bd1c4c51cd..2064ff818b 100644
--- a/src/umbraco.editorControls/XPathCheckBoxList/XPathCheckBoxListPreValueEditor.cs
+++ b/src/umbraco.editorControls/XPathCheckBoxList/XPathCheckBoxListPreValueEditor.cs
@@ -65,7 +65,7 @@ namespace umbraco.editorControls.XPathCheckBoxList
if (this.options == null)
{
// Create a new Options data object with the default values
- this.options = new XPathCheckBoxListOptions();
+ this.options = new XPathCheckBoxListOptions(true);
}
}
return this.options;
@@ -178,7 +178,10 @@ namespace umbraco.editorControls.XPathCheckBoxList
protected override void RenderContents(HtmlTextWriter writer)
{
//writer.AddPrevalueRow("Database Type", this.dbTypeDropDownList);
- writer.AddPrevalueRow("XPath Expression", this.xPathTextBox, this.xPathRequiredFieldValidator, this.xPathCustomValidator);
+ writer.AddPrevalueRow("XPath Expression", @"can use the tokens $ancestorOrSelf, $parentPage and $currentPage, eg.
+
+ all siblings: $parentPage//*[@id != $currentPage/@id]
+ ", this.xPathTextBox, this.xPathRequiredFieldValidator, this.xPathCustomValidator);
writer.AddPrevalueRow("Storage Type", this.storageTypeRadioButtonList);
writer.AddPrevalueRow("Values", this.valueTypeDropDownList);
}
diff --git a/src/umbraco.editorControls/XPathDropDownList/XPathDropDownListPreValueEditor.cs b/src/umbraco.editorControls/XPathDropDownList/XPathDropDownListPreValueEditor.cs
index 66adf19e3d..82ee7c15a4 100644
--- a/src/umbraco.editorControls/XPathDropDownList/XPathDropDownListPreValueEditor.cs
+++ b/src/umbraco.editorControls/XPathDropDownList/XPathDropDownListPreValueEditor.cs
@@ -153,7 +153,10 @@ namespace umbraco.editorControls.XPathDropDownList
///
protected override void RenderContents(HtmlTextWriter writer)
{
- writer.AddPrevalueRow("XPath Expression", this.xPathTextBox, this.xPathRequiredFieldValidator, this.xPathCustomValidator);
+ writer.AddPrevalueRow("XPath Expression", @"can use the tokens $ancestorOrSelf, $parentPage and $currentPage, eg.
+
+ all siblings: $parentPage//*[@id != $currentPage/@id]
+ ", this.xPathTextBox, this.xPathRequiredFieldValidator, this.xPathCustomValidator);
writer.AddPrevalueRow("Value", this.valueTypeDropDownList);
}