Example #1
0
        protected override void PageLoad()
        {
            Guid?userId = null;

            if (!String.IsNullOrEmpty(UserID))
            {
                userId = Guid.NewGuid();
                try
                {
                    userId = new Guid(UserID);
                }
                catch
                {
                }
            }

            var postsQuery = new PostsQuery();

            mainContainer.BreadCrumbs.Add(new BreadCrumb {
                Caption = BlogsResource.AddonName, NavigationUrl = VirtualPathUtility.ToAbsolute(ASC.Blogs.Core.Constants.BaseVirtualPath)
            });
            if (userId.HasValue)
            {
                mainContainer.BreadCrumbs.Add(new BreadCrumb {
                    Caption = DisplayUserSettings.GetFullUserName(userId.Value, false)
                });
                postsQuery.SetUser(userId.Value);
            }
            else if (!String.IsNullOrEmpty(TagName))
            {
                mainContainer.BreadCrumbs.Add(new BreadCrumb {
                    Caption = HeaderStringHelper.GetHTMLSearchHeader(TagName)
                });
                postsQuery.SetTag(TagName);
            }
            else if (!String.IsNullOrEmpty(Search))
            {
                mainContainer.BreadCrumbs.Add(new BreadCrumb {
                    Caption = HeaderStringHelper.GetHTMLSearchHeader(Search)
                });
                postsQuery.SetSearch(Search);
            }

            if (!IsPostBack)
            {
                var engine = BasePage.GetEngine();
                FillPosts(postsQuery, engine);

                InitSidePanel(engine, TagCloud);
                sideRecentActivity.TenantId  = TenantProvider.CurrentTenantID;
                sideRecentActivity.ProductId = Product.CommunityProduct.ID;
                sideRecentActivity.ModuleId  = ASC.Blogs.Core.Constants.ModuleID;

                base.InitSubscribers(actions);
            }

            this.Title = HeaderStringHelper.GetPageTitle(BlogsResource.AddonName, mainContainer.BreadCrumbs);
        }
Example #2
0
        protected override void PageLoad()
        {
            Title = HeaderStringHelper.GetPageTitle(FilesCommonResource.ModuleName, Master.BreadCrumbs);
            Master.DisabledSidePanel            = true;
            Master.CommonContainerHeaderVisible = true;
            Master.BreadCrumbs.Add(new BreadCrumb(FilesCommonResource.ModuleName, VirtualPathUtility.ToAbsolute(PathProvider.StartURL)));
            Master.BreadCrumbs.Add(new BreadCrumb(HeaderStringHelper.GetHTMLSearchHeader(SearchText)));

            emptyScreenControl.ImgSrc     = PathProvider.GetImagePath("150x_product_logo.png");
            emptyScreenControl.Header     = FilesCommonResource.NothingFound;
            emptyScreenControl.Describe   = FilesCommonResource.SearchNotFoundDescript;
            emptyScreenControl.ButtonHTML = String.Format("<a href='{0}'>{1}</a>", VirtualPathUtility.ToAbsolute(PathProvider.StartURL), FilesUCResource.ButtonGotoMy);

            EmployeesSearch();
            ContentSearch();
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            (Master as WikiMaster).GetNavigateActionsVisible += new WikiMaster.GetNavigateActionsVisibleHandle(Search_GetNavigateActionsVisible);

            BreadCrumb.Add(new BreadCrumb {
                Caption = WikiResource.wikiSearchCaption, NavigationUrl = this.ResolveUrlLC("Search.aspx")
            });
            if (!string.IsNullOrEmpty(searchContent))
            {
                BreadCrumb.Add(new BreadCrumb {
                    Caption = HeaderStringHelper.GetHTMLSearchHeader(searchContent)
                });
            }

            if (!IsPostBack)
            {
                BindRepeater();
            }
        }
        protected virtual void InitBreadcrumbs(string pageTitle)
        {
            container.BreadCrumbs.Add(new BreadCrumb()
            {
                Caption = pageTitle, NavigationUrl = BookmarkingRequestConstants.BookmarkingPageName
            });

            var searchText = ServiceHelper.GetSearchText();

            if (!String.IsNullOrEmpty(searchText))
            {
                ServiceHelper.DisplayMode = BookmarkingServiceHelper.BookmarkDisplayMode.SearchBookmarks;
                var searchResults = HeaderStringHelper.GetHTMLSearchHeader(searchText);

                container.BreadCrumbs.Add(new BreadCrumb {
                    Caption = searchResults, NavigationUrl = ServiceHelper.GetCurrentURL()
                });
                return;
            }

            searchText = ServiceHelper.GetSearchTag();
            if (!String.IsNullOrEmpty(searchText))
            {
                ServiceHelper.DisplayMode = BookmarkingServiceHelper.BookmarkDisplayMode.SearchByTag;
                var searchResults = String.Format("{0} {1}", BookmarkingResource.TagBookmarks, searchText);

                container.BreadCrumbs.Add(new BreadCrumb()
                {
                    Caption = BookmarkingResource.TagPageTitle, NavigationUrl = BookmarkingRequestConstants.TagsPageName
                });

                container.BreadCrumbs.Add(new BreadCrumb()
                {
                    Caption = searchResults, NavigationUrl = ServiceHelper.GetCurrentURL()
                });
            }
        }
