/// <summary> /// Initializes the control properties. /// </summary> protected void SetupControl() { if (StopProcessing) { // Do nothing } else { repUsers.DataBindByDefault = false; pagerElem.PageControl = repUsers.ID; filterUsers.Visible = ShowFilterControl; filterUsers.OnFilterChanged += filterUsers_OnFilterChanged; srcUsers.OnFilterChanged += filterUsers_OnFilterChanged; // Basic control properties repUsers.HideControlForZeroRows = HideControlForZeroRows; repUsers.ZeroRowsText = ZeroRowsText; // Data source properties srcUsers.WhereCondition = WhereCondition; srcUsers.OrderBy = OrderBy; srcUsers.TopN = SelectTopN; srcUsers.SelectedColumns = Columns; srcUsers.SiteName = SiteName; srcUsers.FilterName = filterUsers.ID; srcUsers.SourceFilterName = FilterName; srcUsers.CacheItemName = CacheItemName; srcUsers.CacheDependencies = CacheDependencies; srcUsers.CacheMinutes = CacheMinutes; srcUsers.SelectOnlyApproved = SelectOnlyApproved; srcUsers.SelectHidden = SelectHidden; // Init data properties filterUsers.InitDataProperties(srcUsers); #region "Repeater template properties" // Apply transformations if they exist if (!String.IsNullOrEmpty(TransformationName)) { repUsers.ItemTemplate = CMSDataProperties.LoadTransformation(this, TransformationName, false); } if (!String.IsNullOrEmpty(AlternatingItemTransformationName)) { repUsers.AlternatingItemTemplate = CMSDataProperties.LoadTransformation(this, AlternatingItemTransformationName, false); } if (!String.IsNullOrEmpty(FooterTransformationName)) { repUsers.FooterTemplate = CMSDataProperties.LoadTransformation(this, FooterTransformationName, false); } if (!String.IsNullOrEmpty(HeaderTransformationName)) { repUsers.HeaderTemplate = CMSDataProperties.LoadTransformation(this, HeaderTransformationName, false); } if (!String.IsNullOrEmpty(SeparatorTransformationName)) { repUsers.SeparatorTemplate = CMSDataProperties.LoadTransformation(this, SeparatorTransformationName, false); } #endregion // UniPager properties pagerElem.PageSize = PageSize; pagerElem.GroupSize = GroupSize; pagerElem.QueryStringKey = QueryStringKey; pagerElem.DisplayFirstLastAutomatically = DisplayFirstLastAutomatically; pagerElem.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically; pagerElem.HidePagerForSinglePage = HidePagerForSinglePage; pagerElem.Enabled = EnablePaging; switch (PagingMode.ToLowerCSafe()) { case "querystring": pagerElem.PagerMode = UniPagerMode.Querystring; break; default: pagerElem.PagerMode = UniPagerMode.PostBack; break; } #region "UniPager template properties" // UniPager template properties if (!String.IsNullOrEmpty(PagesTemplate)) { pagerElem.PageNumbersTemplate = CMSDataProperties.LoadTransformation(pagerElem, PagesTemplate, false); } if (!String.IsNullOrEmpty(CurrentPageTemplate)) { pagerElem.CurrentPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, CurrentPageTemplate, false); } if (!String.IsNullOrEmpty(SeparatorTemplate)) { pagerElem.PageNumbersSeparatorTemplate = CMSDataProperties.LoadTransformation(pagerElem, SeparatorTemplate, false); } if (!String.IsNullOrEmpty(FirstPageTemplate)) { pagerElem.FirstPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, FirstPageTemplate, false); } if (!String.IsNullOrEmpty(LastPageTemplate)) { pagerElem.LastPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, LastPageTemplate, false); } if (!String.IsNullOrEmpty(PreviousPageTemplate)) { pagerElem.PreviousPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, PreviousPageTemplate, false); } if (!String.IsNullOrEmpty(NextPageTemplate)) { pagerElem.NextPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, NextPageTemplate, false); } if (!String.IsNullOrEmpty(PreviousGroupTemplate)) { pagerElem.PreviousGroupTemplate = CMSDataProperties.LoadTransformation(pagerElem, PreviousGroupTemplate, false); } if (!String.IsNullOrEmpty(NextGroupTemplate)) { pagerElem.NextGroupTemplate = CMSDataProperties.LoadTransformation(pagerElem, NextGroupTemplate, false); } if (!String.IsNullOrEmpty(DirectPageTemplate)) { pagerElem.DirectPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, DirectPageTemplate, false); } if (!String.IsNullOrEmpty(LayoutTemplate)) { pagerElem.LayoutTemplate = CMSDataProperties.LoadTransformation(pagerElem, LayoutTemplate, false); } #endregion // Connects repeater with data source repUsers.DataSource = srcUsers.DataSource; repUsers.DataBind(); } }
/// <summary> /// Initializes the control properties. /// </summary> protected void SetupControl() { if (StopProcessing) { // Do nothing } else { if (!String.IsNullOrEmpty(TransformationName)) { // Basic control properties repMediaLib.HideControlForZeroRows = HideControlForZeroRows; repMediaLib.ZeroRowsText = ZeroRowsText; // Data source properties srcMediaLib.WhereCondition = WhereCondition; srcMediaLib.OrderBy = OrderBy; srcMediaLib.TopN = SelectTopN; srcMediaLib.CacheItemName = CacheItemName; srcMediaLib.CacheDependencies = CacheDependencies; srcMediaLib.CacheMinutes = CacheMinutes; srcMediaLib.SelectedColumns = Columns; srcMediaLib.SiteName = SiteName; srcMediaLib.ShowGroupLibraries = ShowGroupLibraries; #region "Repeater template properties" // Apply transformations if they exist repMediaLib.ItemTemplate = CMSDataProperties.LoadTransformation(this, TransformationName); if (!String.IsNullOrEmpty(AlternatingItemTransformationName)) { repMediaLib.AlternatingItemTemplate = CMSDataProperties.LoadTransformation(this, AlternatingItemTransformationName); } if (!String.IsNullOrEmpty(FooterTransformationName)) { repMediaLib.FooterTemplate = CMSDataProperties.LoadTransformation(this, FooterTransformationName); } if (!String.IsNullOrEmpty(HeaderTransformationName)) { repMediaLib.HeaderTemplate = CMSDataProperties.LoadTransformation(this, HeaderTransformationName); } if (!String.IsNullOrEmpty(SeparatorTransformationName)) { repMediaLib.SeparatorTemplate = CMSDataProperties.LoadTransformation(this, SeparatorTransformationName); } #endregion // UniPager properties pagerElem.PageSize = PageSize; pagerElem.GroupSize = GroupSize; pagerElem.QueryStringKey = QueryStringKey; pagerElem.DisplayFirstLastAutomatically = DisplayFirstLastAutomatically; pagerElem.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically; pagerElem.HidePagerForSinglePage = HidePagerForSinglePage; switch (PagingMode.ToLowerCSafe()) { case "postback": pagerElem.PagerMode = UniPagerMode.PostBack; break; default: pagerElem.PagerMode = UniPagerMode.Querystring; break; } #region "UniPager template properties" // UniPager template properties if (!String.IsNullOrEmpty(PagesTemplate)) { pagerElem.PageNumbersTemplate = CMSDataProperties.LoadTransformation(pagerElem, PagesTemplate); } if (!String.IsNullOrEmpty(CurrentPageTemplate)) { pagerElem.CurrentPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, CurrentPageTemplate); } if (!String.IsNullOrEmpty(SeparatorTemplate)) { pagerElem.PageNumbersSeparatorTemplate = CMSDataProperties.LoadTransformation(pagerElem, SeparatorTemplate); } if (!String.IsNullOrEmpty(FirstPageTemplate)) { pagerElem.FirstPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, FirstPageTemplate); } if (!String.IsNullOrEmpty(LastPageTemplate)) { pagerElem.LastPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, LastPageTemplate); } if (!String.IsNullOrEmpty(PreviousPageTemplate)) { pagerElem.PreviousPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, PreviousPageTemplate); } if (!String.IsNullOrEmpty(NextPageTemplate)) { pagerElem.NextPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, NextPageTemplate); } if (!String.IsNullOrEmpty(PreviousGroupTemplate)) { pagerElem.PreviousGroupTemplate = CMSDataProperties.LoadTransformation(pagerElem, PreviousGroupTemplate); } if (!String.IsNullOrEmpty(NextGroupTemplate)) { pagerElem.NextGroupTemplate = CMSDataProperties.LoadTransformation(pagerElem, NextGroupTemplate); } if (!String.IsNullOrEmpty(DirectPageTemplate)) { pagerElem.DirectPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, DirectPageTemplate); } if (!String.IsNullOrEmpty(LayoutTemplate)) { pagerElem.LayoutTemplate = CMSDataProperties.LoadTransformation(pagerElem, LayoutTemplate); } #endregion // Connects repeater with data source repMediaLib.DataSource = srcMediaLib.DataSource; if (!DataHelper.DataSourceIsEmpty(srcMediaLib.DataSource)) { repMediaLib.DataBind(); } } } }
/// <summary> /// Initializes the control properties. /// </summary> protected void SetupControl() { // Set general properties repUsers.DataBindByDefault = false; pagerElem.PageControl = repUsers.ID; if (StopProcessing) { // Do nothing filterUsers.StopProcessing = true; srcUsers.StopProcessing = true; } else { filterUsers.Visible = ShowFilterControl; filterUsers.OnFilterChanged += filterUsers_OnFilterChanged; srcUsers.OnFilterChanged += filterUsers_OnFilterChanged; // Basic control properties repUsers.HideControlForZeroRows = HideControlForZeroRows; repUsers.ZeroRowsText = ZeroRowsText; TreeNode node = null; TreeProvider tree = new TreeProvider(MembershipContext.AuthenticatedUser); // Check if path is set if (String.IsNullOrEmpty(Path)) { TreeNode curDoc = DocumentContext.CurrentDocument; // Check if current document is department if ((curDoc != null) && (curDoc.NodeClassName.ToLowerCSafe() == DEPARTMENT_CLASS_NAME)) { node = DocumentContext.CurrentDocument; } } else { // Obtain document from specified path node = tree.SelectSingleNode(SiteName, Path, LocalizationContext.PreferredCultureCode, true, DEPARTMENT_CLASS_NAME, false, false, false); } // If department document exists and has own ACL continue with initializing controls if ((node != null) && node.NodeIsACLOwner) { // Get users and roles with read permission for department document int aclId = ValidationHelper.GetInteger(node.GetValue("NodeACLID"), 0); DataSet dsRoles = AclItemInfoProvider.GetAllowedRoles(aclId, NodePermissionsEnum.Read, "RoleID"); DataSet dsUsers = AclItemInfoProvider.GetAllowedUsers(aclId, NodePermissionsEnum.Read, "UserID"); string where = null; // Process users dataset to where condition if (!DataHelper.DataSourceIsEmpty(dsUsers)) { // Get allowed users ids IList <string> users = DataHelper.GetStringValues(dsUsers.Tables[0], "UserID"); string userIds = TextHelper.Join(", ", users); // Populate where condition with user condition where = SqlHelper.AddWhereCondition("UserID IN (" + userIds + ")", where); } // Process roles dataset to where condition if (!DataHelper.DataSourceIsEmpty(dsRoles)) { // Get allowed roles ids IList <string> roles = DataHelper.GetStringValues(dsRoles.Tables[0], "RoleID"); string roleIds = TextHelper.Join(", ", roles); // Populate where condition with role condition where = SqlHelper.AddWhereCondition("UserID IN (SELECT UserID FROM View_CMS_UserRole_MembershipRole_ValidOnly_Joined WHERE RoleID IN (" + roleIds + "))", where, "OR"); } if (!String.IsNullOrEmpty(where)) { // Check if exist where condition and add it to current where condition where = SqlHelper.AddWhereCondition(WhereCondition, where); // Data source properties srcUsers.WhereCondition = where; srcUsers.OrderBy = OrderBy; srcUsers.TopN = SelectTopN; srcUsers.SelectedColumns = Columns; srcUsers.SiteName = SiteName; srcUsers.FilterName = filterUsers.ID; srcUsers.SourceFilterName = FilterName; srcUsers.CacheItemName = CacheItemName; srcUsers.CacheDependencies = CacheDependencies; srcUsers.CacheMinutes = CacheMinutes; srcUsers.SelectOnlyApproved = SelectOnlyApproved; srcUsers.SelectHidden = SelectHidden; // Init data properties filterUsers.InitDataProperties(srcUsers); #region "Repeater template properties" // Apply transformations if they exist if (!String.IsNullOrEmpty(TransformationName)) { repUsers.ItemTemplate = CMSDataProperties.LoadTransformation(this, TransformationName); } if (!String.IsNullOrEmpty(AlternatingItemTransformationName)) { repUsers.AlternatingItemTemplate = CMSDataProperties.LoadTransformation(this, AlternatingItemTransformationName); } if (!String.IsNullOrEmpty(FooterTransformationName)) { repUsers.FooterTemplate = CMSDataProperties.LoadTransformation(this, FooterTransformationName); } if (!String.IsNullOrEmpty(HeaderTransformationName)) { repUsers.HeaderTemplate = CMSDataProperties.LoadTransformation(this, HeaderTransformationName); } if (!String.IsNullOrEmpty(SeparatorTransformationName)) { repUsers.SeparatorTemplate = CMSDataProperties.LoadTransformation(this, SeparatorTransformationName); } #endregion // UniPager properties pagerElem.PageSize = PageSize; pagerElem.GroupSize = GroupSize; pagerElem.QueryStringKey = QueryStringKey; pagerElem.DisplayFirstLastAutomatically = DisplayFirstLastAutomatically; pagerElem.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically; pagerElem.HidePagerForSinglePage = HidePagerForSinglePage; pagerElem.Enabled = EnablePaging; switch (PagingMode.ToLowerCSafe()) { case "querystring": pagerElem.PagerMode = UniPagerMode.Querystring; break; default: pagerElem.PagerMode = UniPagerMode.PostBack; break; } #region "UniPager template properties" // UniPager template properties if (!String.IsNullOrEmpty(PagesTemplate)) { pagerElem.PageNumbersTemplate = CMSDataProperties.LoadTransformation(pagerElem, PagesTemplate); } if (!String.IsNullOrEmpty(CurrentPageTemplate)) { pagerElem.CurrentPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, CurrentPageTemplate); } if (!String.IsNullOrEmpty(SeparatorTemplate)) { pagerElem.PageNumbersSeparatorTemplate = CMSDataProperties.LoadTransformation(pagerElem, SeparatorTemplate); } if (!String.IsNullOrEmpty(FirstPageTemplate)) { pagerElem.FirstPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, FirstPageTemplate); } if (!String.IsNullOrEmpty(LastPageTemplate)) { pagerElem.LastPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, LastPageTemplate); } if (!String.IsNullOrEmpty(PreviousPageTemplate)) { pagerElem.PreviousPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, PreviousPageTemplate); } if (!String.IsNullOrEmpty(NextPageTemplate)) { pagerElem.NextPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, NextPageTemplate); } if (!String.IsNullOrEmpty(PreviousGroupTemplate)) { pagerElem.PreviousGroupTemplate = CMSDataProperties.LoadTransformation(pagerElem, PreviousGroupTemplate); } if (!String.IsNullOrEmpty(NextGroupTemplate)) { pagerElem.NextGroupTemplate = CMSDataProperties.LoadTransformation(pagerElem, NextGroupTemplate); } if (!String.IsNullOrEmpty(DirectPageTemplate)) { pagerElem.DirectPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, DirectPageTemplate); } if (!String.IsNullOrEmpty(LayoutTemplate)) { pagerElem.LayoutTemplate = CMSDataProperties.LoadTransformation(pagerElem, LayoutTemplate); } #endregion // Connects repeater with data source repUsers.DataSource = srcUsers.DataSource; } else { // Disable datasource srcUsers.StopProcessing = true; } } else { // Disable datasource srcUsers.StopProcessing = true; } pagerElem.RebindPager(); repUsers.DataBind(); } }
/// <summary> /// Initializes the control properties. /// </summary> protected void SetupControl() { repLatestPosts.DataBindByDefault = false; pagerElem.PageControl = repLatestPosts.ID; if (StopProcessing) { // Do nothing } else { if (!String.IsNullOrEmpty(TransformationName)) { // Basic control properties repLatestPosts.HideControlForZeroRows = HideControlForZeroRows; repLatestPosts.ZeroRowsText = ZeroRowsText; // Set data source groupID according to group name if (!String.IsNullOrEmpty(GroupName)) { GeneralizedInfo gi = ModuleCommands.CommunityGetGroupInfoByName(GroupName, SiteName); if (gi != null) { forumDataSource.GroupID = ValidationHelper.GetInteger(gi.GetValue("GroupID"), 0); } else { // Do nothing if no group is set forumDataSource.StopProcessing = true; } } if (!forumDataSource.StopProcessing) { // Data source properties forumDataSource.TopN = SelectTopN; forumDataSource.OrderBy = OrderBy; forumDataSource.CacheItemName = CacheItemName; forumDataSource.CacheDependencies = CacheDependencies; forumDataSource.CacheMinutes = CacheMinutes; forumDataSource.SourceFilterName = FilterName; forumDataSource.SelectOnlyApproved = SelectOnlyApproved; forumDataSource.SiteName = SiteName; forumDataSource.SelectedColumns = Columns; forumDataSource.ShowGroupPosts = ShowGroupPosts && String.IsNullOrEmpty(ForumGroups); #region "Repeater template properties" // Apply transformations if they exist repLatestPosts.ItemTemplate = CMSDataProperties.LoadTransformation(this, TransformationName); // Alternating item if (!String.IsNullOrEmpty(AlternatingItemTransformationName)) { repLatestPosts.AlternatingItemTemplate = CMSDataProperties.LoadTransformation(this, AlternatingItemTransformationName); } // Footer if (!String.IsNullOrEmpty(FooterTransformationName)) { repLatestPosts.FooterTemplate = CMSDataProperties.LoadTransformation(this, FooterTransformationName); } // Header if (!String.IsNullOrEmpty(HeaderTransformationName)) { repLatestPosts.HeaderTemplate = CMSDataProperties.LoadTransformation(this, HeaderTransformationName); } // Separator if (!String.IsNullOrEmpty(SeparatorTransformationName)) { repLatestPosts.SeparatorTemplate = CMSDataProperties.LoadTransformation(this, SeparatorTransformationName); } #endregion // UniPager properties pagerElem.PageSize = PageSize; pagerElem.GroupSize = GroupSize; pagerElem.QueryStringKey = QueryStringKey; pagerElem.DisplayFirstLastAutomatically = DisplayFirstLastAutomatically; pagerElem.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically; pagerElem.HidePagerForSinglePage = HidePagerForSinglePage; // Set pager mode switch (PagingMode.ToLowerCSafe()) { case "postback": pagerElem.PagerMode = UniPagerMode.PostBack; break; default: pagerElem.PagerMode = UniPagerMode.Querystring; break; } #region "UniPager template properties" // UniPager template properties if (!String.IsNullOrEmpty(PagesTemplate)) { pagerElem.PageNumbersTemplate = CMSDataProperties.LoadTransformation(pagerElem, PagesTemplate); } // Current page if (!String.IsNullOrEmpty(CurrentPageTemplate)) { pagerElem.CurrentPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, CurrentPageTemplate); } // Separator if (!String.IsNullOrEmpty(SeparatorTemplate)) { pagerElem.PageNumbersSeparatorTemplate = CMSDataProperties.LoadTransformation(pagerElem, SeparatorTemplate); } // First page if (!String.IsNullOrEmpty(FirstPageTemplate)) { pagerElem.FirstPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, FirstPageTemplate); } // Last page if (!String.IsNullOrEmpty(LastPageTemplate)) { pagerElem.LastPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, LastPageTemplate); } // Previous page if (!String.IsNullOrEmpty(PreviousPageTemplate)) { pagerElem.PreviousPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, PreviousPageTemplate); } // Next page if (!String.IsNullOrEmpty(NextPageTemplate)) { pagerElem.NextPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, NextPageTemplate); } // Previous group if (!String.IsNullOrEmpty(PreviousGroupTemplate)) { pagerElem.PreviousGroupTemplate = CMSDataProperties.LoadTransformation(pagerElem, PreviousGroupTemplate); } // Next group if (!String.IsNullOrEmpty(NextGroupTemplate)) { pagerElem.NextGroupTemplate = CMSDataProperties.LoadTransformation(pagerElem, NextGroupTemplate); } // Direct page if (!String.IsNullOrEmpty(DirectPageTemplate)) { pagerElem.DirectPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, DirectPageTemplate); } // Layout if (!String.IsNullOrEmpty(LayoutTemplate)) { pagerElem.LayoutTemplate = CMSDataProperties.LoadTransformation(pagerElem, LayoutTemplate); } #endregion #region "Complete where condition" string where = ""; string[] groups = ForumGroups.Split(';'); // Create where condition for all forum groups foreach (string group in groups) { if (group != "") { if (where != "") { where += "OR"; } where += "(GroupName = N'" + SqlHelper.GetSafeQueryString(group, false) + "')"; } } // Add custom where condition if (!string.IsNullOrEmpty(WhereCondition)) { if (string.IsNullOrEmpty(where)) { where = WhereCondition; } else { where = "(" + WhereCondition + ") AND (" + where + ")"; } } #endregion // Set forum data source forumDataSource.WhereCondition = where; forumDataSource.CheckPermissions = true; repLatestPosts.DataSourceControl = forumDataSource; } } pagerElem.RebindPager(); repLatestPosts.DataBind(); } }
/// <summary> /// Initializes control properties. /// </summary> protected void SetupControl() { if (StopProcessing) { // Do nothing ucAttachments.StopProcessing = true; } else { ucAttachments.GetBinary = false; // Basic control properties ucAttachments.HideControlForZeroRows = HideControlForZeroRows; ucAttachments.ZeroRowsText = ZeroRowsText; // Data source properties ucAttachments.WhereCondition = WhereCondition; ucAttachments.OrderBy = OrderBy; ucAttachments.FilterName = FilterName; ucAttachments.CacheItemName = CacheItemName; ucAttachments.CacheDependencies = CacheDependencies; ucAttachments.CacheMinutes = CacheMinutes; ucAttachments.AttachmentGroupGUID = AttachmentGroupGUID; ucAttachments.CheckPermissions = CheckPermissions; ucAttachments.CombineWithDefaultCulture = CombineWithDefaultCulture; if (string.IsNullOrEmpty(CultureCode)) { ucAttachments.CultureCode = DocumentContext.CurrentDocumentCulture.CultureCode; } else { ucAttachments.CultureCode = CultureCode; } ucAttachments.Path = TreePathUtils.EnsureSingleNodePath(MacroResolver.ResolveCurrentPath(Path)); ucAttachments.SiteName = SiteName; ucAttachments.TopN = TopN; #region "Repeater template properties" // Apply transformations if they exist ucAttachments.TransformationName = TransformationName; ucAttachments.AlternatingItemTransformationName = AlternatingItemTransformationName; ucAttachments.FooterTransformationName = FooterTransformationName; ucAttachments.HeaderTransformationName = HeaderTransformationName; ucAttachments.SeparatorTransformationName = SeparatorTransformationName; #endregion // UniPager properties ucAttachments.PageSize = PageSize; ucAttachments.GroupSize = GroupSize; ucAttachments.QueryStringKey = QueryStringKey; ucAttachments.DisplayFirstLastAutomatically = DisplayFirstLastAutomatically; ucAttachments.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically; ucAttachments.HidePagerForSinglePage = HidePagerForSinglePage; switch (PagingMode.ToLowerCSafe()) { case "postback": ucAttachments.PagingMode = UniPagerMode.PostBack; break; default: ucAttachments.PagingMode = UniPagerMode.Querystring; break; } #region "UniPager template properties" // UniPager template properties ucAttachments.PagesTemplate = PagesTemplate; ucAttachments.CurrentPageTemplate = CurrentPageTemplate; ucAttachments.SeparatorTemplate = SeparatorTemplate; ucAttachments.FirstPageTemplate = FirstPageTemplate; ucAttachments.LastPageTemplate = LastPageTemplate; ucAttachments.PreviousPageTemplate = PreviousPageTemplate; ucAttachments.NextPageTemplate = NextPageTemplate; ucAttachments.PreviousGroupTemplate = PreviousGroupTemplate; ucAttachments.NextGroupTemplate = NextGroupTemplate; ucAttachments.LayoutTemplate = LayoutTemplate; #endregion } }
/// <summary> /// Initializes the control properties. /// </summary> protected void SetupControl() { repLatestPosts.DataBindByDefault = false; pagerElem.PageControl = repLatestPosts.ID; if (StopProcessing) { // Do nothing } else { SetContext(); if (!String.IsNullOrEmpty(TransformationName)) { // Basic control properties repLatestPosts.HideControlForZeroRows = HideControlForZeroRows; repLatestPosts.ZeroRowsText = ZeroRowsText; // Check if Group name is set GroupInfo gi = null; if ((CommunityContext.CurrentGroup != null) && (GroupName.ToLowerCSafe() == CommunityContext.CurrentGroup.GroupName.ToLowerCSafe())) { gi = CommunityContext.CurrentGroup; } else { gi = GroupInfoProvider.GetGroupInfo(GroupName, SiteContext.CurrentSiteName); } if (gi != null) { // Data source properties forumDataSource.TopN = SelectTopN; forumDataSource.OrderBy = OrderBy; forumDataSource.CacheItemName = CacheItemName; forumDataSource.CacheDependencies = CacheDependencies; forumDataSource.CacheMinutes = CacheMinutes; forumDataSource.SelectedColumns = Columns; forumDataSource.FilterName = FilterName; #region "Repeater template properties" // Apply transformations if they exist repLatestPosts.ItemTemplate = TransformationHelper.LoadTransformation(this, TransformationName); // Alternating item transformation if (!String.IsNullOrEmpty(AlternatingItemTransformationName)) { repLatestPosts.AlternatingItemTemplate = TransformationHelper.LoadTransformation(this, AlternatingItemTransformationName); } // Footer transformation if (!String.IsNullOrEmpty(FooterTransformationName)) { repLatestPosts.FooterTemplate = TransformationHelper.LoadTransformation(this, FooterTransformationName); } // Header transformation if (!String.IsNullOrEmpty(HeaderTransformationName)) { repLatestPosts.HeaderTemplate = TransformationHelper.LoadTransformation(this, HeaderTransformationName); } // Separator transformation if (!String.IsNullOrEmpty(SeparatorTransformationName)) { repLatestPosts.SeparatorTemplate = TransformationHelper.LoadTransformation(this, SeparatorTransformationName); } #endregion // UniPager properties pagerElem.PageSize = PageSize; pagerElem.GroupSize = GroupSize; pagerElem.QueryStringKey = QueryStringKey; pagerElem.DisplayFirstLastAutomatically = DisplayFirstLastAutomatically; pagerElem.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically; pagerElem.HidePagerForSinglePage = HidePagerForSinglePage; // Set paging mode switch (PagingMode.ToLowerCSafe()) { case "postback": pagerElem.PagerMode = UniPagerMode.PostBack; break; default: pagerElem.PagerMode = UniPagerMode.Querystring; break; } #region "UniPager template properties" // UniPager template properties if (!String.IsNullOrEmpty(PagesTemplate)) { pagerElem.PageNumbersTemplate = TransformationHelper.LoadTransformation(pagerElem, PagesTemplate); } // Current page if (!String.IsNullOrEmpty(CurrentPageTemplate)) { pagerElem.CurrentPageTemplate = TransformationHelper.LoadTransformation(pagerElem, CurrentPageTemplate); } // Separator if (!String.IsNullOrEmpty(SeparatorTemplate)) { pagerElem.PageNumbersSeparatorTemplate = TransformationHelper.LoadTransformation(pagerElem, SeparatorTemplate); } // First page if (!String.IsNullOrEmpty(FirstPageTemplate)) { pagerElem.FirstPageTemplate = TransformationHelper.LoadTransformation(pagerElem, FirstPageTemplate); } // Last page if (!String.IsNullOrEmpty(LastPageTemplate)) { pagerElem.LastPageTemplate = TransformationHelper.LoadTransformation(pagerElem, LastPageTemplate); } // Previous page if (!String.IsNullOrEmpty(PreviousPageTemplate)) { pagerElem.PreviousPageTemplate = TransformationHelper.LoadTransformation(pagerElem, PreviousPageTemplate); } // Next page if (!String.IsNullOrEmpty(NextPageTemplate)) { pagerElem.NextPageTemplate = TransformationHelper.LoadTransformation(pagerElem, NextPageTemplate); } // Previous group if (!String.IsNullOrEmpty(PreviousGroupTemplate)) { pagerElem.PreviousGroupTemplate = TransformationHelper.LoadTransformation(pagerElem, PreviousGroupTemplate); } // Next group if (!String.IsNullOrEmpty(NextGroupTemplate)) { pagerElem.NextGroupTemplate = TransformationHelper.LoadTransformation(pagerElem, NextGroupTemplate); } // Direct page if (!String.IsNullOrEmpty(DirectPageTemplate)) { pagerElem.DirectPageTemplate = TransformationHelper.LoadTransformation(pagerElem, DirectPageTemplate); } // Layout if (!String.IsNullOrEmpty(LayoutTemplate)) { pagerElem.LayoutTemplate = TransformationHelper.LoadTransformation(pagerElem, LayoutTemplate); } #endregion // Data source settings forumDataSource.WhereCondition = WhereCondition; forumDataSource.GroupID = gi.GroupID; forumDataSource.CheckPermissions = true; forumDataSource.SiteName = SiteName; repLatestPosts.DataSource = forumDataSource.DataSource; } else { // Do nothing forumDataSource.StopProcessing = true; } } pagerElem.RebindPager(); repLatestPosts.DataBind(); ReleaseContext(); } }
/// <summary> /// Initializes control properties. /// </summary> protected void SetupControl() { if (StopProcessing) { // Do nothing ucDataSource.StopProcessing = true; } else { ucRepeater.DataBindByDefault = false; ucPager.PageControl = ucRepeater.ID; ucDataSource.GetBinary = false; // Basic control properties ucRepeater.HideControlForZeroRows = HideControlForZeroRows; ucRepeater.ZeroRowsText = ZeroRowsText; // Data source properties ucDataSource.WhereCondition = WhereCondition; ucDataSource.OrderBy = OrderBy; ucDataSource.FilterName = FilterName; ucDataSource.CacheItemName = CacheItemName; ucDataSource.CacheDependencies = CacheDependencies; ucDataSource.CacheMinutes = CacheMinutes; ucDataSource.AttachmentGroupGUID = AttachmentGroupGUID; ucDataSource.CheckPermissions = CheckPermissions; ucDataSource.CombineWithDefaultCulture = CombineWithDefaultCulture; if (string.IsNullOrEmpty(CultureCode)) { ucDataSource.CultureCode = DocumentContext.CurrentDocumentCulture.CultureCode; } else { ucDataSource.CultureCode = CultureCode; } ucDataSource.Path = TreePathUtils.EnsureSingleNodePath(MacroResolver.ResolveCurrentPath(Path)); ucDataSource.SiteName = SiteName; ucDataSource.TopN = TopN; // UniPager properties ucPager.PageSize = PageSize; ucPager.GroupSize = GroupSize; ucPager.QueryStringKey = QueryStringKey; ucPager.DisplayFirstLastAutomatically = DisplayFirstLastAutomatically; ucPager.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically; ucPager.HidePagerForSinglePage = HidePagerForSinglePage; switch (PagingMode.ToLowerCSafe()) { case "postback": ucPager.PagerMode = UniPagerMode.PostBack; break; default: ucPager.PagerMode = UniPagerMode.Querystring; break; } // Effect properties ucRepeater.ItemHTMLBefore = ItemHTMLBefore; ucRepeater.ItemHTMLAfter = ItemHTMLAfter; ucRepeater.ItemHTMLSeparator = ItemHTMLSeparator; ucRepeater.HideLayoutForZeroRows = HideLayoutForZeroRows; ucRepeater.ScriptFiles = ScriptFiles; ucRepeater.InitScript = InitScript; ucRepeater.CSSFiles = CSSFiles; ucRepeater.InlineCSS = InlineCSS; // Setup repeater and pager templates SetupTemplates(); } }
/// <summary> /// Initializes the control properties. /// </summary> protected void SetupControl() { // Set stop processing to inner controls trough property setter StopProcessing = StopProcessing; if (StopProcessing) { // Do nothing } else { BasicDataList.DataBindByDefault = false; pagerElem.PageControl = BasicDataList.ID; if (!String.IsNullOrEmpty(TransformationName)) { // Set SharePoint data source properties SPDataSource.Username = Username; SPDataSource.Password = EncryptionHelper.DecryptData(Password); SPDataSource.ListName = ListName; SPDataSource.SPServiceURL = SPServiceURL; SPDataSource.ShowReturnedCAML = ShowReturnedCAML; SPDataSource.RowLimit = RowLimit; SPDataSource.Query = Query; SPDataSource.ViewFields = ViewFields; SPDataSource.UseClassicDataset = UseClassicDataset; SPDataSource.Fields = Fields; SPDataSource.Mode = Mode; SPDataSource.ItemIDField = ItemIDField; SPDataSource.SelectedItemFieldName = SelectedItemFieldName; SPDataSource.ItemIDFieldType = ItemIDFieldType; SPDataSource.CacheItemName = CacheItemName; SPDataSource.CacheDependencies = CacheDependencies; SPDataSource.CacheMinutes = CacheMinutes; // Classic dataset OR XSLT transformation if (UseClassicDataset) { // Basic DataList properties BasicDataList.RepeatColumns = RepeatColumns; BasicDataList.RepeatLayout = RepeatLayout; BasicDataList.RepeatDirection = RepeatDirection; BasicDataList.HideControlForZeroRows = HideControlForZeroRows; BasicDataList.ZeroRowsText = ZeroRowsText; // UniPager properties pagerElem.PageSize = PageSize; pagerElem.GroupSize = GroupSize; pagerElem.QueryStringKey = QueryStringKey; pagerElem.DisplayFirstLastAutomatically = DisplayFirstLastAutomatically; pagerElem.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically; pagerElem.HidePagerForSinglePage = HidePagerForSinglePage; // Set pager mode switch (PagingMode.ToLowerCSafe()) { case "postback": pagerElem.PagerMode = UniPagerMode.PostBack; break; default: pagerElem.PagerMode = UniPagerMode.Querystring; break; } #region "UniPager template properties" // UniPager template properties if (!string.IsNullOrEmpty(PagesTemplate)) { pagerElem.PageNumbersTemplate = CMSDataProperties.LoadTransformation(pagerElem, PagesTemplate, false); } // Current page if (!string.IsNullOrEmpty(CurrentPageTemplate)) { pagerElem.CurrentPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, CurrentPageTemplate, false); } // Separator if (!string.IsNullOrEmpty(SeparatorTemplate)) { pagerElem.PageNumbersSeparatorTemplate = CMSDataProperties.LoadTransformation(pagerElem, SeparatorTemplate, false); } // First page if (!string.IsNullOrEmpty(FirstPageTemplate)) { pagerElem.FirstPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, FirstPageTemplate, false); } // Last page if (!string.IsNullOrEmpty(LastPageTemplate)) { pagerElem.LastPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, LastPageTemplate, false); } // Previous page if (!string.IsNullOrEmpty(PreviousPageTemplate)) { pagerElem.PreviousPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, PreviousPageTemplate, false); } // Next page if (!string.IsNullOrEmpty(NextPageTemplate)) { pagerElem.NextPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, NextPageTemplate, false); } // Previous group if (!string.IsNullOrEmpty(PreviousGroupTemplate)) { pagerElem.PreviousGroupTemplate = CMSDataProperties.LoadTransformation(pagerElem, PreviousGroupTemplate, false); } // Next group if (!string.IsNullOrEmpty(NextGroupTemplate)) { pagerElem.NextGroupTemplate = CMSDataProperties.LoadTransformation(pagerElem, NextGroupTemplate, false); } // Direct page if (!String.IsNullOrEmpty(DirectPageTemplate)) { pagerElem.DirectPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, DirectPageTemplate, false); } // Layout if (!string.IsNullOrEmpty(LayoutTemplate)) { pagerElem.LayoutTemplate = CMSDataProperties.LoadTransformation(pagerElem, LayoutTemplate, false); } #endregion } else { plcDataset.Visible = false; plcXSLT.Visible = true; } // Load and bind data BindData(); } } }
/// <summary> /// Initializes the control properties. /// </summary> protected void SetupControl() { if (StopProcessing) { // Do nothing } else { if (!String.IsNullOrEmpty(TransformationName)) { // Basic control properties repMessages.HideControlForZeroRows = HideControlForZeroRows; repMessages.ZeroRowsText = HTMLHelper.HTMLEncode(ZeroRowsText); // Data source properties boardDataSource.ShowGroupMessages = true; boardDataSource.TopN = SelectTopN; boardDataSource.OrderBy = OrderBy; boardDataSource.CacheItemName = CacheItemName; boardDataSource.CacheDependencies = CacheDependencies; boardDataSource.CacheMinutes = CacheMinutes; boardDataSource.SourceFilterName = FilterName; boardDataSource.SelectOnlyApproved = DisplayOnlyApproved; boardDataSource.SiteName = SiteContext.CurrentSiteName; boardDataSource.SelectedColumns = Columns; #region "Repeater template properties" // Apply transformations if they exist repMessages.ItemTemplate = CMSDataProperties.LoadTransformation(this, TransformationName); if (!String.IsNullOrEmpty(AlternatingItemTransformationName)) { repMessages.AlternatingItemTemplate = CMSDataProperties.LoadTransformation(this, AlternatingItemTransformationName); } if (!String.IsNullOrEmpty(FooterTransformationName)) { repMessages.FooterTemplate = CMSDataProperties.LoadTransformation(this, FooterTransformationName); } if (!String.IsNullOrEmpty(HeaderTransformationName)) { repMessages.HeaderTemplate = CMSDataProperties.LoadTransformation(this, HeaderTransformationName); } if (!String.IsNullOrEmpty(SeparatorTransformationName)) { repMessages.SeparatorTemplate = CMSDataProperties.LoadTransformation(this, SeparatorTransformationName); } #endregion // UniPager properties pagerElem.PageSize = PageSize; pagerElem.GroupSize = GroupSize; pagerElem.QueryStringKey = QueryStringKey; pagerElem.DisplayFirstLastAutomatically = DisplayFirstLastAutomatically; pagerElem.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically; pagerElem.HidePagerForSinglePage = HidePagerForSinglePage; switch (PagingMode.ToLowerCSafe()) { case "postback": pagerElem.PagerMode = UniPagerMode.PostBack; break; default: pagerElem.PagerMode = UniPagerMode.Querystring; break; } #region "UniPager template properties" // UniPager template properties if (!String.IsNullOrEmpty(PagesTemplate)) { pagerElem.PageNumbersTemplate = CMSDataProperties.LoadTransformation(pagerElem, PagesTemplate); } if (!String.IsNullOrEmpty(CurrentPageTemplate)) { pagerElem.CurrentPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, CurrentPageTemplate); } if (!String.IsNullOrEmpty(SeparatorTemplate)) { pagerElem.PageNumbersSeparatorTemplate = CMSDataProperties.LoadTransformation(pagerElem, SeparatorTemplate); } if (!String.IsNullOrEmpty(FirstPageTemplate)) { pagerElem.FirstPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, FirstPageTemplate); } if (!String.IsNullOrEmpty(LastPageTemplate)) { pagerElem.LastPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, LastPageTemplate); } if (!String.IsNullOrEmpty(PreviousPageTemplate)) { pagerElem.PreviousPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, PreviousPageTemplate); } if (!String.IsNullOrEmpty(NextPageTemplate)) { pagerElem.NextPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, NextPageTemplate); } if (!String.IsNullOrEmpty(PreviousGroupTemplate)) { pagerElem.PreviousGroupTemplate = CMSDataProperties.LoadTransformation(pagerElem, PreviousGroupTemplate); } if (!String.IsNullOrEmpty(NextGroupTemplate)) { pagerElem.NextGroupTemplate = CMSDataProperties.LoadTransformation(pagerElem, NextGroupTemplate); } if (!String.IsNullOrEmpty(DirectPageTemplate)) { pagerElem.DirectPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, DirectPageTemplate); } if (!String.IsNullOrEmpty(LayoutTemplate)) { pagerElem.LayoutTemplate = CMSDataProperties.LoadTransformation(pagerElem, LayoutTemplate); } #endregion string where = "(GroupName = N'" + SqlHelper.GetSafeQueryString(GroupName, false) + "')"; if (!string.IsNullOrEmpty(WhereCondition)) { where = "(" + WhereCondition + ") AND (" + where + ")"; } boardDataSource.WhereCondition = where; repMessages.DataSourceControl = boardDataSource; repMessages.DataBind(); } } }
/// <summary> /// Initializes the control properties. /// </summary> protected void SetupControl() { repFriends.DataBindByDefault = false; pagerElem.PageControl = repFriends.ID; if (StopProcessing || (CurrentUser == null)) { // Do nothing srcFriends.StopProcessing = true; } else { if (!String.IsNullOrEmpty(TransformationName)) { // Basic control properties repFriends.HideControlForZeroRows = HideControlForZeroRows; repFriends.ZeroRowsText = ZeroRowsText; // Data source properties srcFriends.WhereCondition = WhereCondition; srcFriends.OrderBy = OrderBy; srcFriends.UserID = CurrentUser.UserID; srcFriends.SourceFilterName = FilterName; srcFriends.CacheItemName = CacheItemName; srcFriends.CacheDependencies = CacheDependencies; srcFriends.CacheMinutes = CacheMinutes; srcFriends.FriendStatus = FriendStatus; srcFriends.SelectedColumns = Columns; #region "Repeater template properties" // Apply transformations if they exist repFriends.ItemTemplate = CMSDataProperties.LoadTransformation(this, TransformationName); if (!string.IsNullOrEmpty(AlternatingItemTransformationName)) { repFriends.AlternatingItemTemplate = CMSDataProperties.LoadTransformation(this, AlternatingItemTransformationName); } if (!string.IsNullOrEmpty(FooterTransformationName)) { repFriends.FooterTemplate = CMSDataProperties.LoadTransformation(this, FooterTransformationName); } if (!string.IsNullOrEmpty(HeaderTransformationName)) { repFriends.HeaderTemplate = CMSDataProperties.LoadTransformation(this, HeaderTransformationName); } if (!string.IsNullOrEmpty(SeparatorTransformationName)) { repFriends.SeparatorTemplate = CMSDataProperties.LoadTransformation(this, SeparatorTransformationName); } #endregion // UniPager properties pagerElem.PageSize = PageSize; pagerElem.GroupSize = GroupSize; pagerElem.QueryStringKey = QueryStringKey; pagerElem.DisplayFirstLastAutomatically = DisplayFirstLastAutomatically; pagerElem.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically; pagerElem.HidePagerForSinglePage = HidePagerForSinglePage; switch (PagingMode.ToLowerCSafe()) { case "postback": pagerElem.PagerMode = UniPagerMode.PostBack; break; default: pagerElem.PagerMode = UniPagerMode.Querystring; break; } #region "UniPager template properties" // UniPager template properties if (!string.IsNullOrEmpty(PagesTemplate)) { pagerElem.PageNumbersTemplate = CMSDataProperties.LoadTransformation(pagerElem, PagesTemplate); } if (!string.IsNullOrEmpty(CurrentPageTemplate)) { pagerElem.CurrentPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, CurrentPageTemplate); } if (!string.IsNullOrEmpty(SeparatorTemplate)) { pagerElem.PageNumbersSeparatorTemplate = CMSDataProperties.LoadTransformation(pagerElem, SeparatorTemplate); } if (!string.IsNullOrEmpty(FirstPageTemplate)) { pagerElem.FirstPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, FirstPageTemplate); } if (!string.IsNullOrEmpty(LastPageTemplate)) { pagerElem.LastPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, LastPageTemplate); } if (!string.IsNullOrEmpty(PreviousPageTemplate)) { pagerElem.PreviousPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, PreviousPageTemplate); } if (!string.IsNullOrEmpty(NextPageTemplate)) { pagerElem.NextPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, NextPageTemplate); } if (!string.IsNullOrEmpty(PreviousGroupTemplate)) { pagerElem.PreviousGroupTemplate = CMSDataProperties.LoadTransformation(pagerElem, PreviousGroupTemplate); } if (!string.IsNullOrEmpty(NextGroupTemplate)) { pagerElem.NextGroupTemplate = CMSDataProperties.LoadTransformation(pagerElem, NextGroupTemplate); } if (!String.IsNullOrEmpty(DirectPageTemplate)) { pagerElem.DirectPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, DirectPageTemplate); } if (!string.IsNullOrEmpty(LayoutTemplate)) { pagerElem.LayoutTemplate = CMSDataProperties.LoadTransformation(pagerElem, LayoutTemplate); } #endregion // Connects repeater with data source repFriends.DataSource = srcFriends.DataSource; } pagerElem.RebindPager(); repFriends.DataBind(); } }
/// <summary> /// Initializes the control properties. /// </summary> protected void SetupControl() { if (StopProcessing) { blogDataSource.StopProcessing = true; } else { if (!String.IsNullOrEmpty(TransformationName)) { // Basic control properties repComments.HideControlForZeroRows = HideControlForZeroRows; repComments.ZeroRowsText = ZeroRowsText; // Data source properties blogDataSource.TopN = SelectTopN; blogDataSource.OrderBy = OrderBy; blogDataSource.CacheItemName = CacheItemName; blogDataSource.CacheDependencies = CacheDependencies; blogDataSource.CacheMinutes = CacheMinutes; blogDataSource.FilterName = ValidationHelper.GetString(GetValue("WebPartControlID"), ClientID); blogDataSource.SourceFilterName = FilterName; blogDataSource.SiteName = SiteName; blogDataSource.WhereCondition = WhereCondition; blogDataSource.SelectOnlyApproved = SelectOnlyApproved; blogDataSource.SelectedColumns = Columns; #region "Repeater template properties" // Apply transformations if they exist repComments.ItemTemplate = CMSDataProperties.LoadTransformation(this, TransformationName, false); if (!String.IsNullOrEmpty(AlternatingItemTransformationName)) { repComments.AlternatingItemTemplate = CMSDataProperties.LoadTransformation(this, AlternatingItemTransformationName, false); } if (!String.IsNullOrEmpty(FooterTransformationName)) { repComments.FooterTemplate = CMSDataProperties.LoadTransformation(this, FooterTransformationName, false); } if (!String.IsNullOrEmpty(HeaderTransformationName)) { repComments.HeaderTemplate = CMSDataProperties.LoadTransformation(this, HeaderTransformationName, false); } if (!String.IsNullOrEmpty(SeparatorTransformationName)) { repComments.SeparatorTemplate = CMSDataProperties.LoadTransformation(this, SeparatorTransformationName, false); } #endregion // UniPager properties pagerElem.PageSize = PageSize; pagerElem.GroupSize = GroupSize; pagerElem.QueryStringKey = QueryStringKey; pagerElem.DisplayFirstLastAutomatically = DisplayFirstLastAutomatically; pagerElem.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically; pagerElem.HidePagerForSinglePage = HidePagerForSinglePage; switch (PagingMode.ToLowerCSafe()) { case "postback": pagerElem.PagerMode = UniPagerMode.PostBack; break; default: pagerElem.PagerMode = UniPagerMode.Querystring; break; } #region "UniPager template properties" // UniPager template properties if (!String.IsNullOrEmpty(PagesTemplate)) { pagerElem.PageNumbersTemplate = CMSDataProperties.LoadTransformation(pagerElem, PagesTemplate, false); } if (!String.IsNullOrEmpty(CurrentPageTemplate)) { pagerElem.CurrentPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, CurrentPageTemplate, false); } if (!String.IsNullOrEmpty(SeparatorTemplate)) { pagerElem.PageNumbersSeparatorTemplate = CMSDataProperties.LoadTransformation(pagerElem, SeparatorTemplate, false); } if (!String.IsNullOrEmpty(FirstPageTemplate)) { pagerElem.FirstPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, FirstPageTemplate, false); } if (!String.IsNullOrEmpty(LastPageTemplate)) { pagerElem.LastPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, LastPageTemplate, false); } if (!String.IsNullOrEmpty(PreviousPageTemplate)) { pagerElem.PreviousPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, PreviousPageTemplate, false); } if (!String.IsNullOrEmpty(NextPageTemplate)) { pagerElem.NextPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, NextPageTemplate, false); } if (!String.IsNullOrEmpty(PreviousGroupTemplate)) { pagerElem.PreviousGroupTemplate = CMSDataProperties.LoadTransformation(pagerElem, PreviousGroupTemplate, false); } if (!String.IsNullOrEmpty(NextGroupTemplate)) { pagerElem.NextGroupTemplate = CMSDataProperties.LoadTransformation(pagerElem, NextGroupTemplate, false); } if (!String.IsNullOrEmpty(DirectPageTemplate)) { pagerElem.DirectPageTemplate = CMSDataProperties.LoadTransformation(pagerElem, DirectPageTemplate, false); } if (!String.IsNullOrEmpty(LayoutTemplate)) { pagerElem.LayoutTemplate = CMSDataProperties.LoadTransformation(pagerElem, LayoutTemplate, false); } #endregion // Connects repeater with data source repComments.DataSource = blogDataSource.DataSource; if (!DataHelper.DataSourceIsEmpty(repComments.DataSource)) { repComments.DataBind(); } } } }
/// <summary> /// Initializes the control properties. /// </summary> public void SetupControl() { if (StopProcessing) { // Do nothing } else { // If target control is not specified do nothing if (!String.IsNullOrEmpty(TargetControlName)) { #region "Pager properties" // Set pager properties pagerElem.FilterTypePageControl = TargetControlName; pagerElem.PageSize = PageSize; pagerElem.GroupSize = GroupSize; pagerElem.QueryStringKey = QueryStringKey; pagerElem.DisplayFirstLastAutomatically = DisplayFirstLastAutomatically; pagerElem.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically; pagerElem.HidePagerForSinglePage = HidePagerForSinglePage; pagerElem.ResetScrollPositionOnPostBack = ResetScrollPositionOnPostBack; // Set pager mode switch (PagingMode.ToLowerCSafe()) { case "postback": pagerElem.PagerMode = UniPagerMode.PostBack; break; default: pagerElem.PagerMode = UniPagerMode.Querystring; break; } #endregion #region "Pager templates" // Pages if (!String.IsNullOrEmpty(PagesTemplate)) { pagerElem.PageNumbersTemplate = TransformationHelper.LoadTransformation(pagerElem, PagesTemplate); } // Current page if (!String.IsNullOrEmpty(CurrentPageTemplate)) { pagerElem.CurrentPageTemplate = TransformationHelper.LoadTransformation(pagerElem, CurrentPageTemplate); } // Separator if (!String.IsNullOrEmpty(SeparatorTemplate)) { pagerElem.PageNumbersSeparatorTemplate = TransformationHelper.LoadTransformation(pagerElem, SeparatorTemplate); } // First page if (!String.IsNullOrEmpty(FirstPageTemplate)) { pagerElem.FirstPageTemplate = TransformationHelper.LoadTransformation(pagerElem, FirstPageTemplate); } // Last page if (!String.IsNullOrEmpty(LastPageTemplate)) { pagerElem.LastPageTemplate = TransformationHelper.LoadTransformation(pagerElem, LastPageTemplate); } // Previous page if (!String.IsNullOrEmpty(PreviousPageTemplate)) { pagerElem.PreviousPageTemplate = TransformationHelper.LoadTransformation(pagerElem, PreviousPageTemplate); } // Next page if (!String.IsNullOrEmpty(NextPageTemplate)) { pagerElem.NextPageTemplate = TransformationHelper.LoadTransformation(pagerElem, NextPageTemplate); } // Previous group if (!String.IsNullOrEmpty(PreviousGroupTemplate)) { pagerElem.PreviousGroupTemplate = TransformationHelper.LoadTransformation(pagerElem, PreviousGroupTemplate); } // Next group if (!String.IsNullOrEmpty(NextGroupTemplate)) { pagerElem.NextGroupTemplate = TransformationHelper.LoadTransformation(pagerElem, NextGroupTemplate); } // Direct page if (!String.IsNullOrEmpty(DirectPageTemplate)) { pagerElem.DirectPageTemplate = TransformationHelper.LoadTransformation(pagerElem, DirectPageTemplate); } // Layout if (!String.IsNullOrEmpty(LayoutTemplate)) { pagerElem.LayoutTemplate = TransformationHelper.LoadTransformation(pagerElem, LayoutTemplate); } #endregion } } }
/// <summary> /// Initializes the control properties. /// </summary> protected void SetupControl() { if (StopProcessing) { galleryElem.StopProcessing = true; } else { galleryElem.ControlContext = ControlContext; // Basic control properties galleryElem.HideControlForZeroRows = HideControlForZeroRows; galleryElem.ZeroRowsText = ZeroRowsText; // Data source properties galleryElem.CombineWithDefaultCulture = CombineWithDefaultCulture; galleryElem.CultureCode = CultureCode; galleryElem.OrderBy = OrderBy; galleryElem.TopN = TopN; if (string.IsNullOrEmpty(Path)) { Path = DocumentContext.CurrentAliasPath; } Path = TreePathUtils.EnsureSingleNodePath(Path); galleryElem.Path = Path; galleryElem.SiteName = SiteName; galleryElem.WhereCondition = WhereCondition; galleryElem.AttachmentGroupGUID = AttachmentGroupGUID; galleryElem.FilterName = FilterName; // System properties galleryElem.CacheItemName = CacheItemName; galleryElem.CacheDependencies = CacheDependencies; galleryElem.CacheMinutes = CacheMinutes; galleryElem.CheckPermissions = CheckPermissions; if (ParentZone != null) { galleryElem.CheckCollision = ParentZone.RequiresWebPartManagement(); } else { galleryElem.CheckCollision = PortalContext.IsDesignMode(PortalContext.ViewMode); } // UniPager properties galleryElem.PageSize = PageSize; galleryElem.GroupSize = GroupSize; galleryElem.QueryStringKey = QueryStringKey; galleryElem.DisplayFirstLastAutomatically = DisplayFirstLastAutomatically; galleryElem.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically; galleryElem.HidePagerForSinglePage = HidePagerForSinglePage; switch (PagingMode.ToLowerCSafe()) { case "postback": galleryElem.PagingMode = UniPagerMode.PostBack; break; default: galleryElem.PagingMode = UniPagerMode.Querystring; break; } #region "UniPager template properties" // UniPager template properties galleryElem.PagesTemplate = PagesTemplate; galleryElem.CurrentPageTemplate = CurrentPageTemplate; galleryElem.SeparatorTemplate = SeparatorTemplate; galleryElem.FirstPageTemplate = FirstPageTemplate; galleryElem.LastPageTemplate = LastPageTemplate; galleryElem.PreviousPageTemplate = PreviousPageTemplate; galleryElem.NextPageTemplate = NextPageTemplate; galleryElem.PreviousGroupTemplate = PreviousGroupTemplate; galleryElem.NextGroupTemplate = NextGroupTemplate; galleryElem.LayoutTemplate = LayoutTemplate; #endregion #region "Lightbox properties" galleryElem.LightBoxLoadDelay = LightBoxLoadDelay; galleryElem.LightBoxPermanentNavigation = LightBoxPermanentNavigation; galleryElem.LightBoxNextImg = LightBoxNextImg; galleryElem.LightBoxPrevImg = LightBoxPrevImg; galleryElem.LightBoxCloseImg = LightBoxCloseImg; galleryElem.LightBoxLoadingImg = LightBoxLoadingImg; galleryElem.LightBoxBorderSize = LightBoxBorderSize; galleryElem.LightBoxResizeSpeed = LightBoxResizeSpeed; galleryElem.LightBoxHeight = LightBoxHeight; galleryElem.LightBoxWidth = LightBoxWidth; galleryElem.LightBoxAnimate = LightBoxAnimate; galleryElem.LightBoxOverlayOpacity = LightBoxOverlayOpacity; galleryElem.LightBoxExternalScriptPath = LightBoxExternalScriptPath; galleryElem.LightBoxGroup = LightBoxGroup; #endregion // Transformation properties galleryElem.TransformationName = TransformationName; galleryElem.AlternatingTransformationName = AlternatingTransformationName; galleryElem.SelectedItemTransformationName = SelectedItemTransformationName; galleryElem.FooterTransformationName = FooterTransformationName; galleryElem.HeaderTransformationName = HeaderTransformationName; galleryElem.SeparatorTransformationName = SeparatorTransformationName; } }
/// <summary> /// Initializes the control properties. /// </summary> protected void SetupControl() { if (StopProcessing) { // Do nothing } else { int userID = QueryHelper.GetInteger("userid", 0); UserInfo user = null; if (userID > 0) { user = UserInfoProvider.GetUserInfo(userID); } if (userID != 0) { if (user == null) { user = new UserInfo(); formElem.Mode = CMS.Base.Web.UI.FormModeEnum.Insert; formElem.AlternativeFormFullName = NewUserAlternativeForm; user.Enabled = true; } else { formElem.AlternativeFormFullName = EditUserAlternativeForm; } hdnUserRole.Value = GetUserRole(user); formElem.Info = user; pnlUserForm.Visible = true; pnlListView.Visible = false; formElem.SubmitButton.Visible = false; } else { pnlUserForm.Visible = false; pnlListView.Visible = true; repUsers.DataBindByDefault = false; pagerElem.PageControl = repUsers.ID; filterUsers.Visible = ShowFilterControl; filterUsers.OnFilterChanged += filterUsers_OnFilterChanged; srcUsers.OnFilterChanged += filterUsers_OnFilterChanged; // Basic control properties repUsers.HideControlForZeroRows = HideControlForZeroRows; repUsers.ZeroRowsText = ZeroRowsText; // Data source properties srcUsers.WhereCondition = WhereCondition; srcUsers.OrderBy = OrderBy; srcUsers.TopN = SelectTopN; srcUsers.SelectedColumns = Columns; srcUsers.SiteName = SiteName; srcUsers.FilterName = filterUsers.ID; srcUsers.SourceFilterName = FilterName; srcUsers.CacheItemName = CacheItemName; srcUsers.CacheDependencies = CacheDependencies; srcUsers.CacheMinutes = CacheMinutes; srcUsers.SelectOnlyApproved = SelectOnlyApproved; srcUsers.SelectHidden = SelectHidden; // Init data properties filterUsers.InitDataProperties(srcUsers); #region "Repeater template properties" // Apply transformations if they exist if (!String.IsNullOrEmpty(TransformationName)) { repUsers.ItemTemplate = TransformationHelper.LoadTransformation(this, TransformationName); } if (!String.IsNullOrEmpty(AlternatingItemTransformationName)) { repUsers.AlternatingItemTemplate = TransformationHelper.LoadTransformation(this, AlternatingItemTransformationName); } if (!String.IsNullOrEmpty(FooterTransformationName)) { repUsers.FooterTemplate = TransformationHelper.LoadTransformation(this, FooterTransformationName); } if (!String.IsNullOrEmpty(HeaderTransformationName)) { repUsers.HeaderTemplate = TransformationHelper.LoadTransformation(this, HeaderTransformationName); } if (!String.IsNullOrEmpty(SeparatorTransformationName)) { repUsers.SeparatorTemplate = TransformationHelper.LoadTransformation(this, SeparatorTransformationName); } #endregion // UniPager properties pagerElem.PageSize = PageSize; pagerElem.GroupSize = GroupSize; pagerElem.QueryStringKey = QueryStringKey; pagerElem.DisplayFirstLastAutomatically = DisplayFirstLastAutomatically; pagerElem.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically; pagerElem.HidePagerForSinglePage = HidePagerForSinglePage; pagerElem.Enabled = EnablePaging; switch (PagingMode.ToLowerCSafe()) { case "querystring": pagerElem.PagerMode = UniPagerMode.Querystring; break; default: pagerElem.PagerMode = UniPagerMode.PostBack; break; } #region "UniPager template properties" // UniPager template properties if (!String.IsNullOrEmpty(PagesTemplate)) { pagerElem.PageNumbersTemplate = TransformationHelper.LoadTransformation(pagerElem, PagesTemplate); } if (!String.IsNullOrEmpty(CurrentPageTemplate)) { pagerElem.CurrentPageTemplate = TransformationHelper.LoadTransformation(pagerElem, CurrentPageTemplate); } if (!String.IsNullOrEmpty(SeparatorTemplate)) { pagerElem.PageNumbersSeparatorTemplate = TransformationHelper.LoadTransformation(pagerElem, SeparatorTemplate); } if (!String.IsNullOrEmpty(FirstPageTemplate)) { pagerElem.FirstPageTemplate = TransformationHelper.LoadTransformation(pagerElem, FirstPageTemplate); } if (!String.IsNullOrEmpty(LastPageTemplate)) { pagerElem.LastPageTemplate = TransformationHelper.LoadTransformation(pagerElem, LastPageTemplate); } if (!String.IsNullOrEmpty(PreviousPageTemplate)) { pagerElem.PreviousPageTemplate = TransformationHelper.LoadTransformation(pagerElem, PreviousPageTemplate); } if (!String.IsNullOrEmpty(NextPageTemplate)) { pagerElem.NextPageTemplate = TransformationHelper.LoadTransformation(pagerElem, NextPageTemplate); } if (!String.IsNullOrEmpty(PreviousGroupTemplate)) { pagerElem.PreviousGroupTemplate = TransformationHelper.LoadTransformation(pagerElem, PreviousGroupTemplate); } if (!String.IsNullOrEmpty(NextGroupTemplate)) { pagerElem.NextGroupTemplate = TransformationHelper.LoadTransformation(pagerElem, NextGroupTemplate); } if (!String.IsNullOrEmpty(DirectPageTemplate)) { pagerElem.DirectPageTemplate = TransformationHelper.LoadTransformation(pagerElem, DirectPageTemplate); } if (!String.IsNullOrEmpty(LayoutTemplate)) { pagerElem.LayoutTemplate = TransformationHelper.LoadTransformation(pagerElem, LayoutTemplate); } #endregion // Connects repeater with data source repUsers.DataSource = srcUsers.DataSource; repUsers.DataBind(); filterUsers.NewUserButtonText = NewUserButtonText; } } }