using System;
using System.Data;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CMS.CMSHelper;
using CMS.FormControls;
using CMS.GlobalHelper;
using CMS.UIControls;
using CMS.WorkflowEngine;
using CMS.SettingsProvider;
using CMS.ExtendedControls;
public partial class CMSModules_Workflows_Controls_UI_WorkflowAction_Edit : CMSAdminEditControl
{
#region "Properties"
///
/// Indicates whether allowed objects field should be hidden.
///
public bool HideAllowedObjects
{
get;
set;
}
///
/// Forced allowed objects for action.
///
public string AllowedObjects
{
get;
set;
}
///
/// Current object type.
///
public string ObjectType
{
get
{
return formElem.ObjectType;
}
set
{
formElem.ObjectType = value;
}
}
///
/// Edited workflow action.
///
public WorkflowActionInfo CurrentAction
{
get
{
return (WorkflowActionInfo)formElem.EditedObject;
}
}
#endregion
#region "Page events"
protected void Page_Load(object sender, EventArgs e)
{
ucFile.ObjectID = CurrentAction.ActionID;
ucFile.ObjectType = ObjectType;
ucFile.Category = CMSConstants.OBJECT_CATEGORY_THUMBNAIL;
ucIcon.ObjectID = CurrentAction.ActionID;
ucIcon.ObjectType = ObjectType;
ucIcon.Category = CMSConstants.OBJECT_CATEGORY_ICON;
pnlImages.Visible = (formElem.Mode != FormModeEnum.Insert);
if (!String.IsNullOrEmpty(AllowedObjects))
{
// Ensure correct allowed objects format
CurrentAction.ActionAllowedObjects = ";" + AllowedObjects.Trim(';') + ";";
}
if (HideAllowedObjects)
{
aAlowedObjects.Visible = false;
}
else if (!RequestHelper.IsPostBack())
{
objectTypeSelector.ObjectType = CurrentAction.ActionAllowedObjects;
}
}
#endregion
}