using System;
using System.Collections;
using System.Web;
using System.Web.UI;
using CMS.CMSHelper;
using CMS.ExtendedControls;
using CMS.GlobalHelper;
using CMS.UIControls;
public partial class CMSModules_AbuseReport_Controls_InlineAbuseReport : CMSUserControl
{
#region "Variables"
private string mReportDialogTitle = null;
private int mReportObjectID = 0;
private string mReportObjectType = null;
private string mConfirmationText = null;
private bool mDisplayButtons = true;
private readonly Hashtable parameters = new Hashtable();
#endregion
#region "Properties"
///
/// Gets and sets Confirmation text.
///
public string ConfirmationText
{
get
{
return mConfirmationText;
}
set
{
mConfirmationText = value;
}
}
///
/// Gets or sets Report title.
///
public string ReportTitle
{
get
{
return ValidationHelper.GetString(ViewState["ReportTitle"], null);
}
set
{
ViewState["ReportTitle"] = value;
}
}
///
/// Gets or sets CSS class.
///
public string CssClass
{
get
{
return lnkText.CssClass;
}
set
{
lnkText.CssClass = value;
}
}
///
/// Gets or sets Report dialog title.
///
public string ReportDialogTitle
{
get
{
if (string.IsNullOrEmpty(mReportDialogTitle))
{
return GetString("abuse.title");
}
return mReportDialogTitle;
}
set
{
mReportDialogTitle = value;
}
}
///
/// Gets or sets Report Object ID.
///
public int ReportObjectID
{
get
{
return mReportObjectID;
}
set
{
mReportObjectID = value;
}
}
///
/// Gets or sets Report Object type.
///
public string ReportObjectType
{
get
{
return mReportObjectType;
}
set
{
mReportObjectType = value;
}
}
///
/// Gets wrapping panel.
///
public SecurityPanel CMSPanel
{
get
{
return ucWrapPanel;
}
}
///
/// Indicates if buttons should be displayed.
///
public bool DisplayButtons
{
get
{
return mDisplayButtons;
}
set
{
mDisplayButtons = value;
}
}
///
/// Dialog control identifier.
///
protected string Identifier
{
get
{
string identifier = ValidationHelper.GetString(ViewState["Identifier"], null);
if (identifier == null)
{
identifier = Guid.NewGuid().ToString();
ViewState["Identifier"] = identifier;
}
return identifier;
}
}
#endregion
#region "Page events"
protected void Page_PreRender(object sender, EventArgs e)
{
ScriptHelper.RegisterDialogScript(Page);
string url = IsLiveSite
? CMSContext.ResolveDialogUrl("~/CMSModules/AbuseReport/CMSPages/ReportAbuse.aspx")
: CMSContext.ResolveDialogUrl("~/CMSModules/AbuseReport/Dialogs/ReportAbuse.aspx");
url = URLHelper.AddParameterToUrl(url, "params", Identifier);
parameters.Add("confirmationtext", ConfirmationText);
parameters.Add("reporttitle", ReportTitle);
parameters.Add("reportdialogtitle", ReportDialogTitle);
parameters.Add("reportobjectid", ReportObjectID);
parameters.Add("reportobjecttype", ReportObjectType);
parameters.Add("reporturl", URLHelper.CurrentURL);
WindowHelper.Add(Identifier, parameters);
lnkText.NavigateUrl = "javascript:modalDialog('" + url + "', 'reportDialog', 425, 370);";
}
#endregion
}