private void PopulateLabels() { if (siteSettings == null) { return; } Title = SiteUtils.FormatPageTitle(siteSettings, ResourceHelper.GetResourceString("ProductResources", "SearchPageTitle")); heading.Text = ResourceHelper.GetResourceString("ProductResources", "SearchPageTitle"); MetaDescription = string.Format(CultureInfo.InvariantCulture, ResourceHelper.GetResourceString("Resource", "MetaDescriptionSearchFormat"), siteSettings.SiteName); lblMessage.Text = string.Empty; btnDoSearch.Text = ResourceHelper.GetResourceString("Resource", "SearchButtonText"); btnRebuildSearchIndex.Text = ResourceHelper.GetResourceString("Resource", "SearchRebuildIndexButton"); UIHelper.AddConfirmationDialog(btnRebuildSearchIndex, ResourceHelper.GetResourceString("Resource", "SearchRebuildIndexWarning")); divDelete.Visible = (WebConfigSettings.ShowRebuildSearchIndexButtonToAdmins && WebUser.IsAdmin && ViewMode != PageViewMode.View); litAltSearchMessage.Text = ResourceHelper.GetResourceString("Resource", "AltSearchPrompt"); lnkBingSearch.Text = ResourceHelper.GetResourceString("Resource", "SearchThisSiteWithBing"); lnkBingSearch.NavigateUrl = SiteRoot + "/BingSearch.aspx"; lnkGoogleSearch.Text = ResourceHelper.GetResourceString("Resource", "SearchThisSiteWithGoogle"); lnkGoogleSearch.NavigateUrl = SiteRoot + "/GoogleSearch.aspx"; //this page has no content other than nav SiteUtils.AddNoIndexFollowMeta(Page); AddClassToBody("searchresults newssearchresults"); }
private void LoadSettings() { moduleSettings = ModuleSettings.GetModuleSettings(moduleId); config = new BlogConfiguration(moduleSettings); postList.ModuleId = moduleId; postList.PageId = pageId; postList.DisplayMode = "ByCategory"; postList.ShowFeaturedPost = false; postList.IsEditable = UserCanEditModule(moduleId, Blog.FeatureGuid); postList.Config = config; postList.SiteRoot = SiteRoot; postList.ImageSiteRoot = ImageSiteRoot; if (config.InstanceCssClass.Length > 0) { pnlOuterWrap.SetOrAppendCss(config.InstanceCssClass); } if ((CurrentPage != null) && (CurrentPage.BodyCssClass.Length > 0)) { AddClassToBody(CurrentPage.BodyCssClass); } AddClassToBody("blogviewcategory"); if (BlogConfiguration.UseNoIndexFollowMetaOnLists) { SiteUtils.AddNoIndexFollowMeta(Page); } }
private void LoadSettings() { moduleSettings = ModuleSettings.GetModuleSettings(moduleId); config = new BlogConfiguration(moduleSettings); blogModule = GetModule(moduleId, Blog.FeatureGuid); postList.ModuleId = moduleId; postList.PageId = pageId; postList.DisplayMode = "ByMonth"; postList.IsEditable = UserCanEditModule(moduleId, Blog.FeatureGuid); postList.Config = config; postList.SiteRoot = SiteRoot; postList.ImageSiteRoot = ImageSiteRoot; if (config.InstanceCssClass.Length > 0) { pnlOuterWrap.SetOrAppendCss(config.InstanceCssClass); } LoadSideContent(config.ShowLeftContent, config.ShowRightContent); LoadAltContent(BlogConfiguration.ShowTopContent, BlogConfiguration.ShowBottomContent); if ((CurrentPage != null) && (CurrentPage.BodyCssClass.Length > 0)) { AddClassToBody(CurrentPage.BodyCssClass); } AddClassToBody("blogviewarchive"); if (BlogConfiguration.UseNoIndexFollowMetaOnLists) { SiteUtils.AddNoIndexFollowMeta(Page); } }
private void LoadSettings() { siteSettings = CacheHelper.GetCurrentSiteSettings(); store = new Store(siteSettings.SiteGuid, moduleId); Settings = ModuleSettings.GetModuleSettings(moduleId); module = GetModule(moduleId); lnkCart.PageID = pageId; lnkCart.ModuleID = moduleId; enableRatingsInProductList = WebUtils.ParseBoolFromHashtable( Settings, "EnableContentRatingInProductListSetting", enableRatingsInProductList); enableRatingComments = WebUtils.ParseBoolFromHashtable( Settings, "EnableRatingCommentsSetting", enableRatingComments); offerList1.Store = store; offerList1.PageId = pageId; offerList1.ModuleId = moduleId; offerList1.SiteRoot = SiteRoot; offerList1.CurrencyCulture = currencyCulture; offerList1.EnableRatings = enableRatingsInProductList; offerList1.EnableRatingComments = enableRatingComments; offerList1.Settings = Settings; AddClassToBody("webstore webstoreofferlist"); if (WebStoreConfiguration.UseNoIndexFollowMetaOnLists) { SiteUtils.AddNoIndexFollowMeta(Page); } }
protected void Page_Load(object sender, EventArgs e) { if (!WebConfigSettings.AllowUserThreadBrowsing) { SiteUtils.RedirectToAccessDeniedPage(this); return; } LoadSettings(); AddConnoicalUrl(); //this page has no content other than nav SiteUtils.AddNoIndexFollowMeta(Page); PopulateControls(); AnalyticsSection = ConfigHelper.GetStringProperty("AnalyticsForumSection", "forums"); }
//private void AddCanonicalUrl() //{ // if (Page.Header == null) { return; } // string canonicalUrl = SiteRoot // + "/Blog/ViewList.aspx?pageid=" // + pageId.ToInvariantString() // + "&mid=" + moduleId.ToInvariantString() // + "&pagenumber=" + pageNumber.ToInvariantString(); // if (SiteUtils.IsSecureRequest() && (!CurrentPage.RequireSsl) && (!siteSettings.UseSslOnAllPages)) // { // if (WebConfigSettings.ForceHttpForCanonicalUrlsThatDontRequireSsl) // { // canonicalUrl = canonicalUrl.Replace("https:", "http:"); // } // } // Literal link = new Literal(); // link.ID = "blogcaturl"; // link.Text = "\n<link rel='canonical' href='" + canonicalUrl + "' />"; // Page.Header.Controls.Add(link); //} private void LoadSettings() { userCanEdit = UserCanEditModule(moduleId); //if (userCanEdit) { countOfDrafts = Blog.CountOfDrafts(moduleId); } if ((CurrentPage != null) && (CurrentPage.BodyCssClass.Length > 0)) { AddClassToBody(CurrentPage.BodyCssClass); } AddClassToBody("blogviewlist"); if (BlogConfiguration.UseNoIndexFollowMetaOnLists) { SiteUtils.AddNoIndexFollowMeta(Page); } }
private void LoadSettings() { timeOffset = SiteUtils.GetUserTimeOffset(); timeZone = SiteUtils.GetUserTimeZone(); //lnkAllUsers.NavigateUrl = SiteRoot + "/MemberList.aspx"; IsAdmin = WebUser.IsAdmin; canManageUsers = IsAdmin || WebUser.IsInRoles(siteSettings.RolesThatCanManageUsers); ShowEmailInMemberList = WebConfigSettings.ShowEmailInMemberList || displaySettings.ShowEmail; ShowUserIDInMemberList = WebConfigSettings.ShowUserIDInMemberList || displaySettings.ShowUserId; ShowLoginNameInMemberList = WebConfigSettings.ShowLoginNameInMemberList || displaySettings.ShowLoginName; ShowJoinDate = displaySettings.ShowJoinDate; // this can't be used in related site mode because we can't assume forum posts were in this site. //ShowForumPostColumn = WebConfigSettings.ShowForumPostsInMemberList && displaySettings.ShowForumPosts && !WebConfigSettings.UseRelatedSiteMode; allowView = WebUser.IsInRoles(siteSettings.RolesThatCanViewMemberList); pageNumber = WebUtils.ParseInt32FromQueryString("pagenumber", 1); sortMode = WebUtils.ParseInt32FromQueryString("sd", sortMode); if ((sortMode == 0) && (displaySettings.ShowFirstAndLastName)) { sortMode = 2; // lastname, firstname } if (Request.Params["letter"] != null) { filterLetter = Request.Params["letter"].Trim(); } if (Request.Params["search"] != null) { searchText = Request.Params["search"].Trim(); } ipSearchText = WebUtils.ParseStringFromQueryString("ips", ipSearchText); showLocked = WebUtils.ParseBoolFromQueryString("locked", showLocked); showUnApproved = WebUtils.ParseBoolFromQueryString("needapproval", showUnApproved); pageSize = WebConfigSettings.MemberListPageSize; //this page has no content other than nav SiteUtils.AddNoIndexFollowMeta(Page); AddClassToBody("memberlist"); }
private void PopulateLabels() { if (siteSettings == null) { return; } Title = SiteUtils.FormatPageTitle(siteSettings, Resource.SearchPageTitle); heading.Text = Resource.SearchPageTitle; MetaDescription = string.Format(CultureInfo.InvariantCulture, Resource.MetaDescriptionSearchFormat, siteSettings.SiteName); lblMessage.Text = string.Empty; divResults.Visible = true; btnDoSearch.Text = Resource.SearchButtonText; SiteUtils.SetButtonAccessKey(btnDoSearch, AccessKeys.SearchButtonTextAccessKey); btnRebuildSearchIndex.Text = Resource.SearchRebuildIndexButton; UIHelper.AddConfirmationDialog(btnRebuildSearchIndex, Resource.SearchRebuildIndexWarning); divDelete.Visible = (WebConfigSettings.ShowRebuildSearchIndexButtonToAdmins && WebUser.IsAdmin); lblNoResults.Text = Resource.SearchResultsNotFound; litAltSearchMessage.Text = Resource.AltSearchPrompt; lnkBingSearch.Text = Resource.SearchThisSiteWithBing; lnkBingSearch.NavigateUrl = SiteRoot + "/BingSearch.aspx"; lnkGoogleSearch.Text = Resource.SearchThisSiteWithGoogle; lnkGoogleSearch.NavigateUrl = SiteRoot + "/GoogleSearch.aspx"; litDatePreamble.Text = Resource.SearchDateFilterPreamble; litAnd.Text = Resource.and; //this page has no content other than nav SiteUtils.AddNoIndexFollowMeta(Page); AddClassToBody("searchresults"); }
protected void Page_Load(object sender, EventArgs e) { if ((SiteUtils.SslIsAvailable()) && ((WebConfigSettings.UseSslForSiteMap) || (siteSettings.UseSslOnAllPages))) { SiteUtils.ForceSsl(); } else { SiteUtils.ClearSsl(); } Title = SiteUtils.FormatPageTitle(siteSettings, Resource.SiteMapLink); heading.Text = Resource.SiteMapLink; //this page has no content other than nav SiteUtils.AddNoIndexFollowMeta(Page); resolveFullUrlsForMenuItemProtocolDifferences = WebConfigSettings.ResolveFullUrlsForMenuItemProtocolDifferences; if (resolveFullUrlsForMenuItemProtocolDifferences) { secureSiteRoot = WebUtils.GetSecureSiteRoot(); insecureSiteRoot = secureSiteRoot.Replace("https", "http"); } isSecureRequest = SiteUtils.IsSecureRequest(); isMobileSkin = SiteUtils.UseMobileSkin(); isAdmin = WebUser.IsAdmin; if (!isAdmin) { isContentAdmin = WebUser.IsContentAdmin; } if ((!isAdmin) && (!isContentAdmin)) { isSiteEditor = SiteUtils.UserIsSiteEditor(); } useMenuTooltipForCustomCss = StyleCombiner.UseMenuTooltipForCustomCss; MetaDescription = string.Format(CultureInfo.InvariantCulture, Resource.MetaDescriptionSiteMapFormat, siteSettings.SiteName); siteMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl("SiteMapData"); siteMapDataSource.SiteMapProvider = "mojosite" + siteSettings.SiteId.ToInvariantString(); if (Request.Params["startnode"] != null) { string startNode = Server.UrlDecode(Request.Params["startnode"]); SiteMapNode node = siteMapDataSource.Provider.FindSiteMapNode(startNode); if (node != null) { siteMapDataSource.StartingNodeUrl = startNode; } } useImagesInSiteMap = WebConfigSettings.UsePageImagesInSiteMap; AddClassToBody("sitemappage"); RenderSiteMap(); }
private void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { return; } if ((siteSettings != null) && (CurrentPage != null)) { if ((SiteUtils.SslIsAvailable()) && ((siteSettings.UseSslOnAllPages) || (CurrentPage.RequireSsl)) ) { SiteUtils.ForceSsl(); } else { SiteUtils.ClearSsl(); } } LoadParams(); if ((forum == null) || (!forumParams.ParamsAreValid)) { WebUtils.SetupRedirect(this, SiteUtils.GetCurrentPageUrl()); return; } // if we get here then the module exists on the page and matches the forum module id // so check view permission if (!UserCanViewPage(ModuleId, Forum.FeatureGuid)) { if (!Request.IsAuthenticated) { SiteUtils.RedirectToLoginPage(this); return; } else { SiteUtils.RedirectToAccessDeniedPage(this); return; } } //this page has no content other than links SiteUtils.AddNoIndexFollowMeta(Page); LoadSettings(); if ((!forum.Visible) && (!userCanEdit)) { SiteUtils.RedirectToAccessDeniedPage(this); return; } PopulateLabels(); PopulateControls(); AnalyticsSection = ConfigHelper.GetStringProperty("AnalyticsForumSection", "forums"); LoadSideContent(config.ShowLeftContent, config.ShowRightContent); LoadAltContent(ForumConfiguration.ShowTopContent, ForumConfiguration.ShowBottomContent); }
private void LoadSettings() { timeOffset = SiteUtils.GetUserTimeOffset(); timeZone = SiteUtils.GetUserTimeZone(); //lnkAllUsers.NavigateUrl = SiteRoot + "/MemberList.aspx"; IsAdmin = WebUser.IsAdmin; ShowEmailInMemberList = WebConfigSettings.ShowEmailInMemberList || displaySettings.ShowEmail; ShowUserIDInMemberList = WebConfigSettings.ShowUserIDInMemberList || displaySettings.ShowUserId; ShowLoginNameInMemberList = WebConfigSettings.ShowLoginNameInMemberList || displaySettings.ShowLoginName; ShowJoinDate = displaySettings.ShowJoinDate; // this can't be used in related site mode because we can't assume forum posts were in this site. //ShowForumPostColumn = WebConfigSettings.ShowForumPostsInMemberList && displaySettings.ShowForumPosts && !WebConfigSettings.UseRelatedSiteMode; allowView = WebUser.IsInRoles(siteSettings.RolesThatCanViewMemberList); //if (IsAdmin || WebUser.IsInRoles(siteSettings.RolesThatCanManageUsers)) //{ // canManageUsers = true; // fgpOtherActions.Visible = true; //} //if (canManageUsers || WebUser.IsInRoles(siteSettings.RolesThatCanCreateUsers)) //{ // fgpOtherActions.Controls.Add(new Literal // { // Text = string.Format(displaySettings.NewUserLinkFormat, SiteRoot + "/Admin/ManageUsers.aspx?userId=-1", Resource.MemberListAddUserTooltip, Resource.MemberListAddUserLabel) // }); //} //if (canManageUsers) // { // fgpIPSearch.Visible = true; // fgpOtherActions.Controls.Add(new Literal // { // Text = string.Format(displaySettings.LockedUsersLinkFormat, SiteRoot + "/MemberList.aspx?locked=true", Resource.ShowLockedOutUsersTooltip, Resource.ShowLockedOutUsers) // }); //} //if (canManageUsers && siteSettings.RequireApprovalBeforeLogin) //{ // fgpOtherActions.Controls.Add(new Literal // { // Text = string.Format(displaySettings.UnapprovedUsersLinkFormat, SiteRoot + "/MemberList.aspx?needapproval=true", Resource.ShowNotApprovedUsersTooltip, Resource.ShowNotApprovedUsers) // }); //} pageNumber = WebUtils.ParseInt32FromQueryString("pagenumber", 1); sortMode = WebUtils.ParseInt32FromQueryString("sd", sortMode); if ((sortMode == 0) && (displaySettings.ShowFirstAndLastName)) { sortMode = 2; // lastname, firstname } if (Request.Params["letter"] != null) { filterLetter = Request.Params["letter"].Trim(); } if (Request.Params["search"] != null) { searchText = Request.Params["search"].Trim(); } ipSearchText = WebUtils.ParseStringFromQueryString("ips", ipSearchText); showLocked = WebUtils.ParseBoolFromQueryString("locked", showLocked); showUnApproved = WebUtils.ParseBoolFromQueryString("needapproval", showUnApproved); //if (showLocked || showUnApproved || !string.IsNullOrWhiteSpace(searchText) || !string.IsNullOrWhiteSpace(userNameBeginsWith)) //{ // fgpOtherActions.Controls.Add(new Literal // { // Text = string.Format(displaySettings.ShowAllUsersLinkFormat, SiteRoot + "/MemberList.aspx", Resource.MemberListShowAllTooltip, Resource.MemberListShowAllLabel) // }); //} pageSize = WebConfigSettings.MemberListPageSize; //mojoProfileConfiguration profileConfig = mojoProfileConfiguration.GetConfig(); //if (profileConfig != null) //{ // if (profileConfig.Contains("WebSiteUrl")) // { // mojoProfilePropertyDefinition webSiteUrlProperty = profileConfig.GetPropertyDefinition("WebSiteUrl"); // if( // (webSiteUrlProperty.OnlyVisibleForRoles.Length == 0) // || (WebUser.IsInRoles(webSiteUrlProperty.OnlyVisibleForRoles)) // ) // { // ShowWebSiteColumn = true; // } // } //} // displaySettings can be configured from theme.skin //if (displaySettings.HideWebSiteColumn) { ShowWebSiteColumn = false; } //if(displaySettings.TableCssClass.Length > 0) //{ // tableClassMarkup = " class='" + displaySettings.TableCssClass + "'"; //} //tableAttributes = displaySettings.TableAttributes; //if (!ShowWebSiteColumn) { thWebLink.Visible = false; } //if (!ShowJoinDate) { thJoinDate.Visible = false; } //if (IsAdmin) { pnlAdminCrumbs.Visible = true; } //if (!ShowForumPostColumn) { thForumPosts.Visible = false; } //this page has no content other than nav SiteUtils.AddNoIndexFollowMeta(Page); AddClassToBody("memberlist"); //if (displaySettings.TableCssClass == "jqtable") //{ // ScriptConfig.IncludeJQTable = true; //} }
private void LoadSettings() { timeOffset = SiteUtils.GetUserTimeOffset(); timeZone = SiteUtils.GetUserTimeZone(); //lnkAllUsers.NavigateUrl = SiteRoot + "/MemberList.aspx"; IsAdmin = WebUser.IsAdmin; ShowEmailInMemberList = WebConfigSettings.ShowEmailInMemberList || displaySettings.ShowEmail; ShowUserIDInMemberList = WebConfigSettings.ShowUserIDInMemberList || displaySettings.ShowUserId; ShowLoginNameInMemberList = WebConfigSettings.ShowLoginNameInMemberList || displaySettings.ShowLoginName; ShowJoinDate = displaySettings.ShowJoinDate; // this can't be used in related site mode because we can't assume forum posts were in this site. ShowForumPostColumn = WebConfigSettings.ShowForumPostsInMemberList && displaySettings.ShowForumPosts && !WebConfigSettings.UseRelatedSiteMode; allowView = WebUser.IsInRoles(siteSettings.RolesThatCanViewMemberList); if ((IsAdmin) || (WebUser.IsInRoles(siteSettings.RolesThatCanManageUsers))) { canManageUsers = true; spnIPLookup.Visible = true; btnFindLocked.Visible = true; } btnFindNotApproved.Visible = canManageUsers && siteSettings.RequireApprovalBeforeLogin; if (canManageUsers || WebUser.IsInRoles(siteSettings.RolesThatCanCreateUsers)) { lnkNewUser.Visible = true; lnkNewUser.Text = Resource.MemberListAddUserLabel; lnkNewUser.NavigateUrl = SiteRoot + "/Admin/ManageUsers.aspx?userId=-1"; } pageNumber = WebUtils.ParseInt32FromQueryString("pagenumber", 1); sortMode = WebUtils.ParseInt32FromQueryString("sd", sortMode); if ((sortMode == 0) && (displaySettings.ShowFirstAndLastName)) { sortMode = 2; // lastname, firstname } if (Request.Params["letter"] != null) { userNameBeginsWith = Request.Params["letter"].Trim(); } if (Request.Params["search"] != null) { searchText = Request.Params["search"].Trim(); } showLocked = WebUtils.ParseBoolFromQueryString("locked", showLocked); showUnApproved = WebUtils.ParseBoolFromQueryString("needapproval", showUnApproved); pageSize = WebConfigSettings.MemberListPageSize; mojoProfileConfiguration profileConfig = mojoProfileConfiguration.GetConfig(); if (profileConfig != null) { if (profileConfig.Contains("WebSiteUrl")) { mojoProfilePropertyDefinition webSiteUrlProperty = profileConfig.GetPropertyDefinition("WebSiteUrl"); if ( (webSiteUrlProperty.OnlyVisibleForRoles.Length == 0) || (WebUser.IsInRoles(webSiteUrlProperty.OnlyVisibleForRoles)) ) { ShowWebSiteColumn = true; } } } // displaySettings can be configured from theme.skin if (displaySettings.HideWebSiteColumn) { ShowWebSiteColumn = false; } if (displaySettings.TableCssClass.Length > 0) { tableClassMarkup = " class='" + displaySettings.TableCssClass + "'"; } tableAttributes = displaySettings.TableAttributes; if (!ShowWebSiteColumn) { thWebLink.Visible = false; } if (!ShowJoinDate) { thJoinDate.Visible = false; } if (IsAdmin) { pnlAdminCrumbs.Visible = true; } if (!ShowForumPostColumn) { thForumPosts.Visible = false; } //this page has no content other than nav SiteUtils.AddNoIndexFollowMeta(Page); AddClassToBody("memberlist"); if (displaySettings.TableCssClass == "jqtable") { ScriptConfig.IncludeJQTable = true; } }