/// <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 = CMSContext.CurrentDocumentCulture.CultureCode;
            }
            else
            {
                ucAttachments.CultureCode = CultureCode;
            }
            if (string.IsNullOrEmpty(Path))
            {
                Path = CMSContext.CurrentAliasPath;
            }
            Path = TreePathUtils.EnsureSingleNodePath(Path);
            ucAttachments.Path     = 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.ToLower())
            {
            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.ToLower() == CommunityContext.CurrentGroup.GroupName.ToLower()))
                {
                    gi = CommunityContext.CurrentGroup;
                }
                else
                {
                    gi = GroupInfoProvider.GetGroupInfo(GroupName, CMSContext.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 = CMSDataProperties.LoadTransformation(this, TransformationName, false);

                    if (!String.IsNullOrEmpty(AlternatingItemTransformationName))
                    {
                        repLatestPosts.AlternatingItemTemplate = CMSDataProperties.LoadTransformation(this, AlternatingItemTransformationName, false);
                    }
                    if (!String.IsNullOrEmpty(FooterTransformationName))
                    {
                        repLatestPosts.FooterTemplate = CMSDataProperties.LoadTransformation(this, FooterTransformationName, false);
                    }
                    if (!String.IsNullOrEmpty(HeaderTransformationName))
                    {
                        repLatestPosts.HeaderTemplate = CMSDataProperties.LoadTransformation(this, HeaderTransformationName, false);
                    }
                    if (!String.IsNullOrEmpty(SeparatorTransformationName))
                    {
                        repLatestPosts.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.ToLower())
                    {
                    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

                    forumDataSource.WhereCondition   = WhereCondition;
                    forumDataSource.GroupID          = gi.GroupID;
                    forumDataSource.CheckPermissions = true;
                    forumDataSource.SiteName         = SiteName;
                    repLatestPosts.DataSource        = forumDataSource.DataSource;

                    if (!DataHelper.DataSourceIsEmpty(repLatestPosts.DataSource))
                    {
                        repLatestPosts.DataBind();
                    }
                }
                else
                {
                    forumDataSource.StopProcessing = true;
                }
            }

            ReleaseContext();
        }
    }
Beispiel #3
0
    /// <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           = ZeroRowsText;

                // Data source properties
                boardDataSource.ShowGroupMessages = true;
                boardDataSource.TopN               = SelectTopN;
                boardDataSource.OrderBy            = OrderBy;
                boardDataSource.CacheItemName      = CacheItemName;
                boardDataSource.CacheDependencies  = CacheDependencies;
                boardDataSource.CacheMinutes       = CacheMinutes;
                boardDataSource.FilterName         = ValidationHelper.GetString(GetValue("WebPartControlID"), ClientID);
                boardDataSource.SourceFilterName   = FilterName;
                boardDataSource.SelectOnlyApproved = DisplayOnlyApproved;
                boardDataSource.SiteName           = CMSContext.CurrentSiteName;
                boardDataSource.SelectedColumns    = Columns;

                #region "Repeater template properties"

                // Apply transformations if they exist
                repMessages.ItemTemplate = CMSDataProperties.LoadTransformation(this, TransformationName, false);

                if (!String.IsNullOrEmpty(AlternatingItemTransformationName))
                {
                    repMessages.AlternatingItemTemplate = CMSDataProperties.LoadTransformation(this, AlternatingItemTransformationName, false);
                }
                if (!String.IsNullOrEmpty(FooterTransformationName))
                {
                    repMessages.FooterTemplate = CMSDataProperties.LoadTransformation(this, FooterTransformationName, false);
                }
                if (!String.IsNullOrEmpty(HeaderTransformationName))
                {
                    repMessages.HeaderTemplate = CMSDataProperties.LoadTransformation(this, HeaderTransformationName, false);
                }
                if (!String.IsNullOrEmpty(SeparatorTransformationName))
                {
                    repMessages.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.ToLower())
                {
                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

                string where = "(GroupName = N'" + SqlHelperClass.GetSafeQueryString(GroupName, false) + "')";

                if (!string.IsNullOrEmpty(WhereCondition))
                {
                    where = "(" + WhereCondition + ") AND (" + where + ")";
                }

                boardDataSource.WhereCondition = where;

                repMessages.DataSource = boardDataSource.DataSource;

                if (!DataHelper.DataSourceIsEmpty(repMessages.DataSource))
                {
                    repMessages.DataBind();
                }
            }
        }
    }
    /// <summary>
    /// Initializes the control properties.
    /// </summary>
    protected void SetupControl()
    {
        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, false);

                if (!string.IsNullOrEmpty(AlternatingItemTransformationName))
                {
                    repFriends.AlternatingItemTemplate = CMSDataProperties.LoadTransformation(this,
                                                                                              AlternatingItemTransformationName,
                                                                                              false);
                }
                if (!string.IsNullOrEmpty(FooterTransformationName))
                {
                    repFriends.FooterTemplate = CMSDataProperties.LoadTransformation(this, FooterTransformationName,
                                                                                     false);
                }
                if (!string.IsNullOrEmpty(HeaderTransformationName))
                {
                    repFriends.HeaderTemplate = CMSDataProperties.LoadTransformation(this, HeaderTransformationName,
                                                                                     false);
                }
                if (!string.IsNullOrEmpty(SeparatorTransformationName))
                {
                    repFriends.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.ToLower())
                {
                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
                repFriends.DataSource = srcFriends.DataSource;

                if (!DataHelper.DataSourceIsEmpty(repFriends.DataSource))
                {
                    repFriends.DataBind();
                }
            }
        }
    }
