Beispiel #1
0
    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);
        }
    }
Beispiel #2
0
    private void placeData()
    {
        tblLanguages lang = new tblLanguages();

        lang.Where.SiteId.Value = Int32.Parse(Request["siteId"]);
        lang.Query.Load();

        do
        {
            tblPagesXLanguage pxl = new tblPagesXLanguage();
            pxl.Where.LanguageId.Value = lang.LanguageId;
            pxl.Sort = "SortOrder ASC";

            pxl.Query.Load();

            do
            {
                tblPageXControl pxc = new tblPageXControl();
                pxc.Where.PageId.Value = pxl.PageId;

                pxc.Query.Load();

                pxc.Sort = "CmsSortOrder ASC";

                if (pxc.RowCount > 0)
                {
                    pxc.Rewind();
                    do
                    {
                        tblControls ctls = new tblControls();
                        ctls.LoadByPrimaryKey(pxc.ControlId);

                        HyperLink hl = new HyperLink();
                        hl.Text = ctls.ControlFriendlyName;

                        PlaceHolder1.Controls.Add(hl);
                    } while (pxc.MoveNext());
                }
            } while (pxl.MoveNext());
        } while (lang.MoveNext());
    }
    private void placeData()
    {
        tblLanguages lang = new tblLanguages();
        lang.Where.SiteId.Value = Int32.Parse(Request["siteId"]);
        lang.Query.Load();

        do
        {
            tblPagesXLanguage pxl = new tblPagesXLanguage();
            pxl.Where.LanguageId.Value = lang.LanguageId;
            pxl.Sort = "SortOrder ASC";

            pxl.Query.Load();

            do
            {
                tblPageXControl pxc = new tblPageXControl();
                pxc.Where.PageId.Value = pxl.PageId;

                pxc.Query.Load();

                pxc.Sort = "CmsSortOrder ASC";

                if (pxc.RowCount > 0)
                {
                    pxc.Rewind();
                    do
                    {
                        tblControls ctls = new tblControls();
                        ctls.LoadByPrimaryKey(pxc.ControlId);

                        HyperLink hl = new HyperLink();
                        hl.Text = ctls.ControlFriendlyName;

                        PlaceHolder1.Controls.Add(hl);
                    } while (pxc.MoveNext());
                }
            } while (pxl.MoveNext());
        } while (lang.MoveNext());
    }
Beispiel #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            int?ul = UserContext.GetContextItemAsInt("userlevel");
            if (ul == null)
            {
                CmsNav1.Visible = false;
            }

            if (Request["langid"] != null)
            {
                string pg = "";
                if (Request["pageid"] != null)
                {
                    tblPagesXLanguage pgs = new tblPagesXLanguage();
                    pgs.Where.LanguageId.Value = Convert.ToInt32(Request["langid"]);
                    pgs.Where.PageId.Value     = Convert.ToInt32(Request["pageid"]);
                    pgs.Query.Load();

                    pg = pgs.PageTitle;
                }

                hlQA.NavigateUrl   = epicCMSLib.Navigation.SiteRootQA + pg;
                hlLive.NavigateUrl = epicCMSLib.Navigation.SiteRootLang + pg;
            }
            else
            {
                hlQA.Visible   = false;
                hlLive.Visible = false;
                lblSpc.Visible = false;
            }
        }
        catch (Exception ex)
        {
            Response.Redirect("/admin/login.aspx");
        }
    }
Beispiel #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            int? ul = UserContext.GetContextItemAsInt("userlevel");
            if (ul == null)
                CmsNav1.Visible = false;

            if (Request["langid"] != null)
            {
                string pg = "";
                if (Request["pageid"] != null)
                {
                    tblPagesXLanguage pgs = new tblPagesXLanguage();
                    pgs.Where.LanguageId.Value = Convert.ToInt32(Request["langid"]);
                    pgs.Where.PageId.Value = Convert.ToInt32(Request["pageid"]);
                    pgs.Query.Load();

                    pg = pgs.PageTitle;
                }

                hlQA.NavigateUrl = epicCMSLib.Navigation.SiteRootQA + pg;
                hlLive.NavigateUrl = epicCMSLib.Navigation.SiteRootLang + pg;
            }
            else
            {
                hlQA.Visible = false;
                hlLive.Visible = false;
                lblSpc.Visible = false;
            }
        }
        catch (Exception ex)
        {
            Response.Redirect("/admin/login.aspx");
        }
    }
