private int getPageId(string url, int siteId, int langId) { tblSites site = new tblSites(); site.LoadByPrimaryKey(siteId); tblPagesXLanguage page = new tblPagesXLanguage(); int start = url.ToLower().IndexOf(epicSiteURL.ToLower()) + epicSiteURL.Length + 7; if (getQA(url)) { start += 3; } string pageName = url.Substring(start); if (url.Contains(".aspx")) { pageName = url.Substring(start, url.IndexOf(".aspx") + 5 - start); } page.Where.PageTitle.Value = pageName; page.Where.LanguageId.Value = langId; page.Query.Load(); if (page.RowCount > 0) { page.Rewind(); return(page.PageId); } else { return(-1); } }
public void DisplayMap(int langId) { // TreeView1.Nodes.Clear(); RadTreeView1.Nodes.Clear(); tblPagesXLanguage pageL = new tblPagesXLanguage(); pageL.Where.LanguageId.Value = langId; pageL.Where.ParentPage.Value = -1; pageL.Where.ShowInCMS.Value = false; pageL.Where.ShowInCMS.Operator = MyGeneration.dOOdads.WhereParameter.Operand.NotEqual; pageL.Query.Load(); pageL.Sort = "SortOrder ASC"; tblUserPageAccess access = new tblUserPageAccess(); access.Where.UserId.Value = (int)UserContext.GetContextItemAsInt("userid"); access.Query.Load(); // find all the top level pages if (pageL.RowCount > 0) { pageL.Rewind(); do { if (pageL.ShowInCMS != false) { access.Filter = "PageXLanguageId=" + pageL.PageXLanguageId.ToString(); if (access.RowCount > 0 && access.AccessLevel == 2) { HyperLink hl = new HyperLink(); hl.Text = pageL.PageFriendlyName; RadTreeNode rtn = new RadTreeNode(); if (pageL.PageId == 103) { pageL.PageId = 105; } else if (pageL.PageId == 111) { pageL.PageId = 112; } if (hl.Text == "Contact Information") { rtn.Text = "Contact Submissions"; } else if (hl.Text == "Welcome!") { rtn.Text = "Meta Tags"; } else { rtn.Text = hl.Text; } hl.NavigateUrl = "~/admin/default.aspx?pageId=" + pageL.PageId.ToString() + "&langId=" + langId.ToString(); rtn.NavigateUrl = hl.NavigateUrl; RadTreeView1.Nodes.Add(rtn); if (rtn.Text != "About Us" && rtn.Text != "Legal Resources" && rtn.Text != "Recognition" && rtn.Text != "Clients") { rtn.CssClassSelect = "selected"; } else { rtn.CssClassSelect = "white_selected"; } if (Request["pageId"] == null) { // need to redirect //Response.Redirect(hl.NavigateUrl); rtn.Expanded = true; } else { rtn.Expanded = true; if (int.Parse(Request["pageId"]) == pageL.PageId) { rtn.Selected = true; } } hl.CssClass = "navlink"; if (Request["pageId"] != null) { if (int.Parse(Request["pageId"]) == pageL.PageId) { hl.NavigateUrl = ""; hl.CssClass = "navlinkde"; } } PlaceHolder1.Controls.Add(new LiteralControl("<div style='padding-left:0px'>")); hl.Style.Add("padding-left", "0px"); PlaceHolder1.Controls.Add(hl); PlaceHolder1.Controls.Add(new LiteralControl("</div>")); placeSubs(pageL.PageXLanguageId, langId, 1, rtn); } } }while (pageL.MoveNext()); } }
private void placeSubs(int pageId, int langId, int level, RadTreeNode rtn) { tblPagesXLanguage pageL = new tblPagesXLanguage(); pageL.Where.LanguageId.Value = langId; pageL.Where.ParentPage.Value = pageId; pageL.Query.Load(); pageL.Sort = "SortOrder ASC"; if (pageL.RowCount > 0) { tblUserPageAccess access = new tblUserPageAccess(); access.Where.UserId.Value = (int)UserContext.GetContextItemAsInt("userid"); access.Query.Load(); pageL.Rewind(); do { if (pageL.ShowInCMS != false) { access.Filter = "PageXLanguageId=" + pageL.PageXLanguageId.ToString(); if (access.RowCount > 0 && access.AccessLevel == 2) { HyperLink hl = new HyperLink(); hl.Text = pageL.PageFriendlyName; hl.NavigateUrl = "~/admin/default.aspx?pageId=" + pageL.PageId.ToString() + "&langId=" + langId.ToString(); hl.CssClass = "navlink"; //if (hl.Text.Contains("Recipes -> ")) //hl.Text.Replace("Recipes -> ", ""); if (hl.Text.Contains("About Us -> ")) { hl.Text = hl.Text.Replace("About Us -> ", ""); } if (hl.Text.Contains("Legal Resources -> ")) { hl.Text = hl.Text.Replace("Legal Resources -> ", ""); } if (hl.Text.Contains("News & Events -> ")) { hl.Text = hl.Text.Replace("News & Events -> ", ""); } if (hl.Text.Contains("Attorneys & Staff -> ")) { hl.Text = hl.Text.Replace("Attorneys & Staff -> ", ""); } if (hl.Text == "LawClips Newsletter") { hl.Text = "LawClips"; } if (hl.Text == "LawClips Newsletter -> Details") { hl.Text = "Signups"; } if (hl.Text == "Site Map") { hl.Text = "Project Spotlights"; } if (hl.Text == "History") { hl.Text = "Events Promo"; } if (hl.Text == "Our Facility") { hl.Text = "Timeline"; } if (hl.Text == "Details") { hl.Text = "Badge Images"; } RadTreeNode rcn = new RadTreeNode(hl.Text, "", hl.NavigateUrl); rcn.Expanded = true; rcn.CssClassSelect = "selected"; rtn.Nodes.Add(rcn); if (Request["pageId"] != null) { if (int.Parse(Request["pageId"]) == pageL.PageId) { rcn.Selected = true; rcn.Expanded = true; RadTreeNode tn2 = rcn.Parent; while (tn2 != null) { tn2.Expanded = true; tn2 = tn2.Parent; } hl.NavigateUrl = ""; hl.CssClass = "navlinkde"; } } Image img = new Image(); img.ImageUrl = "~/App_Images/arrow.gif"; img.Width = 10; img.Height = 10; PlaceHolder1.Controls.Add(new LiteralControl("<div style='padding-left:" + (level * 10).ToString() + "px'>")); hl.Style.Add("background-image", "url('../../App_Images/arrow.gif')"); PlaceHolder1.Controls.Add(hl); PlaceHolder1.Controls.Add(new LiteralControl("</div>")); placeSubs(pageL.PageXLanguageId, langId, level + 1, rcn); } } }while (pageL.MoveNext()); } }
public void DisplayMap(int langId) { // TreeView1.Nodes.Clear(); RadTreeView1.Nodes.Clear(); tblPagesXLanguage pageL = new tblPagesXLanguage(); pageL.Where.LanguageId.Value = langId; pageL.Where.ParentPage.Value = -1; pageL.Where.ShowInCMS.Value = false; pageL.Where.ShowInCMS.Operator = MyGeneration.dOOdads.WhereParameter.Operand.NotEqual; pageL.Query.Load(); pageL.Sort = "SortOrder ASC"; tblUserPageAccess access = new tblUserPageAccess(); access.Where.UserId.Value = (int)UserContext.GetContextItemAsInt("userid"); access.Query.Load(); // find all the top level pages if (pageL.RowCount > 0) { pageL.Rewind(); do { if (pageL.ShowInCMS != false) { access.Filter = "PageXLanguageId=" + pageL.PageXLanguageId.ToString(); if (access.RowCount > 0 && access.AccessLevel == 2) { HyperLink hl = new HyperLink(); hl.Text = pageL.PageFriendlyName; RadTreeNode rtn = new RadTreeNode(); if (pageL.PageId == 103) pageL.PageId = 105; else if (pageL.PageId == 111) pageL.PageId = 112; if (hl.Text == "Contact Information") rtn.Text = "Contact Submissions"; else if (hl.Text == "Welcome!") rtn.Text = "Meta Tags"; else rtn.Text = hl.Text; hl.NavigateUrl = "~/admin/default.aspx?pageId=" + pageL.PageId.ToString() + "&langId=" + langId.ToString(); rtn.NavigateUrl = hl.NavigateUrl; RadTreeView1.Nodes.Add(rtn); if (rtn.Text != "About Us" && rtn.Text != "Legal Resources" && rtn.Text != "Recognition" && rtn.Text != "Clients") rtn.CssClassSelect = "selected"; else rtn.CssClassSelect = "white_selected"; if (Request["pageId"] == null) { // need to redirect //Response.Redirect(hl.NavigateUrl); rtn.Expanded = true; } else { rtn.Expanded = true; if (int.Parse(Request["pageId"]) == pageL.PageId) { rtn.Selected = true; } } hl.CssClass = "navlink"; if (Request["pageId"] != null) { if (int.Parse(Request["pageId"]) == pageL.PageId) { hl.NavigateUrl = ""; hl.CssClass = "navlinkde"; } } PlaceHolder1.Controls.Add(new LiteralControl("<div style='padding-left:0px'>")); hl.Style.Add("padding-left", "0px"); PlaceHolder1.Controls.Add(hl); PlaceHolder1.Controls.Add(new LiteralControl("</div>")); placeSubs(pageL.PageXLanguageId, langId, 1, rtn); } } } while (pageL.MoveNext()); } }
private void placeSubs(int pageId, int langId, int level, RadTreeNode rtn) { tblPagesXLanguage pageL = new tblPagesXLanguage(); pageL.Where.LanguageId.Value = langId; pageL.Where.ParentPage.Value = pageId; pageL.Query.Load(); pageL.Sort = "SortOrder ASC"; if (pageL.RowCount > 0) { tblUserPageAccess access = new tblUserPageAccess(); access.Where.UserId.Value = (int)UserContext.GetContextItemAsInt("userid"); access.Query.Load(); pageL.Rewind(); do { if (pageL.ShowInCMS != false) { access.Filter = "PageXLanguageId=" + pageL.PageXLanguageId.ToString(); if (access.RowCount > 0 && access.AccessLevel == 2) { HyperLink hl = new HyperLink(); hl.Text = pageL.PageFriendlyName; hl.NavigateUrl = "~/admin/default.aspx?pageId=" + pageL.PageId.ToString() + "&langId=" + langId.ToString(); hl.CssClass = "navlink"; //if (hl.Text.Contains("Recipes -> ")) //hl.Text.Replace("Recipes -> ", ""); if (hl.Text.Contains("About Us -> ")) hl.Text = hl.Text.Replace("About Us -> ", ""); if (hl.Text.Contains("Legal Resources -> ")) hl.Text = hl.Text.Replace("Legal Resources -> ", ""); if (hl.Text.Contains("News & Events -> ")) hl.Text = hl.Text.Replace("News & Events -> ", ""); if (hl.Text.Contains("Attorneys & Staff -> ")) hl.Text = hl.Text.Replace("Attorneys & Staff -> ", ""); if (hl.Text == "LawClips Newsletter") hl.Text = "LawClips"; if (hl.Text == "LawClips Newsletter -> Details") hl.Text = "Signups"; if (hl.Text == "Site Map") hl.Text = "Project Spotlights"; if (hl.Text == "History") hl.Text = "Events Promo"; if (hl.Text == "Our Facility") hl.Text = "Timeline"; if (hl.Text == "Details") hl.Text = "Badge Images"; RadTreeNode rcn = new RadTreeNode(hl.Text, "", hl.NavigateUrl); rcn.Expanded = true; rcn.CssClassSelect = "selected"; rtn.Nodes.Add(rcn); if (Request["pageId"] != null) { if (int.Parse(Request["pageId"]) == pageL.PageId) { rcn.Selected = true; rcn.Expanded = true; RadTreeNode tn2 = rcn.Parent; while (tn2 != null) { tn2.Expanded = true; tn2 = tn2.Parent; } hl.NavigateUrl = ""; hl.CssClass = "navlinkde"; } } Image img = new Image(); img.ImageUrl = "~/App_Images/arrow.gif"; img.Width = 10; img.Height = 10; PlaceHolder1.Controls.Add(new LiteralControl("<div style='padding-left:" + (level * 10).ToString() + "px'>")); hl.Style.Add("background-image", "url('../../App_Images/arrow.gif')"); PlaceHolder1.Controls.Add(hl); PlaceHolder1.Controls.Add(new LiteralControl("</div>")); placeSubs(pageL.PageXLanguageId, langId, level + 1, rcn); } } } while (pageL.MoveNext()); } }
private void fillPages() { ViewState["_id"] = Convert.ToInt32(Request["id"]); int id = (int)ViewState["_id"]; tblLanguages langs = new tblLanguages(); langs.Where.SiteId.Value = (int)Session["siteid"]; langs.Query.Load(); do { tblPagesXLanguage lang = new tblPagesXLanguage(); lang.Where.LanguageId.Value = langs.LanguageId; lang.Where.ShowInCMS.Value = true; lang.Query.Load(); lang.Sort = "SortOrder ASC"; TableRow tr = new TableRow(); TableCell tc2 = new TableCell(); tc2.ColumnSpan = 3; Image img = new Image(); //lb.Text = langs.LanguageTitle; img.ImageUrl = epicCMSLib.Navigation.SiteRoot + "rendertext.aspx?textval=" + langs.LanguageTitle + "&fc=FF0000&bc=FFFFFF&size=16&font=Verdana&style=regular"; //tc2.Controls.Add(img); //tr.Cells.Add(tc2); Table1.Rows.Add(tr); tr = new TableRow(); if (lang.RowCount > 0) { lang.Rewind(); do { tblUserPageAccess access = new tblUserPageAccess(); CheckBox cb = new CheckBox(); cb.Text = ""; cb.ID = lang.PageXLanguageId.ToString(); if (id != null) { access.Where.PageXLanguageId.Value = lang.PageXLanguageId; access.Where.UserId.Value = id; access.Query.Load(); if (access.RowCount > 0) { access.Rewind(); if (access.AccessLevel == (int)epicCMSLib.epicCMSAccessLevels.CmsUpdate) cb.Checked = true; } } else { cb.Checked = true; } TableCell tc = new TableCell(); tc.VerticalAlign = VerticalAlign.Top; //tc.Width = 125; HyperLink lb2 = new HyperLink(); if (lang.PageFriendlyName == "Legal Resources -> LawClips Newsletter") lb2.Text = "Legal Resources -> LawClips"; else if (lang.PageFriendlyName == "Welcome!") lb2.Text = "Meta Tags"; else if (lang.PageFriendlyName == "Legal Resources -> LawClips Newsletter -> Details") lb2.Text = "Legal Resources -> LawClips -> Signups"; else if (lang.PageFriendlyName == "Contact Information") lb2.Text = "Contact Submissions"; else if (lang.PageFriendlyName == "About Us -> Our Facility") lb2.Text = "About Us -> Timeline"; else if (lang.PageFriendlyName == "Attorneys & Staff -> Details") lb2.Text = "Attorneys & Staff -> Badge Images"; else lb2.Text = lang.PageFriendlyName; lb2.NavigateUrl = epicCMSLib.Navigation.SiteRoot + langs.CultureTag + "/" + lang.PageTitle; lb2.Target = "_blank"; tc.Controls.Add(cb); tc.Controls.Add(lb2); if (lang.PageFriendlyName != "What's New" && lang.PageFriendlyName != "Products" && lang.PageFriendlyName != "Career Opportunities") tr.Cells.Add(tc); if (tr.Cells.Count > 0) { Table1.Rows.Add(tr); tr = new TableRow(); } } while (lang.MoveNext()); } if (tr.Cells.Count > 0) Table1.Rows.Add(tr); } while (langs.MoveNext()); }
private void fillPages() { ViewState["_id"] = Convert.ToInt32(Request["id"]); int id = (int)ViewState["_id"]; tblLanguages langs = new tblLanguages(); langs.Where.SiteId.Value = (int)Session["siteid"]; langs.Query.Load(); do { tblPagesXLanguage lang = new tblPagesXLanguage(); lang.Where.LanguageId.Value = langs.LanguageId; lang.Where.ShowInCMS.Value = true; lang.Query.Load(); lang.Sort = "SortOrder ASC"; TableRow tr = new TableRow(); TableCell tc2 = new TableCell(); tc2.ColumnSpan = 3; Image img = new Image(); //lb.Text = langs.LanguageTitle; img.ImageUrl = epicCMSLib.Navigation.SiteRoot + "rendertext.aspx?textval=" + langs.LanguageTitle + "&fc=FF0000&bc=FFFFFF&size=16&font=Verdana&style=regular"; //tc2.Controls.Add(img); //tr.Cells.Add(tc2); Table1.Rows.Add(tr); tr = new TableRow(); if (lang.RowCount > 0) { lang.Rewind(); do { tblUserPageAccess access = new tblUserPageAccess(); CheckBox cb = new CheckBox(); cb.Text = ""; cb.ID = lang.PageXLanguageId.ToString(); if (id != null) { access.Where.PageXLanguageId.Value = lang.PageXLanguageId; access.Where.UserId.Value = id; access.Query.Load(); if (access.RowCount > 0) { access.Rewind(); if (access.AccessLevel == (int)epicCMSLib.epicCMSAccessLevels.CmsUpdate) { cb.Checked = true; } } } else { cb.Checked = true; } TableCell tc = new TableCell(); tc.VerticalAlign = VerticalAlign.Top; //tc.Width = 125; HyperLink lb2 = new HyperLink(); if (lang.PageFriendlyName == "Legal Resources -> LawClips Newsletter") { lb2.Text = "Legal Resources -> LawClips"; } else if (lang.PageFriendlyName == "Welcome!") { lb2.Text = "Meta Tags"; } else if (lang.PageFriendlyName == "Legal Resources -> LawClips Newsletter -> Details") { lb2.Text = "Legal Resources -> LawClips -> Signups"; } else if (lang.PageFriendlyName == "Contact Information") { lb2.Text = "Contact Submissions"; } else if (lang.PageFriendlyName == "About Us -> Our Facility") { lb2.Text = "About Us -> Timeline"; } else if (lang.PageFriendlyName == "Attorneys & Staff -> Details") { lb2.Text = "Attorneys & Staff -> Badge Images"; } else { lb2.Text = lang.PageFriendlyName; } lb2.NavigateUrl = epicCMSLib.Navigation.SiteRoot + langs.CultureTag + "/" + lang.PageTitle; lb2.Target = "_blank"; tc.Controls.Add(cb); tc.Controls.Add(lb2); if (lang.PageFriendlyName != "What's New" && lang.PageFriendlyName != "Products" && lang.PageFriendlyName != "Career Opportunities") { tr.Cells.Add(tc); } if (tr.Cells.Count > 0) { Table1.Rows.Add(tr); tr = new TableRow(); } } while (lang.MoveNext()); } if (tr.Cells.Count > 0) { Table1.Rows.Add(tr); } } while (langs.MoveNext()); }
private int getPageId(string url, int siteId, int langId) { tblSites site = new tblSites(); site.LoadByPrimaryKey(siteId); tblPagesXLanguage page = new tblPagesXLanguage(); int start = url.ToLower().IndexOf(epicSiteURL.ToLower()) + epicSiteURL.Length + 7; if (getQA(url)) start += 3; string pageName = url.Substring(start); if (url.Contains(".aspx")) { pageName = url.Substring(start, url.IndexOf(".aspx") + 5 - start); } page.Where.PageTitle.Value = pageName; page.Where.LanguageId.Value = langId; page.Query.Load(); if (page.RowCount > 0) { page.Rewind(); return page.PageId; } else { return -1; } }