Work items: 29917, 30065, 30066

This commit is contained in:
hartvig
2011-02-22 13:23:15 -01:00
parent c2acb33933
commit 7be3314a11
5 changed files with 23 additions and 7 deletions

View File

@@ -10,6 +10,7 @@ using System.Web.UI.WebControls;
using ClientDependency.Core;
using umbraco.cms.helpers;
using umbraco.cms.presentation.Trees;
using umbraco.controls.GenericProperties;
using umbraco.IO;
using umbraco.presentation;
using umbraco.cms.businesslogic;
@@ -603,7 +604,7 @@ jQuery(function() { refreshDropDowns(); });
GenericProperties.GenericProperty gpData = gp.GenricPropertyControl;
if (gpData.Name.Trim() != "" && gpData.Alias.Trim() != "")
{
if (cType.getPropertyType(Casing.SafeAliasWithForcingCheck(gpData.Alias.Trim())) == null)
if (doesPropertyTypeAliasExist(gpData))
{
string[] info = { gpData.Name, gpData.Type.ToString() };
cms.businesslogic.propertytype.PropertyType pt = cType.AddPropertyType(cms.businesslogic.datatype.DataTypeDefinition.GetDataTypeDefinition(gpData.Type), Casing.SafeAliasWithForcingCheck(gpData.Alias.Trim()), gpData.Name);
@@ -665,6 +666,18 @@ jQuery(function() { refreshDropDowns(); });
}
}
private bool doesPropertyTypeAliasExist(GenericProperty gpData)
{
bool hasAlias = cType.getPropertyType(Casing.SafeAliasWithForcingCheck(gpData.Alias.Trim())) != null;
ContentType ct = cType;
while (ct.MasterContentType > 0)
{
ct = new ContentType(ct.MasterContentType);
hasAlias = ct.getPropertyType(Casing.SafeAliasWithForcingCheck(gpData.Alias.Trim())) != null;
}
return !hasAlias;
}
public bool HasRows(System.Data.DataView dv)
{
return (dv.Count == 0);

View File

@@ -154,7 +154,7 @@ body
background: url('../images/speechbubble/speechbubble_body.png') no-repeat;
width: 235px;
margin: 0;
padding: 10px 20px 10px 10px;
padding: 5px 20px 5px 10px;
}
.speechBubbleBottom
{
@@ -179,7 +179,7 @@ body
font-size: 11px;
font-family: Trebuchet MS, Lucida Grande, verdana, arial;
margin: 0;
width: 220px;
width: 180px;
}
#tray
{

View File

@@ -15,11 +15,11 @@ UmbracoSpeechBubble.prototype.GenerateSpeechBubble = function() {
sbHtml.innerHTML = '' +
'<div class="speechBubbleTop"></div>' +
'<div class="speechBubbleContent">' +
'<img id="' + this.id + 'Icon" style="float: left; margin: 0px 10px 10px 0;" />' +
'<img id="' + this.id + 'Icon" style="float: left; margin: 0px 5px 10px 3px;" />' +
' <img class="speechClose" onClick="UmbSpeechBubble.Hide();" id="' + this.id + 'close" src="/umbraco/images/speechBubble/speechBubble_close.gif" width="18" height="18" border="0" alt="Close"' +
' onmouseover="this.src = \'/umbraco/images/speechBubble/speechBubble_close_over.gif\';" onmouseout="this.src=\'images/speechBubble/speechBubble_close.gif\';">' +
' <h3 id="' + this.id + 'Header">The header!</h3>' +
' <p id="' + this.id + 'Message">Default Text Container!<br /></p>' +
' <div style="float: right; width: 186px; margin-right: 10px;"><h3 id="' + this.id + 'Header">The header!</h3>' +
' <p style="width: 185px" id="' + this.id + 'Message">Default Text Container!<br /></p></div><br style="clear: both" />' +
'</div>' +
'<div class="speechBubbleBottom"></div>'
}

View File

@@ -52,7 +52,7 @@ namespace umbraco.cms.presentation.members
else
{
ClientTools
.ShowSpeechBubble(speechBubbleIcon.save, e.Message, "")
.ShowSpeechBubble(e.IconType, e.Message, "")
.SyncTree(dt.Id.ToString(), true);
}

View File

@@ -47,6 +47,9 @@ namespace umbraco.cms.presentation.settings
} else if (sce.Message.Contains("Tab")) {
speechBubble(speechBubbleIcon.info, "Tab added", sce.Message);
} else
{
base.speechBubble(sce.IconType, sce.Message, "");
}
return true;