using System; using System.Data; using System.Collections; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using CMS.FormControls; using CMS.UIControls; public partial class CMSModules_MessageBoards_Controls_Messages_BoardSelector : FormEngineUserControl { #region "Variables" private bool mAddAllItemsRecord = false; private int mGroupId = 0; private int mSiteId = 0; #endregion #region "Public properties" /// /// ID of the current group. /// public int GroupID { get { return mGroupId; } set { mGroupId = value; } } /// /// ID of the current site. /// public int SiteID { get { return mSiteId; } set { mSiteId = value; } } /// /// Gets or sets the enabled state of the control. /// public override bool Enabled { get { return base.Enabled; } set { base.Enabled = value; if (uniSelector != null) { uniSelector.Enabled = value; } } } /// /// Gets or sets the field value. /// public override object Value { get { return uniSelector.Value; } set { if (uniSelector == null) { pnlUpdate.LoadContainer(); } uniSelector.Value = value; } } /// /// Gets or sets the value which determines, whether to add none item record to the dropdownlist. /// public bool AddAllItemsRecord { get { return mAddAllItemsRecord; } set { mAddAllItemsRecord = value; } } /// /// Gets the inner UniSelector control. /// public UniSelector UniSelector { get { return uniSelector; } } #endregion protected void Page_Load(object sender, EventArgs e) { if (StopProcessing) { uniSelector.StopProcessing = true; } else { ReloadData(); } } /// /// Reloads the data in the selector. /// public void ReloadData() { uniSelector.WhereCondition = "BoardSiteID = " + SiteID + " AND " + (GroupID > 0 ? "BoardGroupID = " + GroupID : "((BoardGroupID = 0) OR (BoardGroupID IS NULL))"); uniSelector.IsLiveSite = IsLiveSite; uniSelector.SelectionMode = SelectionModeEnum.SingleDropDownList; uniSelector.AllowAll = false; uniSelector.AllowEmpty = false; if (AddAllItemsRecord) { uniSelector.SpecialFields = new string[,] { { GetString("general.selectall"), "ALL" } }; } } }