Example #5
0
        public void InitPage()
        {
            SearchText = UrlParameters.Search;

            int prjID;

            if (!int.TryParse(UrlParameters.ProjectID, out prjID))
            {
                prjID = -1;
            }

            ProjectID = prjID;

            Master.BreadCrumbs.Add(new BreadCrumb {
                Caption = ProjectsCommonResource.Dashboard, NavigationUrl = "./"
            });
            Master.BreadCrumbs.Add(new BreadCrumb
            {
                Caption       = HeaderStringHelper.GetHTMLSearchHeader(SearchText),
                NavigationUrl = string.Format("search.aspx?pid={0}&search={1}", ProductEntryPoint.ID, SearchText)
            });

            var project = ProjectID != -1 ? Global.EngineFactory.GetProjectEngine().GetByID(ProjectID) : null;

            if (project != null)
            {
                Master.BreadCrumbs.Add(new BreadCrumb
                {
                    Caption       = project.HtmlTitle,
                    NavigationUrl = string.Format("search.aspx?prjID={0}&search={1}", ProjectID, SearchText)
                });
            }

            Title = HeaderStringHelper.GetPageTitle(ProjectsCommonResource.ModuleName, Master.BreadCrumbs);
            Master.DisabledSidePanel = true;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ForumManager.Instance.SetCurrentPage(ForumPage.Search);

            var currentPageNumber = 0;

            if (!String.IsNullOrEmpty(Request["p"]))
            {
                try
                {
                    currentPageNumber = Convert.ToInt32(Request["p"]);
                }
                catch
                {
                    currentPageNumber = 0;
                }
            }
            if (currentPageNumber <= 0)
            {
                currentPageNumber = 1;
            }

            var findTopicList = new List <Topic>();
            var topicCount    = 0;

            var searchText = "";

            _tagID       = 0;
            _isFindByTag = false;

            var tagName = "";

            if (!String.IsNullOrEmpty(Request["tag"]))
            {
                _isFindByTag = true;
                try
                {
                    _tagID = Convert.ToInt32(Request["tag"]);
                }
                catch
                {
                    _tagID = 0;
                }

                findTopicList = ForumDataProvider.SearchTopicsByTag(TenantProvider.CurrentTenantID, _tagID, currentPageNumber, ForumManager.Settings.TopicCountOnPage, out topicCount);
            }
            else if (!String.IsNullOrEmpty(Request["search"]))
            {
                searchText    = Request["search"];
                findTopicList = ForumDataProvider.SearchTopicsByText(TenantProvider.CurrentTenantID, searchText, currentPageNumber, ForumManager.Settings.TopicCountOnPage, out topicCount);
            }

            if (findTopicList.Count > 0)
            {
                _isFind = true;

                var i = 0;
                foreach (var topic in findTopicList)
                {
                    if (i == 0)
                    {
                        foreach (var tag in topic.Tags)
                        {
                            if (tag.ID == _tagID)
                            {
                                tagName = tag.Name;
                                break;
                            }
                        }
                    }

                    var topicControl = (TopicControl)LoadControl(ForumManager.Settings.UserControlsVirtualPath + "/TopicControl.ascx");
                    topicControl.SettingsID       = ForumManager.Settings.ID;
                    topicControl.Topic            = topic;
                    topicControl.IsShowThreadName = true;
                    topicControl.IsEven           = (i % 2 == 0);
                    topicListHolder.Controls.Add(topicControl);
                    i++;
                }

                var pageNavigator = new PageNavigator
                {
                    CurrentPageNumber = currentPageNumber,
                    EntryCountOnPage  = ForumManager.Settings.TopicCountOnPage,
                    VisiblePageCount  = 5,
                    EntryCount        = topicCount
                };
                if (_isFindByTag)
                {
                    pageNavigator.PageUrl = _isFindByTag
                                                ? "search.aspx?tag=" + _tagID.ToString()
                                                : "search.aspx?search=" + HttpUtility.UrlEncode(searchText, Encoding.UTF8);
                }

                bottomPageNavigatorHolder.Controls.Add(pageNavigator);
            }
            else
            {
                var emptyScreenControl = new EmptyScreenControl
                {
                    ImgSrc   = WebImageSupplier.GetAbsoluteWebPath("forums_icon.png", ForumManager.Settings.ModuleID),
                    Header   = Resources.ForumResource.EmptyScreenSearchCaption,
                    Describe = Resources.ForumResource.EmptyScreenSearchText,
                };

                topicListHolder.Controls.Add(emptyScreenControl);
            }

            (Master as ForumMasterPage).CurrentPageCaption = HeaderStringHelper.GetHTMLSearchHeader(_isFindByTag ? tagName : searchText);

            Title = HeaderStringHelper.GetPageTitle((Master as ForumMasterPage).CurrentPageCaption);
        }