Beispiel #5
0
    /// <summary>
    /// Initializes the control properties.
    /// </summary>
    protected void SetupControl()
    {
        if (StopProcessing)
        {
            // Do nothing
            filterUsers.StopProcessing = true;
            srcUsers.StopProcessing    = true;
        }
        else
        {
            // Set general properties
            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;


            TreeNode     node = null;
            TreeProvider tree = new TreeProvider(CMSContext.CurrentUser);

            // Check if path is set
            if (String.IsNullOrEmpty(Path))
            {
                TreeNode curDoc = CMSContext.CurrentDocument;
                // Check if current document is department
                if ((curDoc != null) && (curDoc.NodeClassName.ToLower() == DEPARTMENT_CLASS_NAME))
                {
                    node = CMSContext.CurrentDocument;
                }
            }
            else
            {
                // Obtain document from specified path
                node = tree.SelectSingleNode(SiteName, Path, CMSContext.PreferredCultureCode, true, DEPARTMENT_CLASS_NAME, false, false, false);
            }

            AclProvider aclProv = new AclProvider(tree);
            // If department document exists and has own ACL continue with initializing controls
            if ((node != null) && aclProv.HasOwnACL(node))
            {
                // Get users and roles with read permission for department document
                int     aclId   = ValidationHelper.GetInteger(node.GetValue("NodeACLID"), 0);
                DataSet dsRoles = aclProv.GetAllowedRoles(aclId, NodePermissionsEnum.Read, "RoleID");
                DataSet dsUsers = aclProv.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   = SqlHelperClass.GetStringValues(dsUsers.Tables[0], "UserID");
                    string         userIds = TextHelper.Join(", ", users);

                    // Populate where condition with user condition
                    where = SqlHelperClass.AddWhereCondition("UserID IN (" + userIds + ")", where);
                }

                // Process roles dataset to where condition
                if (!DataHelper.DataSourceIsEmpty(dsRoles))
                {
                    // Get allowed roles ids
                    IList <string> roles   = SqlHelperClass.GetStringValues(dsRoles.Tables[0], "RoleID");
                    string         roleIds = TextHelper.Join(", ", roles);

                    // Populate where condition with role condition
                    where = SqlHelperClass.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 = SqlHelperClass.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, 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.ToLower())
                    {
                    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();
                }
                else
                {
                    // Disable datasource
                    srcUsers.StopProcessing = true;
                }
            }
            else
            {
                // Disable datasource
                srcUsers.StopProcessing = true;
            }
        }
    }
Beispiel #6
0
    /// <summary>
    /// Initializes the control properties.
    /// </summary>
    public void SetupControl()
    {
        if (StopProcessing)
        {
            // Do nothing
        }
        else
        {
            // If target control is not specified do notinhg
            if (!String.IsNullOrEmpty(TargetControlName))
            {
                #region "Pager properties"

                pagerElem.FilterTypePageControl = TargetControlName;
                pagerElem.PageSize       = PageSize;
                pagerElem.GroupSize      = GroupSize;
                pagerElem.QueryStringKey = QueryStringKey;
                pagerElem.DisplayFirstLastAutomatically    = DisplayFirstLastAutomatically;
                pagerElem.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically;
                pagerElem.HidePagerForSinglePage           = HidePagerForSinglePage;

                switch (PagingMode.ToLower())
                {
                case "postback": pagerElem.PagerMode = UniPagerMode.PostBack; break;

                default: pagerElem.PagerMode = UniPagerMode.Querystring; break;
                }

                #endregion


                #region "Pager tamplates"

                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
            }
        }
    }
