Fixes: 26812 - editContent error checking
Fixes: 26813 - Document.cs optimized constructor & Save() fix Fixes: 26814 - null tree preventing UI to be drawn [TFS Changeset #65617]
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ClientDependency.Core;
|
||||
|
||||
namespace umbraco.uicontrols {
|
||||
public class Feedback : System.Web.UI.WebControls.Panel {
|
||||
|
||||
[ClientDependency(ClientDependencyType.Css, "ui/default.css", "UmbracoClient")]
|
||||
public class Feedback : System.Web.UI.WebControls.Panel
|
||||
{
|
||||
|
||||
public Feedback() {
|
||||
|
||||
@@ -15,9 +19,6 @@ namespace umbraco.uicontrols {
|
||||
protected override void OnLoad(System.EventArgs EventArguments) {
|
||||
}
|
||||
|
||||
private bool _hasMenu = false;
|
||||
private string _StatusBarText = "";
|
||||
|
||||
public feedbacktype type { get; set; }
|
||||
|
||||
private string _text = string.Empty;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Web;
|
||||
|
||||
using System.Linq;
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.DataLayer;
|
||||
using umbraco.IO;
|
||||
using System.Web.UI;
|
||||
|
||||
namespace umbraco.BasePages {
|
||||
/// <summary>
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BasePages\ClientTools.cs" />
|
||||
<Compile Include="BasePages\UmbracoBasePage.cs">
|
||||
<Compile Include="BasePages\UmbracoEnsuredPage.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="CacheHelper.cs" />
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace umbraco.cms.businesslogic.web
|
||||
/// </summary>
|
||||
public class Document : Content
|
||||
{
|
||||
#region Constants
|
||||
private const string m_SQLOptimizedSingle = @"
|
||||
Select
|
||||
(select count(id) from umbracoNode where parentId = @id) as Children,
|
||||
@@ -35,7 +36,7 @@ namespace umbraco.cms.businesslogic.web
|
||||
cmsContentVersion.VersionId,
|
||||
cmsContentVersion.versionDate,
|
||||
contentTypeNode.uniqueId as ContentTypeGuid,
|
||||
cmsContent.ContentType, cmsContentType.icon, cmsContentType.alias, cmsContentType.thumbnail, cmsContentType.description, cmsContentType.masterContentType, cmsContentType.nodeId as contentTypeId
|
||||
cmsContent.ContentType, cmsContentType.icon, cmsContentType.alias, cmsContentType.thumbnail, cmsContentType.description, cmsContentType.masterContentType, cmsContentType.nodeId as contentTypeId,
|
||||
published, documentUser, coalesce(templateId, cmsDocumentType.templateNodeId) as templateId, cmsDocument.text as DocumentText, releaseDate, expireDate, updateDate,
|
||||
umbracoNode.createDate, umbracoNode.trashed, umbracoNode.parentId, umbracoNode.nodeObjectType, umbracoNode.nodeUser, umbracoNode.level, umbracoNode.path, umbracoNode.sortOrder, umbracoNode.uniqueId, umbracoNode.text
|
||||
from
|
||||
@@ -84,8 +85,10 @@ namespace umbraco.cms.businesslogic.web
|
||||
inner join cmsPreviewXml on cmsPreviewXml.nodeId = cmsDocument.nodeId and cmsPreviewXml.versionId = cmsDocument.versionId
|
||||
where newest = 1 and trashed = 0 and path like '{0}'
|
||||
order by level,sortOrder
|
||||
";
|
||||
";
|
||||
#endregion
|
||||
|
||||
#region Private properties
|
||||
public static Guid _objectType = new Guid("c66ba18e-eaf3-4cff-8a22-41b16d66a972");
|
||||
private DateTime _updated;
|
||||
private DateTime _release;
|
||||
@@ -109,6 +112,51 @@ namespace umbraco.cms.businesslogic.web
|
||||
// special for tree performance
|
||||
private int _userId = -1;
|
||||
|
||||
private Dictionary<Property, object> _knownProperties = new Dictionary<Property, object>();
|
||||
private Func<KeyValuePair<Property, object>, string, bool> propertyTypeByAlias = (pt, alias) => pt.Key.PropertyType.Alias == alias;
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Indexed property to return the property value by name
|
||||
/// </summary>
|
||||
/// <param name="alias"></param>
|
||||
/// <returns></returns>
|
||||
public object this[string alias]
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._optimizedMode)
|
||||
{
|
||||
return this._knownProperties.Single(p => propertyTypeByAlias(p, alias)).Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.getProperty(alias).Value;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this._optimizedMode)
|
||||
{
|
||||
if (this._knownProperties.SingleOrDefault(p => propertyTypeByAlias(p, alias)).Key == null)
|
||||
{
|
||||
var pt = this.getProperty(alias);
|
||||
|
||||
this._knownProperties.Add(pt, pt.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
var pt = this._knownProperties.Single(p => propertyTypeByAlias(p, alias)).Key;
|
||||
this._knownProperties[pt] = value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.getProperty(alias).Value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the document was constructed for the optimized mode
|
||||
/// </summary>
|
||||
@@ -451,9 +499,9 @@ namespace umbraco.cms.businesslogic.web
|
||||
public Document(bool optimizedMode, int id)
|
||||
: base(id, optimizedMode)
|
||||
{
|
||||
this._optimizedMode = OptimizedMode;
|
||||
this._optimizedMode = optimizedMode;
|
||||
|
||||
if (OptimizedMode)
|
||||
if (optimizedMode)
|
||||
{
|
||||
|
||||
using (IRecordsReader dr =
|
||||
@@ -522,7 +570,7 @@ namespace umbraco.cms.businesslogic.web
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to persist object changes to the database. In Version3.0 it's just a stub for future compatibility
|
||||
/// Used to persist object changes to the database.
|
||||
/// </summary>
|
||||
public override void Save()
|
||||
{
|
||||
@@ -1750,47 +1798,7 @@ namespace umbraco.cms.businesslogic.web
|
||||
AfterRollBack(this, e);
|
||||
}
|
||||
|
||||
private Dictionary<Property, object> _knownProperties;
|
||||
private Func<KeyValuePair<Property, object>, string, bool> propertyTypeByAlias = (pt, alias) => pt.Key.PropertyType.Alias == alias;
|
||||
public object this[string alias]
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._optimizedMode)
|
||||
{
|
||||
if (this._knownProperties == null) this._knownProperties = new Dictionary<Property, object>();
|
||||
|
||||
return this._knownProperties.Single(p => propertyTypeByAlias(p, alias)).Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.getProperty(alias).Value;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this._optimizedMode)
|
||||
{
|
||||
if (this._knownProperties == null) this._knownProperties = new Dictionary<Property, object>();
|
||||
|
||||
if (this._knownProperties.SingleOrDefault(p => propertyTypeByAlias(p, alias)).Key == null)
|
||||
{
|
||||
var pt = this.getProperty(alias);
|
||||
|
||||
this._knownProperties.Add(pt, pt.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
var pt = this._knownProperties.Single(p => propertyTypeByAlias(p, alias)).Key;
|
||||
this._knownProperties[pt] = value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.getProperty(alias).Value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
60
umbraco/presentation/BasePageExtensions.cs
Normal file
60
umbraco/presentation/BasePageExtensions.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using umbraco.BasePages;
|
||||
using umbraco.uicontrols;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using ClientDependency.Core;
|
||||
|
||||
namespace umbraco.presentation
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension methods for the Umbraco BasePage
|
||||
/// </summary>
|
||||
public static class BasePageExtensions
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Used to display an error message to the user and disable further execution.
|
||||
/// This will remove all controls from being rendered and show a feedback control with an error
|
||||
/// </summary>
|
||||
/// <param name="msg"></param>
|
||||
public static void DisplayFatalError(this BasePage page, string msg)
|
||||
{
|
||||
foreach (var ctl in page.Controls.Cast<Control>())
|
||||
{
|
||||
if (!HideControls(ctl))
|
||||
{
|
||||
var ctls = ctl.FlattenChildren();
|
||||
foreach (var c in ctls)
|
||||
{
|
||||
HideControls(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
var feedback = new Feedback();
|
||||
feedback.type = Feedback.feedbacktype.error;
|
||||
feedback.Text = string.Format("<b>{0}</b><br/><br/>{1}", ui.GetText("error"), msg);
|
||||
page.Controls.Add(feedback);
|
||||
}
|
||||
|
||||
private static bool HideControls(this Control c)
|
||||
{
|
||||
if (c is MasterPage)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (c is UserControl || c is WebControl || c is HtmlForm)
|
||||
{
|
||||
c.Visible = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ NOTES:
|
||||
* Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config
|
||||
* A new version will invalidate both client and server cache and create new persisted files
|
||||
-->
|
||||
<clientDependency version="22">
|
||||
<clientDependency version="24">
|
||||
|
||||
<fileRegistration defaultProvider="PageHeaderProvider" fileDependencyExtensions=".js,.css">
|
||||
<providers>
|
||||
|
||||
@@ -199,6 +199,7 @@
|
||||
<Compile Include="AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BasePageExtensions.cs" />
|
||||
<Compile Include="config\splashes\booting.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
<DependentUpon>booting.aspx</DependentUpon>
|
||||
|
||||
@@ -16,7 +16,8 @@ using umbraco.IO;
|
||||
using umbraco.uicontrols.DatePicker;
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.presentation.preview;
|
||||
|
||||
using umbraco.cms.businesslogic.web;
|
||||
using umbraco.presentation;
|
||||
|
||||
namespace umbraco.cms.presentation
|
||||
{
|
||||
@@ -25,20 +26,11 @@ namespace umbraco.cms.presentation
|
||||
protected uicontrols.TabView TabView1;
|
||||
protected System.Web.UI.WebControls.TextBox documentName;
|
||||
private cms.businesslogic.web.Document _document;
|
||||
protected System.Web.UI.WebControls.Literal jsIds;
|
||||
|
||||
/*
|
||||
private controls.datePicker dp = new controls.datePicker();
|
||||
private controls.datePicker dpRelease = new controls.datePicker();
|
||||
private controls.datePicker dpExpire = new controls.datePicker();
|
||||
*/
|
||||
|
||||
protected System.Web.UI.WebControls.Literal jsIds;
|
||||
private LiteralControl dp = new LiteralControl();
|
||||
private DateTimePicker dpRelease = new DateTimePicker();
|
||||
private DateTimePicker dpExpire = new DateTimePicker();
|
||||
|
||||
//private bool _refreshTree = false;
|
||||
|
||||
controls.ContentControl tmp;
|
||||
|
||||
DropDownList ddlDefaultTemplate = new DropDownList();
|
||||
@@ -51,13 +43,150 @@ namespace umbraco.cms.presentation
|
||||
|
||||
private Literal l = new Literal();
|
||||
private Literal domainText = new Literal();
|
||||
|
||||
//protected System.Web.UI.WebControls.Literal SyncPath;
|
||||
|
||||
private controls.ContentControl.publishModes _canPublish = controls.ContentControl.publishModes.Publish;
|
||||
|
||||
private int? m_ContentId = null;
|
||||
|
||||
override protected void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
|
||||
//validate!
|
||||
int id;
|
||||
if (!int.TryParse(Request.QueryString["id"], out id))
|
||||
{
|
||||
//if this is invalid show an error
|
||||
this.DisplayFatalError("Invalid query string");
|
||||
return;
|
||||
}
|
||||
m_ContentId = id;
|
||||
|
||||
|
||||
this.UnPublish.Click += new System.EventHandler(this.UnPublishDo);
|
||||
|
||||
//_document = new cms.businesslogic.web.Document(int.Parse(Request.QueryString["id"]));
|
||||
_document = new Document(true, id);
|
||||
|
||||
// Check publishing permissions
|
||||
if (!base.getUser().GetPermissions(_document.Path).Contains(ActionPublish.Instance.Letter.ToString()))
|
||||
_canPublish = controls.ContentControl.publishModes.SendToPublish;
|
||||
tmp = new controls.ContentControl(_document, _canPublish, "TabView1");
|
||||
|
||||
tmp.ID = "TabView1";
|
||||
|
||||
tmp.Width = Unit.Pixel(666);
|
||||
tmp.Height = Unit.Pixel(666);
|
||||
|
||||
// Add preview button
|
||||
|
||||
foreach (uicontrols.TabPage tp in tmp.GetPanels())
|
||||
{
|
||||
addPreviewButton(tp.Menu, _document.Id);
|
||||
}
|
||||
|
||||
plc.Controls.Add(tmp);
|
||||
|
||||
|
||||
System.Web.UI.WebControls.PlaceHolder publishStatus = new PlaceHolder();
|
||||
if (_document.Published)
|
||||
{
|
||||
littPublishStatus.Text = ui.Text("content", "lastPublished", base.getUser()) + ": " + _document.VersionDate.ToShortDateString() + " ";
|
||||
|
||||
publishStatus.Controls.Add(littPublishStatus);
|
||||
if (base.getUser().GetPermissions(_document.Path).IndexOf("U") > -1)
|
||||
UnPublish.Visible = true;
|
||||
else
|
||||
UnPublish.Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
littPublishStatus.Text = ui.Text("content", "itemNotPublished", base.getUser());
|
||||
publishStatus.Controls.Add(littPublishStatus);
|
||||
UnPublish.Visible = false;
|
||||
}
|
||||
|
||||
UnPublish.Text = ui.Text("content", "unPublish", base.getUser());
|
||||
UnPublish.ID = "UnPublishButton";
|
||||
UnPublish.Attributes.Add("onClick", "if (!confirm('" + ui.Text("defaultdialogs", "confirmSure", base.getUser()) + "')) return false; ");
|
||||
publishStatus.Controls.Add(UnPublish);
|
||||
|
||||
publishProps.addProperty(ui.Text("content", "publishStatus", base.getUser()), publishStatus);
|
||||
|
||||
// Template
|
||||
PlaceHolder template = new PlaceHolder();
|
||||
cms.businesslogic.web.DocumentType DocumentType = new cms.businesslogic.web.DocumentType(_document.ContentType.Id);
|
||||
tmp.PropertiesPane.addProperty(ui.Text("documentType"), new LiteralControl(DocumentType.Text));
|
||||
tmp.PropertiesPane.addProperty(ui.Text("template"), template);
|
||||
|
||||
int defaultTemplate;
|
||||
if (_document.Template != 0)
|
||||
defaultTemplate = _document.Template;
|
||||
else
|
||||
defaultTemplate = DocumentType.DefaultTemplate;
|
||||
|
||||
if (this.getUser().UserType.Name == "writer")
|
||||
{
|
||||
if (defaultTemplate != 0)
|
||||
template.Controls.Add(new LiteralControl(cms.businesslogic.template.Template.GetTemplate(defaultTemplate).Text));
|
||||
else
|
||||
template.Controls.Add(new LiteralControl(ui.Text("content", "noDefaultTemplate")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ddlDefaultTemplate.Items.Add(new ListItem(ui.Text("choose") + "...", ""));
|
||||
foreach (cms.businesslogic.template.Template t in DocumentType.allowedTemplates)
|
||||
{
|
||||
ListItem tTemp = new ListItem(t.Text, t.Id.ToString());
|
||||
if (t.Id == defaultTemplate)
|
||||
tTemp.Selected = true;
|
||||
ddlDefaultTemplate.Items.Add(tTemp);
|
||||
}
|
||||
template.Controls.Add(ddlDefaultTemplate);
|
||||
}
|
||||
|
||||
|
||||
// Editable update date, release date and expire date added by NH 13.12.04
|
||||
dp.ID = "updateDate";
|
||||
dp.Text = _document.UpdateDate.ToShortDateString() + " " + _document.UpdateDate.ToShortTimeString();
|
||||
publishProps.addProperty(ui.Text("content", "updateDate", base.getUser()), dp);
|
||||
|
||||
dpRelease.ID = "releaseDate";
|
||||
dpRelease.DateTime = _document.ReleaseDate;
|
||||
dpRelease.ShowTime = true;
|
||||
publishProps.addProperty(ui.Text("content", "releaseDate", base.getUser()), dpRelease);
|
||||
|
||||
dpExpire.ID = "expireDate";
|
||||
dpExpire.DateTime = _document.ExpireDate;
|
||||
dpExpire.ShowTime = true;
|
||||
publishProps.addProperty(ui.Text("content", "expireDate", base.getUser()), dpExpire);
|
||||
|
||||
// url's
|
||||
updateLinks();
|
||||
linkProps.addProperty(ui.Text("content", "urls", base.getUser()), l);
|
||||
|
||||
if (domainText.Text != "")
|
||||
linkProps.addProperty(ui.Text("content", "alternativeUrls", base.getUser()), domainText);
|
||||
|
||||
tmp.Save += new System.EventHandler(Save);
|
||||
tmp.SaveAndPublish += new System.EventHandler(Publish);
|
||||
tmp.SaveToPublish += new System.EventHandler(SendToPublish);
|
||||
|
||||
// Add panes to property page...
|
||||
tmp.tpProp.Controls.Add(publishProps);
|
||||
tmp.tpProp.Controls.Add(linkProps);
|
||||
|
||||
// add preview to properties pane too
|
||||
addPreviewButton(tmp.tpProp.Menu, _document.Id);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, System.EventArgs e)
|
||||
{
|
||||
if (!m_ContentId.HasValue)
|
||||
return;
|
||||
|
||||
if (!CheckUserValidation())
|
||||
return;
|
||||
|
||||
@@ -191,7 +320,7 @@ namespace umbraco.cms.presentation
|
||||
|
||||
//newPublishStatus.Text = "0";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void updateLinks()
|
||||
{
|
||||
@@ -307,129 +436,6 @@ namespace umbraco.cms.presentation
|
||||
}
|
||||
}
|
||||
|
||||
#region Web Form Designer generated code
|
||||
override protected void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
|
||||
this.UnPublish.Click += new System.EventHandler(this.UnPublishDo);
|
||||
|
||||
_document = new cms.businesslogic.web.Document(int.Parse(Request.QueryString["id"]));
|
||||
|
||||
// Check publishing permissions
|
||||
if (!base.getUser().GetPermissions(_document.Path).Contains(ActionPublish.Instance.Letter.ToString()))
|
||||
_canPublish = controls.ContentControl.publishModes.SendToPublish;
|
||||
tmp = new controls.ContentControl(_document, _canPublish, "TabView1");
|
||||
|
||||
tmp.ID = "TabView1";
|
||||
|
||||
tmp.Width = Unit.Pixel(666);
|
||||
tmp.Height = Unit.Pixel(666);
|
||||
|
||||
// Add preview button
|
||||
|
||||
foreach (uicontrols.TabPage tp in tmp.GetPanels())
|
||||
{
|
||||
addPreviewButton(tp.Menu, _document.Id);
|
||||
}
|
||||
|
||||
plc.Controls.Add(tmp);
|
||||
|
||||
|
||||
System.Web.UI.WebControls.PlaceHolder publishStatus = new PlaceHolder();
|
||||
if (_document.Published)
|
||||
{
|
||||
littPublishStatus.Text = ui.Text("content", "lastPublished", base.getUser()) + ": " + _document.VersionDate.ToShortDateString() + " ";
|
||||
|
||||
publishStatus.Controls.Add(littPublishStatus);
|
||||
if (base.getUser().GetPermissions(_document.Path).IndexOf("U") > -1)
|
||||
UnPublish.Visible = true;
|
||||
else
|
||||
UnPublish.Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
littPublishStatus.Text = ui.Text("content", "itemNotPublished", base.getUser());
|
||||
publishStatus.Controls.Add(littPublishStatus);
|
||||
UnPublish.Visible = false;
|
||||
}
|
||||
|
||||
UnPublish.Text = ui.Text("content", "unPublish", base.getUser());
|
||||
UnPublish.ID = "UnPublishButton";
|
||||
UnPublish.Attributes.Add("onClick", "if (!confirm('" + ui.Text("defaultdialogs", "confirmSure", base.getUser()) + "')) return false; ");
|
||||
publishStatus.Controls.Add(UnPublish);
|
||||
|
||||
publishProps.addProperty(ui.Text("content", "publishStatus", base.getUser()), publishStatus);
|
||||
|
||||
// Template
|
||||
PlaceHolder template = new PlaceHolder();
|
||||
cms.businesslogic.web.DocumentType DocumentType = new cms.businesslogic.web.DocumentType(_document.ContentType.Id);
|
||||
tmp.PropertiesPane.addProperty(ui.Text("documentType"), new LiteralControl(DocumentType.Text));
|
||||
tmp.PropertiesPane.addProperty(ui.Text("template"), template);
|
||||
|
||||
int defaultTemplate;
|
||||
if (_document.Template != 0)
|
||||
defaultTemplate = _document.Template;
|
||||
else
|
||||
defaultTemplate = DocumentType.DefaultTemplate;
|
||||
|
||||
if (this.getUser().UserType.Name == "writer")
|
||||
{
|
||||
if (defaultTemplate != 0)
|
||||
template.Controls.Add(new LiteralControl(cms.businesslogic.template.Template.GetTemplate(defaultTemplate).Text));
|
||||
else
|
||||
template.Controls.Add(new LiteralControl(ui.Text("content", "noDefaultTemplate")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ddlDefaultTemplate.Items.Add(new ListItem(ui.Text("choose") + "...", ""));
|
||||
foreach (cms.businesslogic.template.Template t in DocumentType.allowedTemplates)
|
||||
{
|
||||
ListItem tTemp = new ListItem(t.Text, t.Id.ToString());
|
||||
if (t.Id == defaultTemplate)
|
||||
tTemp.Selected = true;
|
||||
ddlDefaultTemplate.Items.Add(tTemp);
|
||||
}
|
||||
template.Controls.Add(ddlDefaultTemplate);
|
||||
}
|
||||
|
||||
|
||||
// Editable update date, release date and expire date added by NH 13.12.04
|
||||
dp.ID = "updateDate";
|
||||
dp.Text = _document.UpdateDate.ToShortDateString() + " " + _document.UpdateDate.ToShortTimeString();
|
||||
publishProps.addProperty(ui.Text("content", "updateDate", base.getUser()), dp);
|
||||
|
||||
dpRelease.ID = "releaseDate";
|
||||
dpRelease.DateTime = _document.ReleaseDate;
|
||||
dpRelease.ShowTime = true;
|
||||
publishProps.addProperty(ui.Text("content", "releaseDate", base.getUser()), dpRelease);
|
||||
|
||||
dpExpire.ID = "expireDate";
|
||||
dpExpire.DateTime = _document.ExpireDate;
|
||||
dpExpire.ShowTime = true;
|
||||
publishProps.addProperty(ui.Text("content", "expireDate", base.getUser()), dpExpire);
|
||||
|
||||
// url's
|
||||
updateLinks();
|
||||
linkProps.addProperty(ui.Text("content", "urls", base.getUser()), l);
|
||||
|
||||
if (domainText.Text != "")
|
||||
linkProps.addProperty(ui.Text("content", "alternativeUrls", base.getUser()), domainText);
|
||||
|
||||
tmp.Save += new System.EventHandler(Save);
|
||||
tmp.SaveAndPublish += new System.EventHandler(Publish);
|
||||
tmp.SaveToPublish += new System.EventHandler(SendToPublish);
|
||||
|
||||
// Add panes to property page...
|
||||
tmp.tpProp.Controls.Add(publishProps);
|
||||
tmp.tpProp.Controls.Add(linkProps);
|
||||
|
||||
// add preview to properties pane too
|
||||
addPreviewButton(tmp.tpProp.Menu, _document.Id);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void addPreviewButton(uicontrols.ScrollingMenu menu, int id)
|
||||
{
|
||||
@@ -440,7 +446,5 @@ namespace umbraco.cms.presentation
|
||||
menuItem.ImageURL = SystemDirectories.Umbraco + "/images/editor/vis.gif";
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,13 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
|
||||
if (this.mainWindow().jQuery == null
|
||||
|| this.mainWindow().jQuery(".umbTree").length == 0
|
||||
|| this.mainWindow().jQuery(".umbTree").UmbracoTreeAPI() == null) {
|
||||
this._mainTree = null;
|
||||
//creates a false tree with all the public tree params set to a false method.
|
||||
var tmpTree = {};
|
||||
var treeProps = ["init", "setRecycleBinNodeId", "clearTreeCache", "toggleEditMode", "refreshTree", "rebuildTree", "saveTreeState", "syncTree", "childNodeCreated", "moveNode", "copyNode", "findNode", "selectNode", "reloadActionNode", "getActionNode", "setActiveTreeType", "getNodeDef"];
|
||||
for (var p in treeProps) {
|
||||
tmpTree[treeProps[p]] = function() { return false; };
|
||||
}
|
||||
this._mainTree = tmpTree;
|
||||
}
|
||||
else {
|
||||
this._mainTree = this.mainWindow().jQuery(".umbTree").UmbracoTreeAPI();
|
||||
|
||||
Reference in New Issue
Block a user