Example #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var master = Master as IStudioMaster;

            if (master == null)
            {
                return;
            }

            AjaxPro.Utility.RegisterTypeForAjax(this.GetType());

            //top navigator
            if (master is StudioTemplate)
            {
                (master as StudioTemplate).TopNavigationPanel.CustomTitle        = Resources.Resource.Search;
                (master as StudioTemplate).TopNavigationPanel.CustomTitleIconURL = WebImageSupplier.GetAbsoluteWebPath("search.png");
            }

            master.DisabledSidePanel = true;

            Guid productID;

            if (!String.IsNullOrEmpty(Request["productID"]))
            {
                productID = new Guid(Request["productID"]);
            }
            else
            {
                productID = GetProductID();
            }



            _searchText = Request["search"] ?? "";
            var data = SearchAll(_searchText, productID);

            var container = new Container {
                Body = new PlaceHolder(), Header = new PlaceHolder()
            };

            container.BreadCrumbs.Add(new BreadCrumb {
                Caption = Resources.Resource.MainTitle, NavigationUrl = productID.Equals(Guid.Empty) ? CommonLinkUtility.GetDefault() : VirtualPathUtility.ToAbsolute(ProductManager.Instance[productID].StartURL)
            });
            container.BreadCrumbs.Add(new BreadCrumb {
                Caption = HeaderStringHelper.GetHTMLSearchHeader(_searchText)
            });
            master.ContentHolder.Controls.Add(container);

            Title = HeaderStringHelper.GetPageTitle(Resources.Resource.Search, container.BreadCrumbs);

            if (data.Count <= 0)
            {
                var emptyScreenControl = new EmptyScreenControl
                {
                    ImgSrc   = WebImageSupplier.GetAbsoluteWebPath("empty_search.png"),
                    Header   = Resources.Resource.SearchNotFoundMessage,
                    Describe = Resources.Resource.SearchNotFoundDescript
                };
                container.Body.Controls.Add(emptyScreenControl);
            }
            else
            {
                var oSearchView = (SearchResults)LoadControl(SearchResults.Location);
                //data.Sort(new SearchComparer());
                oSearchView.DataSourceObj = data;
                container.Body.Controls.Add(oSearchView);
            }
        }