Beispiel #6
0
    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());
        }
    }
Beispiel #7
0
    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());
        }
    }
Beispiel #8
0
    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());
        }
    }
Beispiel #9
0
    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());
            }
    }
Beispiel #10
0
    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());
    }
Beispiel #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int? ul = UserContext.GetContextItemAsInt("userlevel");
        if (ul != null)
        {
            //nav.Visible = true;
            if (ul > 2)
            {
                hlUser.Visible = false;
                hlImage.Visible = false;
                //hlMovie.Visible = false;
                hlDocs.Visible = false;
                hlPage.Visible = false;
                tdSpc0.Visible = false;
                tdSpc1.Visible = false;
                tdSpc2.Visible = false;
                //tdSpc3.Visible = false;
                tdSpc4.Visible = false;
                tdSpc5.Visible = false;
                tdSpc6.Visible = false;
            }
            else
            {
                if (ul <= 2)
                {
                    hlUser.HRef = "~/admin/default.aspx?pg=user";
                    hlImage.HRef = "~/admin/default.aspx?pg=image";
                    //hlMovie.HRef = "~/admin/default.aspx?pg=movie";
                    hlDocs.HRef = "~/admin/default.aspx?pg=docs";
                    hlAudio.HRef = "~/admin/default.aspx?pg=audio";
                    hlPodcasts.HRef = "~/admin/default.aspx?pg=podcasts";
                }

                tblPagesXLanguage pageL = new tblPagesXLanguage();
                pageL.Where.LanguageId.Value = epicShared.GetLanguageId();
                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)
                {

                    if (pageL.ShowInCMS != false)
                    {
                        access.Filter = "PageXLanguageId=" + pageL.PageXLanguageId.ToString();
                        if (access.RowCount > 0 && (access.AccessLevel <= 2))
                        {

                            hlPage.HRef = "~/admin/default.aspx?pg=welcome&langId=" + epicShared.GetLanguageId();

                        }
                    }

                }
            }
        }
    }
Beispiel #12
0
    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());
    }
Beispiel #13
0
    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;
        }
    }
Beispiel #14
0
    protected void Page_PreInit(object sender, EventArgs e)
    {
        if (Request["pg"] != null)
        {
            if (int.Parse(Request["pg"]) > -1)
            {
                // first, grab the pageID
                int page = Int32.Parse(Request["pg"]);

                // then site id
                int site = Int32.Parse(Request["siteId"]);

                tblPages pages = new tblPages();
                pages.Where.PageId.Value = page;

                pages.Query.Load();

                tblMasterPages master = new tblMasterPages();
                master.LoadByPrimaryKey(pages.MasterPageId);

                Page.MasterPageFile = "~/App_MasterPages/" + master.MasterPageTitle;

                // find the place holders
                tblContentPanes panes = new tblContentPanes();
                panes.Where.MasterPageId.Value = pages.MasterPageId;
                panes.Query.Load();

                do
                {
                    tblPageXControl pgx = new tblPageXControl();

                    pgx.Where.PageId.Value = page;
                    pgx.Where.ContentPaneId.Value = panes.ContentPaneId;

                    pgx.Query.Load();

                    if (pgx.RowCount > 0)
                    {
                        pgx.Rewind();
                        do
                        {
                            ContentPlaceHolder ph1 = (ContentPlaceHolder)Master.FindControl(panes.ContentPaneTitle);

                            tblControls control = new tblControls();
                            control.LoadByPrimaryKey(pgx.ControlId);
                           ph1.Controls.Add(Page.LoadControl("~/App_Controls/" + control.ControlLocation));
                        } while (pgx.MoveNext());
                    }
                } while (panes.MoveNext());

                tblSites ts = new tblSites();
                ts.LoadByPrimaryKey(site);
                tblPagesXLanguage pg = new tblPagesXLanguage();
                pg.Where.PageId.Value = page;
                pg.Where.LanguageId.Value = Convert.ToInt32(Request["langid"]);
                pg.Query.Load();

                Page.Title = ts.SiteTitle + " - " + pg.PageFriendlyName;
            }
        }
    }