Beispiel #7
0
    /// <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 = CMSContext.CurrentDocumentCulture.CultureCode;
            }
            else
            {
                ucDataSource.CultureCode = CultureCode;
            }

            if (string.IsNullOrEmpty(Path))
            {
                Path = CMSContext.CurrentAliasPath;
            }

            Path = TreePathUtils.EnsureSingleNodePath(Path);
            ucDataSource.Path     = 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.ToLower())
            {
            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.IncludeJQuery         = IncludeJQuery;
            ucRepeater.ScriptFiles           = ScriptFiles;
            ucRepeater.InitScript            = InitScript;
            ucRepeater.CSSFiles  = CSSFiles;
            ucRepeater.InlineCSS = InlineCSS;

            // Setup repeater and pager templates
            SetupTemplates();
        }
    }
Beispiel #8
0
    /// <summary>
    /// Initializes the control properties.
    /// </summary>
    protected void SetupControl()
    {
        if (StopProcessing)
        {
            // Do nothing
        }
        else
        {
            repMembers.DataBindByDefault = false;
            pagerElem.PageControl        = repMembers.ID;
            filterMembers.SiteName       = SiteName;
            srcMembers.SiteName          = SiteName;

            filterMembers.Visible          = ShowFilterControl;
            filterMembers.OnFilterChanged += filterMembers_OnFilterChanged;
            srcMembers.OnFilterChanged    += filterMembers_OnFilterChanged;

            // If group name is not specified display nothing
            if ((GroupName == GroupInfoProvider.CURRENT_GROUP) || (GroupName == String.Empty))
            {
                return;
            }

            // Basic control properties
            repMembers.HideControlForZeroRows = HideControlForZeroRows;
            repMembers.ZeroRowsText           = ZeroRowsText;

            // Data source properties
            srcMembers.WhereCondition    = WhereCondition;
            srcMembers.OrderBy           = OrderBy;
            srcMembers.TopN              = SelectTopN;
            srcMembers.FilterName        = filterMembers.ID;
            srcMembers.SourceFilterName  = FilterName;
            srcMembers.CacheItemName     = CacheItemName;
            srcMembers.CacheDependencies = CacheDependencies;
            srcMembers.CacheMinutes      = CacheMinutes;
            srcMembers.GroupName         = GroupName;
            srcMembers.SelectedColumns   = Columns;

            // Init data properties
            filterMembers.InitDataProperties(srcMembers);

            #region "Repeater template properties"

            // Apply transformations if they exist
            if (!String.IsNullOrEmpty(TransformationName))
            {
                repMembers.ItemTemplate = CMSDataProperties.LoadTransformation(this, TransformationName, false);
            }
            if (!String.IsNullOrEmpty(AlternatingItemTransformationName))
            {
                repMembers.AlternatingItemTemplate = CMSDataProperties.LoadTransformation(this, AlternatingItemTransformationName, false);
            }
            if (!String.IsNullOrEmpty(FooterTransformationName))
            {
                repMembers.FooterTemplate = CMSDataProperties.LoadTransformation(this, FooterTransformationName, false);
            }
            if (!String.IsNullOrEmpty(HeaderTransformationName))
            {
                repMembers.HeaderTemplate = CMSDataProperties.LoadTransformation(this, HeaderTransformationName, false);
            }
            if (!String.IsNullOrEmpty(SeparatorTransformationName))
            {
                repMembers.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.ToLower())
            {
            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
            repMembers.DataSource = srcMembers.DataSource;
            if (!DataHelper.DataSourceIsEmpty(repMembers.DataSource))
            {
                repMembers.DataBind();
            }
        }
    }
Beispiel #9
0
    /// <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 = CMSContext.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 = (ViewMode == ViewModeEnum.Design);
            }

            // UniPager properties
            galleryElem.PageSize       = PageSize;
            galleryElem.GroupSize      = GroupSize;
            galleryElem.QueryStringKey = QueryStringKey;
            galleryElem.DisplayFirstLastAutomatically    = DisplayFirstLastAutomatically;
            galleryElem.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically;
            galleryElem.HidePagerForSinglePage           = HidePagerForSinglePage;

            switch (PagingMode.ToLower())
            {
            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()
    {
        // Set stop processing to inner controls trough property setter
        StopProcessing = StopProcessing;

        if (this.StopProcessing)
        {
            // Do nothing
        }
        else
        {
            BasicRepeater.DataBindByDefault = false;
            pagerElem.PageControl           = BasicRepeater.ID;

            if (!String.IsNullOrEmpty(TransformationName))
            {
                // Set SharePoint datasource properties
                SPDataSource.Username          = this.Username;
                SPDataSource.Password          = EncryptionHelper.DecryptData(this.Password);
                SPDataSource.ListName          = this.ListName;
                SPDataSource.SPServiceURL      = this.SPServiceURL;
                SPDataSource.ShowReturnedCAML  = this.ShowReturnedCAML;
                SPDataSource.RowLimit          = this.RowLimit;
                SPDataSource.Query             = this.Query;
                SPDataSource.ViewFields        = this.ViewFields;
                SPDataSource.UseClassicDataset = this.UseClassicDataset;
                SPDataSource.Fields            = this.Fields;
                SPDataSource.Mode                  = this.Mode;
                SPDataSource.ItemIDField           = this.ItemIDField;
                SPDataSource.SelectedItemFieldName = this.SelectedItemFieldName;
                SPDataSource.ItemIDFieldType       = this.ItemIDFieldType;
                SPDataSource.CacheItemName         = this.CacheItemName;
                SPDataSource.CacheDependencies     = this.CacheDependencies;
                SPDataSource.CacheMinutes          = this.CacheMinutes;


                // Classic repeater+dataset OR XSLT transformation
                if (this.UseClassicDataset)
                {
                    // Basic repeater properties
                    BasicRepeater.HideControlForZeroRows = HideControlForZeroRows;
                    BasicRepeater.ZeroRowsText           = ZeroRowsText;

                    // UniPager properties
                    pagerElem.PageSize       = PageSize;
                    pagerElem.GroupSize      = GroupSize;
                    pagerElem.QueryStringKey = QueryStringKey;
                    pagerElem.DisplayFirstLastAutomatically    = DisplayFirstLastAutomatically;
                    pagerElem.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically;
                    pagerElem.HidePagerForSinglePage           = HidePagerForSinglePage;

                    switch (PagingMode.ToLower())
                    {
                    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
                }
                else
                {
                    plcDataset.Visible = false;
                    plcXSLT.Visible    = true;
                }

                // Load and bind data
                BindData();
            }
        }
    }
    /// <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(this.GroupName))
                {
                    GeneralizedInfo gi = ModuleCommands.CommunityGetGroupInfoByName(this.GroupName, this.SiteName);
                    if (gi != null)
                    {
                        forumDataSource.GroupID = ValidationHelper.GetInteger(gi.GetValue("GroupID"), 0);
                    }
                    else
                    {
                        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.FilterName         = ValidationHelper.GetString(GetValue("WebPartControlID"), ClientID);
                    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, false);

                    if (!String.IsNullOrEmpty(AlternatingItemTransformationName))
                    {
                        repLatestPosts.AlternatingItemTemplate = CMSDataProperties.LoadTransformation(this, AlternatingItemTransformationName, false);
                    }
                    if (!String.IsNullOrEmpty(FooterTransformationName))
                    {
                        repLatestPosts.FooterTemplate = CMSDataProperties.LoadTransformation(this, FooterTransformationName, false);
                    }
                    if (!String.IsNullOrEmpty(HeaderTransformationName))
                    {
                        repLatestPosts.HeaderTemplate = CMSDataProperties.LoadTransformation(this, HeaderTransformationName, false);
                    }
                    if (!String.IsNullOrEmpty(SeparatorTransformationName))
                    {
                        repLatestPosts.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.ToLower())
                    {
                    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

                    #region "Complete where condition"

                    string where = "";
                    string[] groups = ForumGroups.Split(';');
                    foreach (string group in groups)
                    {
                        if (group != "")
                        {
                            if (where != "")
                            {
                                where += "OR";
                            }
                            where += "(GroupName = N'" + SqlHelperClass.GetSafeQueryString(group, false) + "')";
                        }
                    }

                    if (!string.IsNullOrEmpty(WhereCondition))
                    {
                        if (string.IsNullOrEmpty(where))
                        {
                            where = WhereCondition;
                        }
                        else
                        {
                            where = "(" + WhereCondition + ") AND (" + where + ")";
                        }
                    }

                    #endregion

                    forumDataSource.WhereCondition   = where;
                    forumDataSource.CheckPermissions = true;
                    repLatestPosts.DataSource        = forumDataSource.DataSource;

                    if (!DataHelper.DataSourceIsEmpty(repLatestPosts.DataSource))
                    {
                        repLatestPosts.DataBind();
                    }
                }
            }
        }
    }