Example #8
0
        private void BindBreadCrumbs()
        {
            var result = new List <BreadCrumb>();

            if (EmployeeStatus == EmployeeStatus.Terminated)
            {
                InsertCompany(result);
                result.Add(new BreadCrumb {
                    Caption = CustomNamingPeople.Substitute <Resources.Resource>("DisableEmployeesTitle")
                });

                EmployeeContainer.BreadCrumbs = result;
                Page.Title = HeaderStringHelper.GetPageTitle(CustomNamingPeople.Substitute <Resources.Resource>("Employees"), result);
                return;
            }

            if (IsPending)
            {
                InsertCompany(result);
                result.Add(new BreadCrumb {
                    Caption = CustomNamingPeople.Substitute <Resources.Resource>("PendingEmployeesTitle")
                });

                EmployeeContainer.BreadCrumbs = result;
                Page.Title = HeaderStringHelper.GetPageTitle(CustomNamingPeople.Substitute <Resources.Resource>("Employees"), result);
                return;
            }


            GroupInfo group = null;

            if (!string.IsNullOrEmpty(_strDepartmentId))
            {
                try
                {
                    group = CoreContext.GroupManager.GetGroupInfo(new Guid(_strDepartmentId));
                }
                catch { }
            }

            if (DepartmentList == null)
            {
                if (string.IsNullOrEmpty(_strDepartmentId) && string.IsNullOrEmpty(Request["search"]))
                {
                    InsertCompany(result);
                }
                if (!string.IsNullOrEmpty(_strDepartmentId) && string.IsNullOrEmpty(Request["search"]))
                {
                    if (group == null)
                    {
                        PrepereStartState();
                    }

                    else
                    {
                        var grParent = group;
                        while (grParent.Parent != null)
                        {
                            result.Insert(0, new BreadCrumb {
                                NavigationUrl = GetLinkByGuid(grParent.Parent.ID), Caption = grParent.Parent.Name
                            });
                            grParent = grParent.Parent;
                        }

                        InsertCompany(result);
                        result.Add(new BreadCrumb {
                            NavigationUrl = GetLinkByGuid(group.ID), Caption = group.Name
                        });
                    }
                }
                else if (!string.IsNullOrEmpty(_strDepartmentId) && !string.IsNullOrEmpty(Request["search"]))
                {
                    if (group == null)
                    {
                        PrepereStartState();
                    }
                    else
                    {
                        result.Insert(0, new BreadCrumb {
                            NavigationUrl = GetLinkByGuid(group.ID), Caption = group.Name
                        });
                        while (group.Parent != null)
                        {
                            result.Insert(0, new BreadCrumb {
                                NavigationUrl = GetLinkByGuid(group.Parent.ID), Caption = group.Parent.Name
                            });
                            group = group.Parent;
                        }

                        InsertCompany(result);
                        result.Add(new BreadCrumb {
                            NavigationUrl = GetLinkByGuid(Guid.Empty), Caption = string.Format("\"{0}\"", Request["search"])
                        });
                    }
                }
                else if (string.IsNullOrEmpty(_strDepartmentId) && !string.IsNullOrEmpty(Request["search"]))
                {
                    InsertCompany(result);
                    result.Add(new BreadCrumb {
                        NavigationUrl = GetLinkByGuid(Guid.Empty), Caption = HeaderStringHelper.GetHTMLSearchHeader(Request["search"])
                    });
                }
            }
            else
            {
                result.Add(new BreadCrumb {
                    NavigationUrl = GetDepartmentsLink(), Caption = CustomNamingPeople.Substitute <Resources.Resource>("Departments")
                });
                if (Department != null)
                {
                    result.Add(new BreadCrumb
                    {
                        NavigationUrl = GetDepartmentsLink(DepartmentId),
                        Caption       = Department.Name
                    });
                }
            }

            if (result.Count > 0)
            {
                EmployeeContainer.BreadCrumbs = result;
            }

            Page.Title = HeaderStringHelper.GetPageTitle(CustomNamingPeople.Substitute <Resources.Resource>("Employees"), result);
        }
