using System;
using System.Data;
using System.Web;
using System.Web.UI;
using CMS.CMSHelper;
using CMS.Community;
using CMS.GlobalHelper;
using CMS.PortalControls;
public partial class CMSWebParts_Community_Membership_LeaveGroup : CMSAbstractWebPart
{
#region "Public properties"
///
/// Leave confirmation text or resource string.
///
public string LeaveText
{
get
{
return ValidationHelper.GetString(GetValue("LeaveText"), "");
}
set
{
SetValue("LeaveText", value);
}
}
///
/// Gets or sets the text which should be displayed on join dialog after successful join action.
///
public string SuccessfullLeaveText
{
get
{
return ValidationHelper.GetString(GetValue("SuccessfullLeaveText"), "");
}
set
{
SetValue("SuccessfullLeaveText", value);
}
}
///
/// Gets or sets the text which should be displayed on join dialog if join actin was unsuccessful.
///
public string UnSuccessfullLeaveText
{
get
{
return ValidationHelper.GetString(GetValue("UnSuccessfullLeaveText"), "");
}
set
{
SetValue("UnSuccessfullLeaveText", value);
}
}
#endregion
#region "Public methods"
///
/// Content loaded event handler.
///
public override void OnContentLoaded()
{
base.OnContentLoaded();
SetupControl();
}
///
/// Initializes the control properties.
///
public void SetupControl()
{
if ((CommunityContext.CurrentGroup != null) && GroupMemberInfoProvider.IsMemberOfGroup(CMSContext.CurrentUser.UserID, CommunityContext.CurrentGroup.GroupID))
{
groupLeave.IsOnModalPage = false;
groupLeave.LeaveText = LeaveText;
groupLeave.SuccessfulLeaveText = SuccessfullLeaveText;
groupLeave.UnSuccessfulLeaveText = UnSuccessfullLeaveText;
groupLeave.Group = CommunityContext.CurrentGroup;
}
else
{
Visible = false;
}
}
#endregion
}