public override void InitUserControl()
		{
			var singleBookmarkUserControl = LoadControl(BookmarkUserControlPath.SingleBookmarkUserControlPath) as BookmarkInfoBase;
			singleBookmarkUserControl.Bookmark = Bookmark;
			singleBookmarkUserControl.UserBookmark = UserBookmark;
			BookmarkInfoHolder.Controls.Add(singleBookmarkUserControl);

			var SortControl = new ViewSwitcher();
			
			SortControl.TabItems.Add(new ViewSwitcherTabItem()
			{
				TabName = BookmarkingUCResource.BookmarkedBy,
				DivID = "BookmarkedByPanel",
				IsSelected = ServiceHelper.SelectedTab == 0,
				SkipRender = true
			});

            SortControl.TabItems.Add(new ViewSwitcherTabItem()
			{
				TabName = BookmarkingUCResource.Comments +  String.Format(" ({0})",CommentsCount),
				DivID = "BookmarkCommentsPanel",
				IsSelected = ServiceHelper.SelectedTab == 1,
				SkipRender = true
			});


			BookmarkInfoTabsContainer.Controls.Add(SortControl);


			//Init comments
			using (var c = LoadControl(BookmarkUserControlPath.CommentsUserControlPath) as CommentsUserControl)
			{
				c.BookmarkID = this.Bookmark.ID;
				c.BookmarkComments = ServiceHelper.GetBookmarkComments(this.Bookmark);
				c.InitComments();
				CommentsHolder.Controls.Add(c);
			}
			if (Bookmark != null)
			{
				var userBookmarks = Bookmark.UserBookmarks;
				if (userBookmarks != null && userBookmarks.Count > 0)
				{
					//Init added by list
					AddedByRepeater.DataSource = userBookmarks;
					AddedByRepeater.DataBind();
				}
			}
		}		
Exemplo n.º 2
0
        public string RenderViewSwitcher(List <ViewSwitcherBaseItem> sortItems)
        {
            StringBuilder sb = new StringBuilder();

            using (StringWriter sw = new StringWriter(sb))
            {
                using (HtmlTextWriter textWriter = new HtmlTextWriter(sw))
                {
                    var viewSwithcer = new ViewSwitcher();
                    viewSwithcer.SortItems = sortItems;
                    viewSwithcer.RenderControl(textWriter);
                }
            }

            return(System.Text.RegularExpressions.Regex.Replace(sb.ToString(), @"\s+", " "));
        }
Exemplo n.º 3
0
		public string RenderViewSwitcher(List<ViewSwitcherBaseItem> sortItems)
		{
			StringBuilder sb = new StringBuilder();
			using (StringWriter sw = new StringWriter(sb))
			{
				using (HtmlTextWriter textWriter = new HtmlTextWriter(sw))
				{
					var viewSwithcer = new ViewSwitcher();
					viewSwithcer.SortItems = sortItems;					
					viewSwithcer.RenderControl(textWriter);
				}
			}

			return System.Text.RegularExpressions.Regex.Replace(sb.ToString(), @"\s+", " ");
		}
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility.RegisterTypeForAjax(typeof (BookmarkingUserControl));
            Utility.RegisterTypeForAjax(typeof (SingleBookmarkUserControl));
            Utility.RegisterTypeForAjax(typeof (CommentsUserControl));

            var createBookmark = LoadControl(BookmarkUserControlPath.CreateBookmarkUserControlPath) as CreateBookmarkUserControl;
            CreateBookmarkPanel.Controls.Add(createBookmark);

            var removePopup = LoadControl(BookmarkingRemoverFromFavouritePopup.Location) as BookmarkingRemoverFromFavouritePopup;
            BookmarkingRemoveFromFavouritePopupContainer.Controls.Add(removePopup);

            InitSettings();

            var SortControl = new ViewSwitcher {SortItemsHeader = BookmarkingUCResource.ShowLabel};

            ServiceHelper.InitServiceHelper(SortControl);
            BookmarkingSortPanel.Controls.Add(SortControl);

            if (Bookmarks == null)
            {
                Bookmarks = ServiceHelper.GetBookmarks();
            }

            if (Bookmarks == null || Bookmarks.Count == 0)
            {
                var hidePanelsFlag = false;
                var emptyScreenControl = new EmptyScreenControl
                                             {
                                                 ImgSrc = WebImageSupplier.GetAbsoluteWebPath("bookmarks_icon.png", BookmarkingSettings.ModuleId),
                                                 Describe = BookmarkingUCResource.EmptyScreenText
                                             };

                if (ServiceHelper.DisplayMode.Equals(BookmarkingServiceHelper.BookmarkDisplayMode.SearchBookmarks))
                {
                    hidePanelsFlag = true;

                    emptyScreenControl.Header = BookmarkingUCResource.EmptyScreenSearchCaption;
                }
                else
                {
                    var sortBy = Request.QueryString[BookmarkingRequestConstants.SortByParam];
                    if (string.IsNullOrEmpty(sortBy)
                        || BookmarkingRequestConstants.MostRecentParam.Equals(sortBy)
                        || BookmarkingRequestConstants.PopularityParam.Equals(sortBy))
                    {
                        hidePanelsFlag = true;

                        emptyScreenControl.Header = BookmarkingUCResource.EmptyScreenCaption;
                        emptyScreenControl.ButtonHTML = String.Format("<a class='linkAddMediumText' href='CreateBookmark.aspx'>{0}</a>", BookmarkingUCResource.EmptyScreenLink);
                    }
                    else
                    {
                        emptyScreenControl.Header = BookmarkingUCResource.EmptyScreenSearchCaption;
                    }
                }

                BookmarksHolder.Controls.Add(emptyScreenControl);
                if (hidePanelsFlag)
                {
                    BookmarkingSortPanel.Visible = false;
                    CreateBookmarkPanel.Visible = false;
                    BookmarksMainPanel.Visible = false;
                }
            }
            else
            {
                LoadBookmarks(Bookmarks);
            }
        }