Example #9
0
        private void LoadData()
        {
            var storage  = FeedStorageFactory.Create();
            var feedType = FeedType.All;

            if (!string.IsNullOrEmpty(Request["type"]))
            {
                feedType = (FeedType)Enum.Parse(typeof(FeedType), Request["type"], true);
                var feedTypeInfo = FeedTypeInfo.FromFeedType(feedType);
                Breadcrumb.Add(new BreadCrumb
                {
                    Caption       = feedTypeInfo.TypeName,
                    NavigationUrl = FeedUrls.GetFeedListUrl(feedType)
                });
                if (!string.IsNullOrEmpty(Request["search"]))
                {
                    Breadcrumb.Add(new BreadCrumb {
                        Caption = HeaderStringHelper.GetHTMLSearchHeader(Request["search"]), NavigationUrl = VirtualPathUtility.ToAbsolute("~/products/community/modules/news/") + "?type=" + Request["type"] + "&search=" + Request["search"] + Info.UserIdAttribute
                    });
                }
            }
            else if (!string.IsNullOrEmpty(Request["search"]))
            {
                Breadcrumb.Add(new BreadCrumb {
                    Caption = HeaderStringHelper.GetHTMLSearchHeader(Request["search"]), NavigationUrl = VirtualPathUtility.ToAbsolute("~/products/community/modules/news/") + "?search=" + Request["search"] + Info.UserIdAttribute
                });
            }

            var feedsCount = !string.IsNullOrEmpty(Request["search"]) ? storage.SearchFeedsCount(Request["search"], feedType, Info.UserId) : storage.GetFeedsCount(feedType, Info.UserId);

            if (feedsCount == 0)
            {
                FeedRepeater.Visible = false;
                MessageShow.Visible  = true;

                string buttonLink;
                string buttonName;
                var    emptyScreenControl = new EmptyScreenControl {
                    Describe = NewsResource.EmptyScreenText
                };

                switch (feedType)
                {
                case FeedType.News:
                    emptyScreenControl.ImgSrc = WebImageSupplier.GetAbsoluteWebPath("150x_news.png", NewsConst.ModuleId);
                    emptyScreenControl.Header = NewsResource.EmptyScreenNewsCaption;
                    buttonLink = FeedUrls.EditNewsUrl;
                    buttonName = NewsResource.EmptyScreenNewsLink;
                    break;

                case FeedType.Order:
                    emptyScreenControl.ImgSrc = WebImageSupplier.GetAbsoluteWebPath("150x_order.png", NewsConst.ModuleId);
                    emptyScreenControl.Header = NewsResource.EmptyScreenOrdersCaption;
                    buttonLink = FeedUrls.EditOrderUrl;
                    buttonName = NewsResource.EmptyScreenOrderLink;
                    break;

                case FeedType.Advert:
                    emptyScreenControl.ImgSrc = WebImageSupplier.GetAbsoluteWebPath("150x_advert.png", NewsConst.ModuleId);
                    emptyScreenControl.Header = NewsResource.EmptyScreenAdvertsCaption;
                    buttonLink = FeedUrls.EditAdvertUrl;
                    buttonName = NewsResource.EmptyScreenAdvertLink;
                    break;

                case FeedType.Poll:
                    emptyScreenControl.ImgSrc = WebImageSupplier.GetAbsoluteWebPath("150x_poll.png", NewsConst.ModuleId);
                    emptyScreenControl.Header = NewsResource.EmptyScreenPollsCaption;
                    buttonLink = FeedUrls.EditPollUrl;
                    buttonName = NewsResource.EmptyScreenPollLink;
                    break;

                default:
                    emptyScreenControl.ImgSrc = WebImageSupplier.GetAbsoluteWebPath("150x_newslogo.png", NewsConst.ModuleId);
                    emptyScreenControl.Header = NewsResource.EmptyScreenEventsCaption;
                    buttonLink = FeedUrls.EditNewsUrl;
                    buttonName = NewsResource.EmptyScreenEventLink;
                    break;
                }

                if (CommunitySecurity.CheckPermissions(NewsConst.Action_Add) && String.IsNullOrEmpty(Request["uid"]) && String.IsNullOrEmpty(Request["search"]))
                {
                    emptyScreenControl.ButtonHTML = String.Format("<a class='linkAddMediumText' href='{0}'>{1}</a>", buttonLink, buttonName);
                }


                MessageShow.Controls.Add(emptyScreenControl);
            }
            else
            {
                const int pageSize  = 20;
                var       pageCount = (int)(feedsCount / pageSize + 1);
                if (pageCount < PageNumber)
                {
                    PageNumber = pageCount;
                }

                var feeds = !string.IsNullOrEmpty(Request["search"]) ?
                            storage.SearchFeeds(Request["search"], feedType, Info.UserId, pageSize, (PageNumber - 1) * pageSize) :
                            storage.GetFeeds(feedType, Info.UserId, pageSize, (PageNumber - 1) * pageSize);

                pgNavigator.EntryCountOnPage  = pageSize;
                pgNavigator.EntryCount        = 0 < pageCount ? (int)feedsCount : pageSize;
                pgNavigator.CurrentPageNumber = PageNumber;

                pgNavigator.ParamName = "page";
                if (!string.IsNullOrEmpty(Request["search"]))
                {
                    pgNavigator.PageUrl = string.Format(CultureInfo.CurrentCulture, "{0}?search={1}", VirtualPathUtility.ToAbsolute("~/products/community/modules/news/"), Request["search"]);
                }
                else
                {
                    pgNavigator.PageUrl = string.IsNullOrEmpty(Request["type"]) ?
                                          string.Format(CultureInfo.CurrentCulture, "{0}?{1}", VirtualPathUtility.ToAbsolute("~/products/community/modules/news/"), (string.IsNullOrEmpty(Info.UserIdAttribute) ? string.Empty : "?" + Info.UserIdAttribute.Substring(1))) :
                                          string.Format(CultureInfo.CurrentCulture, "{0}?type={1}{2}", VirtualPathUtility.ToAbsolute("~/products/community/modules/news/"), Request["type"], Info.UserIdAttribute);
                }
                FeedRepeater.DataSource = feeds;
                FeedRepeater.DataBind();
            }
        }