uComponents: Tidying up old comments, paths and references.

This commit is contained in:
leekelleher
2012-04-29 22:41:43 -01:00
parent e8303b255e
commit e26f0f96c2
27 changed files with 945 additions and 1287 deletions

View File

@@ -74,9 +74,9 @@ namespace umbraco.editorControls.MultiNodeTreePicker
case NodeSelectionType.Picker:
//if it is a picker, then find the start node id
var definedId = this.GetPersistedCookieValue(
x => x.MntpGetStartNodeId(this.GetDataTypeId()), uQuery.RootNodeId);
x => x.MntpGetStartNodeId(this.GetDataTypeId()), uQuery.RootNodeId);
//return a document with id -1 (don't set this up as it will exception!)
m_DefinedStartNodeDoc = (definedId > 0) ? new Document(definedId) : new Document(uQuery.RootNodeId, true);
m_DefinedStartNodeDoc = (definedId > 0) ? new Document(definedId) : new Document(uQuery.RootNodeId, true);
break;
case NodeSelectionType.XPathExpression:
//if it is an expression, then we need to find the start node based on the xpression type, etc...
@@ -106,7 +106,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker
//if it's a FromCurrent expression, then we need to run the xpath from this node and below
var currId =
this.GetPersistedCookieValue(
x => x.MntpGetCurrentEditingNode(this.GetDataTypeId()), uQuery.RootNodeId);
x => x.MntpGetCurrentEditingNode(this.GetDataTypeId()), uQuery.RootNodeId);
var currNode = umbraco.library.GetXmlNodeById(currId.ToString());
if (currNode.MoveNext())
{
@@ -177,7 +177,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker
var startNode = new Document(StartNodeID);
rootNode.Text = startNode.Text;
rootNode.Icon = startNode.ContentTypeIcon;
}
}
}
}
@@ -190,12 +190,12 @@ namespace umbraco.editorControls.MultiNodeTreePicker
{
base.OnRenderNode(ref xNode, doc);
var dataTypeId = this.GetDataTypeId();
var xpath = this.GetXPathFromCookie(dataTypeId);
var xPathType = this.GetXPathFilterTypeFromCookie(dataTypeId);
var dataTypeId = this.GetDataTypeId();
var xpath = this.GetXPathFromCookie(dataTypeId);
var xPathType = this.GetXPathFilterTypeFromCookie(dataTypeId);
// resolves any Umbraco params in the XPath
xpath = uQuery.ResolveXPath(xpath);
// resolves any Umbraco params in the XPath
xpath = uQuery.ResolveXPath(xpath);
var xDoc = new XmlDocument();
XmlNode xmlDoc;
@@ -214,8 +214,8 @@ namespace umbraco.editorControls.MultiNodeTreePicker
xNode.DetermineClickable(xpath, xPathType, xml);
//ensure that the NodeKey is passed through
xNode.Source = this.GetTreeServiceUrlWithParams(int.Parse(xNode.NodeID), dataTypeId);
}
xNode.Source = this.GetTreeServiceUrlWithParams(int.Parse(xNode.NodeID), dataTypeId);
}
#endregion
}
}

View File

@@ -6,29 +6,29 @@ using umbraco.cms.presentation.Trees;
namespace umbraco.editorControls.MultiNodeTreePicker
{
/// <summary>
/// FilteredMediaTree for the MultiNodeTreePicker.
/// </summary>
/// <summary>
/// FilteredMediaTree for the MultiNodeTreePicker.
/// </summary>
public class FilteredMediaTree : BaseMediaTree
{
/// <summary>
/// Initializes a new instance of the <see cref="FilteredMediaTree"/> class.
/// </summary>
/// <param name="app">The app.</param>
/// <summary>
/// Initializes a new instance of the <see cref="FilteredMediaTree"/> class.
/// </summary>
/// <param name="app">The app.</param>
public FilteredMediaTree(string app)
: base(app)
{
}
/// <summary>
///
/// </summary>
/// <summary>
///
/// </summary>
private Media m_UserStartNodeMedia;
/// <summary>
///
/// </summary>
private Media m_DefinedStartNodeMedia;
/// <summary>
///
/// </summary>
private Media m_DefinedStartNodeMedia;
/// <summary>
/// Returns the Media object of the starting node for the current User. This ensures
@@ -112,7 +112,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker
var startNode = new Media(StartNodeID);
rootNode.Text = startNode.Text;
rootNode.Icon = startNode.ContentTypeIcon;
}
}
}
}
@@ -140,7 +140,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker
node.Source = this.GetTreeServiceUrlWithParams(int.Parse(node.NodeID), this.GetDataTypeId());
base.OnBeforeNodeRender(ref sender, ref node, e);
}
}
#endregion
}
}