Exemplo n.º 5
0
        protected void InitFilterBlock()
        {
            var SortControl = new ViewSwitcher();

            var combobox = new ViewSwitcherCombobox();
            combobox.SortLabel = ProjectResource.ProjectsByLabel;
            combobox.HintText = String.IsNullOrEmpty(Tag) ? String.Empty : Tag;

            combobox.ComboboxItems = new List<ViewSwitcherComboboxItem>();

            foreach (var label in Global.EngineFactory.GetTagEngine().GetTags())
                combobox.ComboboxItems.Add(new ViewSwitcherComboboxItem
                {
                    SortLabel = label.Value,
                    SortUrl = string.Format("projects.aspx?{0}={1}&{4}={2}{3}", UrlConstant.ProjectsFilter, ProjectFilter.ByLabel.ToString().ToLower(), HttpUtility.UrlEncode(label.Value), ShowClosedProjects ? "&view=all" : String.Empty, UrlConstant.ProjectsTag)

                });

            SortControl.SortItems.Add(new ViewSwitcherLinkItem
            {
                IsSelected = ProjectFilter.My == CurrentFilter || ProjectFilter.Default == CurrentFilter ? true : false,
                SortUrl = string.Format("projects.aspx?{0}={1}{2}", UrlConstant.ProjectsFilter, ProjectFilter.My.ToString().ToLower(), ShowClosedProjects ? "&view=all" : String.Empty),
                SortLabel = ProjectResource.MyProjects
            });



            SortControl.SortItems.Add(new ViewSwitcherLinkItem()
            {
                IsSelected = ProjectFilter.Following == CurrentFilter ? true : false,
                SortUrl = string.Format("projects.aspx?{0}={1}{2}", UrlConstant.ProjectsFilter, ProjectFilter.Following.ToString().ToLower(), ShowClosedProjects ? "&view=all" : String.Empty),
                SortLabel = ProjectResource.ProjectsKeepTrack,

            });

            if (combobox.ComboboxItems.Count > 0)
                SortControl.SortItems.Add(combobox);

            SortControl.SortItems.Add(new ViewSwitcherLinkItem()
            {
                IsSelected = ProjectFilter.All == CurrentFilter ? true : false,
                SortUrl = string.Format("projects.aspx?{0}={1}{2}", UrlConstant.ProjectsFilter, ProjectFilter.All.ToString().ToLower(), ShowClosedProjects ? "&view=all" : String.Empty),
                SortLabel = ProjectResource.AllProjects
            });

            //SortControl.SortItemsHeader = ProjectsCommonResource.Show + ":";

            _tabsContainer.Controls.Add(SortControl);

        }
Exemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            UserMakerContainer.Options.IsPopup = true;

            Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "usermaker_script", WebPath.GetPath("usercontrols/users/usermaker/js/usermaker.js"));
            Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "ajaxupload_script", WebPath.GetPath("js/ajaxupload.3.5.js"));

            var script = " StudioUserMaker.NewUserDialogTitle = '" + CustomNamingPeople.Substitute<Resources.Resource>("NewUserDialogTitle").HtmlEncode().ReplaceSingleQuote() + "';";
            script += " StudioUserMaker.EditUserDialogTitle = '" + Resources.Resource.EditUserDialogTitle.ReplaceSingleQuote() + "';";
            script += " StudioUserMaker.AddButton = '" + Resources.Resource.AddButton.ReplaceSingleQuote() + "';";
            script += " StudioUserMaker.SaveButton = '" + Resources.Resource.SaveButton.ReplaceSingleQuote() + "';";
            script += " StudioUserMaker.SignUpButton = '" + Resources.Resource.LoginRegistryButton.ReplaceSingleQuote() + "';";
            script += " StudioUserMaker.MaleStatus = '" + Resources.Resource.MaleSexStatus.ReplaceSingleQuote() + "';";
            script += " StudioUserMaker.FemaleStatus = '" + Resources.Resource.FemaleSexStatus.ReplaceSingleQuote() + "';";
            script += " StudioUserMaker.InfoPanelID = '" + UserMakerContainer.ClientID + "_InfoPanel';";

            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "usermaker_init_script", script, true);
            AjaxPro.Utility.RegisterTypeForAjax(this.GetType());

            _jqueryDateMask.Value = DateTimeExtension.DateMaskForJQuery;

            UserMakerContainer.Options.InfoMessageText = "";
            UserMakerContainer.Options.InfoType = Web.Controls.InfoType.Alert;

            var PropertiesTabs = new ViewSwitcher();
            PropertiesTabs.TabItems.Add(new ViewSwitcherTabItem
                                            {
                                                TabName = Resources.Resource.GeneralProperties,
                                                DivID = "idMajorProperties",
                                                IsSelected = true,
                                                SkipRender = true
                                            });

            PropertiesTabs.TabItems.Add(new ViewSwitcherTabItem
                                            {
                                                TabName = Resources.Resource.PersonalProperties,
                                                DivID = "idSocialProperties",
                                                SkipRender = true
                                            });

            idTabsContainer.Controls.Add(PropertiesTabs);
        }