Beispiel #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int?ul = UserContext.GetContextItemAsInt("userlevel");

        if (ul != null)
        {
            //nav.Visible = true;
            if (ul > 2)
            {
                hlUser.Visible  = false;
                hlImage.Visible = false;
                //hlMovie.Visible = false;
                hlDocs.Visible = false;
                hlPage.Visible = false;
                tdSpc0.Visible = false;
                tdSpc1.Visible = false;
                tdSpc2.Visible = false;
                //tdSpc3.Visible = false;
                tdSpc4.Visible = false;
                tdSpc5.Visible = false;
                tdSpc6.Visible = false;
            }
            else
            {
                if (ul <= 2)
                {
                    hlUser.HRef  = "~/admin/default.aspx?pg=user";
                    hlImage.HRef = "~/admin/default.aspx?pg=image";
                    //hlMovie.HRef = "~/admin/default.aspx?pg=movie";
                    hlDocs.HRef     = "~/admin/default.aspx?pg=docs";
                    hlAudio.HRef    = "~/admin/default.aspx?pg=audio";
                    hlPodcasts.HRef = "~/admin/default.aspx?pg=podcasts";
                }

                tblPagesXLanguage pageL = new tblPagesXLanguage();
                pageL.Where.LanguageId.Value   = epicShared.GetLanguageId();
                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)
                {
                    if (pageL.ShowInCMS != false)
                    {
                        access.Filter = "PageXLanguageId=" + pageL.PageXLanguageId.ToString();
                        if (access.RowCount > 0 && (access.AccessLevel <= 2))
                        {
                            hlPage.HRef = "~/admin/default.aspx?pg=welcome&langId=" + epicShared.GetLanguageId();
                        }
                    }
                }
            }
        }
    }
Beispiel #16
0
    protected void Page_PreInit(object sender, EventArgs e)
    {
        if (Request["pg"] != null)
        {
            if (int.Parse(Request["pg"]) > -1)
            {
                // first, grab the pageID
                int page = Int32.Parse(Request["pg"]);

                // then site id
                int site = Int32.Parse(Request["siteId"]);

                tblPages pages = new tblPages();
                pages.Where.PageId.Value = page;

                pages.Query.Load();

                tblMasterPages master = new tblMasterPages();
                master.LoadByPrimaryKey(pages.MasterPageId);

                Page.MasterPageFile = "~/App_MasterPages/" + master.MasterPageTitle;

                // find the place holders
                tblContentPanes panes = new tblContentPanes();
                panes.Where.MasterPageId.Value = pages.MasterPageId;
                panes.Query.Load();

                do
                {
                    tblPageXControl pgx = new tblPageXControl();

                    pgx.Where.PageId.Value        = page;
                    pgx.Where.ContentPaneId.Value = panes.ContentPaneId;

                    pgx.Query.Load();

                    if (pgx.RowCount > 0)
                    {
                        pgx.Rewind();
                        do
                        {
                            ContentPlaceHolder ph1 = (ContentPlaceHolder)Master.FindControl(panes.ContentPaneTitle);

                            tblControls control = new tblControls();
                            control.LoadByPrimaryKey(pgx.ControlId);
                            ph1.Controls.Add(Page.LoadControl("~/App_Controls/" + control.ControlLocation));
                        } while (pgx.MoveNext());
                    }
                } while (panes.MoveNext());

                tblSites ts = new tblSites();
                ts.LoadByPrimaryKey(site);
                tblPagesXLanguage pg = new tblPagesXLanguage();
                pg.Where.PageId.Value     = page;
                pg.Where.LanguageId.Value = Convert.ToInt32(Request["langid"]);
                pg.Query.Load();

                Page.Title = ts.SiteTitle + " - " + pg.PageFriendlyName;
            }
        }
    }