View File

@@ -39,7 +39,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("uComponents.DataTypes.MultiNodeTreePicker.MNTPResources", typeof(MNTPResources).Assembly);
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("umbraco.editorControls.MultiNodeTreePicker.MNTPResources", typeof(MNTPResources).Assembly);
resourceMan = temp;
}
return resourceMan;

View File

@@ -112,10 +112,10 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Desc_MaxItemsAllowed" xml:space="preserve">
<value>The maximum number of items that are allowed to be selected by a content editor. If an unlimited number of node selections should be allowed, then enter -1 as the value</value>
@@ -124,7 +124,7 @@
<value>The minimum number of items that are allowed to be selected by a content editor.</value>
</data>
<data name="Desc_NodeSelectionType" xml:space="preserve">
<value>Nodes can be selected from a parent node (Node Picker) or by an XPath expression. NOTE:When using an XPath expression, only published nodes can be shown.</value>
<value>Nodes can be selected from a parent node (Node Picker) or by an XPath expression. NOTE: When using an XPath expression, only published nodes can be shown.</value>
</data>
<data name="Desc_ShowThumbnails" xml:space="preserve">
<value>If enabled and 'media' is selected as the tree type then a thumbnail will be rendered for each item selected.</value>
@@ -139,13 +139,13 @@
<value>You can specify to store the data in Umbraco as comma seperated or as XML. By default it is stored as XML which makes it easier to use the saved value in XSLT, however, storing it as comma seperated makes it easier to work with the data using the API such as Node factory.</value>
</data>
<data name="Desc_XPathExpression" xml:space="preserve">
<value>This XPath expression is used to select a starting node and depends on the XPath expression type chosen (global or from current). IMPORTANT: This XPath expression should be written to match ONE node, if the expression matches more than one node, then the first node matched will be used as the start node.</value>
<value>This XPath expression is used to select a starting node and depends on the XPath expression type chosen (global or from current). &lt;u&gt;IMPORTANT&lt;/u&gt;: This XPath expression should be written to match &lt;b&gt;ONE&lt;/b&gt; node, if the expression matches more than one node, then the first node matched will be used as the start node.</value>
</data>
<data name="Desc_XPathExpressionType" xml:space="preserve">
<value>The XPath expression that is evaluated to match a start node can be evaluated at a global tree level, or matched from the current node being edited.</value>
</data>
<data name="Desc_XPathFilter" xml:space="preserve">
<value>An xpath filter to match nodes that will be either enabled or disabled from being clicked (depending on what is selected for the XPath filter type). This XPath filter is for one node only so it should be formatted to select only one node. The XML to XPath against is the same as the Umbraco XML for one node.&lt;br/&gt;&lt;br/&gt;Example: /*[name()='myNodeType' or name()='yourNodeType'] &lt;br/&gt;&lt;br/&gt;The above would make all nodes of types: myNodeType or yourNodeType not selectable in the tree</value>
<value>An xpath filter to match nodes that will be either enabled or disabled from being clicked (depending on what is selected for the XPath filter type). This XPath filter is for one node only so it should be formatted to select only one node. The XML to XPath against is the same as the Umbraco XML for one node.&lt;br/&gt;&lt;br/&gt;Example: &lt;code&gt;/*[self::'myNodeType or self::yourNodeType]&lt;/code&gt;&lt;br/&gt;&lt;br/&gt;The above would make all nodes of types: myNodeType or yourNodeType not selectable in the tree</value>
</data>
<data name="Desc_XPathFilterType" xml:space="preserve">
<value>Should the XPath filter match nodes to enable nodes or disable nodes. If Enable is selected, this means that only nodes that match the XPath filter will be allowed to be selected in the tree picker and vise versa for Disabled</value>

View File

@@ -12,6 +12,9 @@ using umbraco.controls.Images;
using umbraco.controls.Tree;
using umbraco.IO;
[assembly: WebResource("umbraco.editorControls.MultiNodeTreePicker.MultiNodePickerStyles.css", "text/css")]
[assembly: WebResource("umbraco.editorControls.MultiNodeTreePicker.MultiNodePickerScripts.js", "application/x-javascript")]
namespace umbraco.editorControls.MultiNodeTreePicker
{
/// <summary>
@@ -53,8 +56,8 @@ namespace umbraco.editorControls.MultiNodeTreePicker
contentTree.Tree.Title,
contentTree.Tree.IconClosed,
contentTree.Tree.IconOpened,
"uComponents.Core",
"DataTypes.MultiNodeTreePicker.FilteredContentTree",
"umbraco.editorControls",
"MultiNodeTreePicker.FilteredContentTree",
contentTree.Tree.Action),
contentTree.App);
@@ -67,8 +70,8 @@ namespace umbraco.editorControls.MultiNodeTreePicker
contentTree.Tree.Title,
contentTree.Tree.IconClosed,
contentTree.Tree.IconOpened,
"uComponents.Core",
"DataTypes.MultiNodeTreePicker.FilteredMediaTree",
"umbraco.editorControls",
"MultiNodeTreePicker.FilteredMediaTree",
contentTree.Tree.Action),
contentTree.App);
@@ -561,7 +564,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker
writer.RenderEndTag(); //end multiNodePicker div
var tooltipAjaxUrl = IOHelper.ResolveUrl(SystemDirectories.Umbraco) + @"/plugins/MultiNodePicker/CustomTreeService.asmx/GetNodeInfo";
var tooltipAjaxUrl = IOHelper.ResolveUrl(SystemDirectories.Umbraco) + @"/controls/Tree/CustomTreeService.asmx/GetNodeInfo";
//add jquery window load event to create the js tree picker
var jsMethod = string.Format("jQuery('#{0}').MultiNodeTreePicker('{1}', {2}, '{3}', {4}, {5}, '{6}', '{7}');",

View File

@@ -3,8 +3,6 @@ using System.Collections;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
// using uComponents.Core;
// using uComponents.DataTypes.Shared.Extensions;
using umbraco.cms.businesslogic.datatype;
using umbraco.interfaces;
using umbraco.uicontrols.TreePicker;
@@ -506,7 +504,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker
{
var desc = new HtmlGenericControl("div");
var descSpan = new HtmlGenericControl("span");
descSpan.InnerText = description;
descSpan.InnerHtml = description;
desc.Attributes.Add("class", "description");
desc.Controls.Add(descSpan);
div.Controls.Add(desc);
@@ -577,12 +575,12 @@ namespace umbraco.editorControls.MultiNodeTreePicker
/// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter"/> object that receives the server control content.</param>
protected override void Render(HtmlTextWriter writer)
{
writer.AddAttribute(HtmlTextWriterAttribute.Class, "uComponents");
writer.RenderBeginTag(HtmlTextWriterTag.Div); //start 'uComponents'
writer.AddAttribute(HtmlTextWriterAttribute.Class, "PrevalueEditor");
writer.RenderBeginTag(HtmlTextWriterTag.Div); //start 'PrevalueEditor'
base.Render(writer);
writer.RenderEndTag(); //end 'uComponents'
writer.RenderEndTag(); //end 'PrevalueEditor'
}

View File

@@ -12,7 +12,6 @@ namespace umbraco.editorControls.MultiNodeTreePicker
/// </summary>
internal class SelectedItemsTemplate : ITemplate
{
#region ITemplate Members
/// <summary>

View File

@@ -5,9 +5,9 @@ using umbraco.cms.presentation.Trees;
namespace umbraco.editorControls.MultiNodeTreePicker
{
/// <summary>
/// XmlTreeNode extensions for the MultiNodeTreePicker.
/// </summary>
/// <summary>
/// XmlTreeNode extensions for the MultiNodeTreePicker.
/// </summary>
public static class XmlTreeNodeExtensions
{
//public static void DetermineSelected(this XmlTreeNode node)
@@ -52,12 +52,12 @@ namespace umbraco.editorControls.MultiNodeTreePicker
{
//ensure the individual node is the correct color
node.Style.AddCustom("uc-treenode-noclick");
}
}
}
}
catch (XPathException)
{
node.Text = "uComponents: XPath Error!";
node.Text = "umbraco.editorControls: MNTP: XPath Error!";
}
}
else
@@ -71,7 +71,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker
{
//ensure the individual node is the correct color
node.Style.AddCustom("uc-treenode-noclick");
}
}
}
}
}