using System;
using System.Data;
using System.Xml;
using CMS.FormEngine;
using CMS.GlobalHelper;
using CMS.PortalEngine;
using CMS.UIControls;
using CMS.URLRewritingEngine;
using CMS.PortalControls;
public partial class CMSModules_PortalEngine_UI_WebParts_Development_WebPart_Edit_Properties : SiteManagerPage
{
private int webPartId;
private WebPartInfo wi;
protected void Page_Load(object sender, EventArgs e)
{
Title = "WebPart Edit - Properties";
CurrentMaster.BodyClass += " FieldEditorBody";
// get webpart ID
webPartId = QueryHelper.GetInteger("webpartid", 0);
FieldEditor.Visible = false;
// If saved is found in query string
if (!RequestHelper.IsPostBack() && (QueryHelper.GetInteger("saved", 0) == 1))
{
ShowChangesSaved();
}
if (webPartId > 0)
{
// Get web part info
wi = WebPartInfoProvider.GetWebPartInfo(webPartId);
EditedObject = wi;
// Check if info object exists
if (wi != null)
{
// For inherited webpart display DefaultValue Editor
if (wi.WebPartParentID > 0)
{
FieldEditor.Visible = false;
pnlDefaultEditor.Visible = true;
defaultValueEditor.Visible = true;
defaultValueEditor.ParentWebPartID = wi.WebPartParentID;
if (wi.WebPartParentID > 0)
{
defaultValueEditor.DefaultValueXMLDefinition = wi.WebPartDefaultValues;
}
else
{
defaultValueEditor.DefaultValueXMLDefinition = wi.WebPartProperties;
}
// Add handler to
defaultValueEditor.XMLCreated += new EventHandler(defaultValueEditor_XMLCreated);
}
else
{
// Set field editor
FieldEditor.WebPartId = webPartId;
FieldEditor.Mode = FieldEditorModeEnum.WebPartProperties;
FieldEditor.Visible = true;
pnlDefaultEditor.Visible = false;
// Check newly created field for widgets update
FieldEditor.OnFieldCreated += UpdateWidgetsDefinition;
}
}
}
}
///