Exemple #1
0
        private void Control_Init()
        {
            if (DataEval.IsEmptyQuery(_css_menuid))
            {
                MultiView_Menu.SetActiveView(View_New);
            }
            else
            {
                MultiView_Menu.SetActiveView(View_Menu);

                Lib.MenuMgr myMenuMgr = new Lib.MenuMgr();

                string _pageindexid = Request.QueryString["PageIndexID"];

                if (_pageindexid == null)
                {
                    _pageindexid = "-1";
                }

                if (!_isstatic)
                {
                    _rootpageindexid = _pageindexid;
                }


                List <Lib.Menu> myMenus = myMenuMgr.Get_Menu(_rootpageindexid, _displaysamelevel, _displaycategory);

                #region Look for selected Page

                string[] Menu_cssclass = new string[myMenus.Count];

                Lib.NavigatorMgr     myNavigatorMgr = new Lib.NavigatorMgr();
                List <Lib.Navigator> myNavigators   = myNavigatorMgr.Get_Navigator(_pageindexid, _rootpageindexid);

                for (int i = 0; i < myMenus.Count; i++)
                {
                    bool _isactive = false;
                    foreach (Lib.Navigator myNavigator in myNavigators)
                    {
                        if (myMenus[i].PageIndexID == myNavigator.PageIndexID)
                        {
                            _isactive = true;
                        }
                    }

                    if (_isactive)
                    {
                        Menu_cssclass[i] = _active_cssclass;
                    }
                    else
                    {
                        Menu_cssclass[i] = _cssclass;
                    }
                }

                #endregion

                // Create Menu
                HtmlGenericControl Menu_UL = new HtmlGenericControl("ul");

                int _menu_i = 0;
                foreach (Lib.Menu myMenu in myMenus)
                {
                    HtmlGenericControl Menu_Li = new HtmlGenericControl("li");
                    Menu_Li.Attributes.Add("class", Menu_cssclass[_menu_i]);

                    HyperLink myHyperLink = new HyperLink();
                    myHyperLink.CssClass = Menu_cssclass[_menu_i];

                    myHyperLink.Text        = "<span>" + myMenu.Menu_Title + "</span>";
                    myHyperLink.NavigateUrl = myMenu.NavigateUrl;

                    if (Request.QueryString["PageLink"] == "Disable")
                    {
                        myHyperLink.Enabled = false;
                    }

                    Menu_Li.Controls.Add(myHyperLink);
                    Menu_UL.Controls.Add(Menu_Li);

                    _menu_i++;
                }

                PlaceHolder_Menu.Controls.Add(Menu_UL);
            }
        }
        private void Control_Init()
        {
            if (DataEval.IsEmptyQuery(_menuid))
            {
                MultiView_Content.SetActiveView(View_New);
            }
            else
            {
                MultiView_Content.SetActiveView(View_Show);

                Lib.MenuMgr myMenuMgr = new Lib.MenuMgr();

                string _pageindexid = Request.QueryString["PageIndexID"];

                if (_pageindexid == null)
                {
                    _pageindexid = "-1";
                }

                if (!_isstatic)
                {
                    _rootpageindexid = _pageindexid;
                }


                List <Lib.Menu> myMenus = myMenuMgr.Get_Menu(_rootpageindexid, _displaysamelevel, _displaycategory);
                RadTabStrip_Menu.DataSource    = myMenus;
                RadTabStrip_Menu.DataTextField = "Menu_Title";

                //RadTabStrip_Menu.SelectedIndex

                if (Request.QueryString["PageLink"] != "Disable")
                {
                    RadTabStrip_Menu.DataNavigateUrlField = "NavigateUrl";
                }

                RadTabStrip_Menu.DataBind();

                #region Look for selected Page

                Lib.NavigatorMgr     myNavigatorMgr = new Lib.NavigatorMgr();
                List <Lib.Navigator> myNavigators   = myNavigatorMgr.Get_Navigator(_pageindexid, _rootpageindexid);

                for (int i = 0; i < myMenus.Count; i++)
                {
                    foreach (Lib.Navigator myNavigator in myNavigators)
                    {
                        if (myMenus[i].PageIndexID == myNavigator.PageIndexID)
                        {
                            RadTabStrip_Menu.SelectedIndex = i;
                        }
                    }
                }

                #endregion

                switch (_orientation)
                {
                case "HorizontalBottom":
                    RadTabStrip_Menu.Orientation = Telerik.Web.UI.TabStripOrientation.HorizontalBottom;
                    break;

                case "HorizontalTop":
                    RadTabStrip_Menu.Orientation = Telerik.Web.UI.TabStripOrientation.HorizontalTop;
                    break;

                case "VerticalLeft":
                    RadTabStrip_Menu.Orientation = Telerik.Web.UI.TabStripOrientation.VerticalLeft;
                    break;

                case "VerticalRight":
                    RadTabStrip_Menu.Orientation = Telerik.Web.UI.TabStripOrientation.VerticalRight;
                    break;
                }

                if (_skin == "Customer")
                {
                    RadTabStrip_Menu.EnableEmbeddedSkins = false;

                    if (!DataEval.IsEmptyQuery(_cssclass))
                    {
                        RadTabStrip_Menu.CssClass = _cssclass;
                    }
                }
                else
                {
                    RadTabStrip_Menu.Skin = _skin;
                }
            }
        }
Exemple #3
0
        private void Control_Init()
        {
            if (DataEval.IsEmptyQuery(_navigatorid))
            {
                MultiView_Content.SetActiveView(View_New);
            }
            else
            {
                MultiView_Content.SetActiveView(View_Show);

                Lib.NavigatorMgr myNavigatorMgr = new Lib.NavigatorMgr();

                string _pageindexid;

                _pageindexid = Request.QueryString["PageIndexID"];

                if (_pageindexid == null)
                {
                    _pageindexid = "-1";
                }

                // Navigator Item

                List <Lib.Navigator> myNavigator = myNavigatorMgr.Get_Navigator(_pageindexid, _rootpageindexid);

                // Add Homepage Link
                if (_rootpageindexid == "-1" || DataEval.IsEmptyQuery(_rootpageindexid))
                {
                    HyperLink hlink_HomePage = new HyperLink();
                    hlink_HomePage.Text = "HomePage";

                    if (Request.QueryString["PageLink"] != "Disable")
                    {
                        hlink_HomePage.NavigateUrl = "/Default.aspx";
                    }

                    PlaceHolder_Navigator.Controls.Add(hlink_HomePage);
                }
                else
                {
                    Lib.Navigator HomeNavigator = myNavigatorMgr.Get_Navigator_Home(_rootpageindexid);

                    HyperLink hlink_HomePage = new HyperLink();
                    hlink_HomePage.Text = HomeNavigator.Menu_Title;

                    if (Request.QueryString["PageLink"] != "Disable")
                    {
                        hlink_HomePage.NavigateUrl = HomeNavigator.NavigateUrl;
                    }

                    PlaceHolder_Navigator.Controls.Add(hlink_HomePage);
                }

                // Add Navigator Link
                for (int i = 0; i < myNavigator.Count - 1; i++)
                {
                    if (_displaycategory)
                    {
                        if (myNavigator[i].IsOnNavigator)
                        {
                            // Add Navigator Sign
                            PlaceHolder_Navigator.Controls.Add(new LiteralControl(_navigatorsign));

                            // Add Navigator Link
                            HyperLink hlink_PageLink = new HyperLink();
                            hlink_PageLink.Text = myNavigator[i].Menu_Title;

                            if (Request.QueryString["PageLink"] != "Disable")
                            {
                                hlink_PageLink.NavigateUrl = myNavigator[i].NavigateUrl;
                            }

                            PlaceHolder_Navigator.Controls.Add(hlink_PageLink);
                        }
                    }
                    else
                    {
                        if (myNavigator[i].Page_Type != Core.Pages.Page_Type.Category)
                        {
                            if (myNavigator[i].IsOnNavigator)
                            {
                                // Add Navigator Sign
                                PlaceHolder_Navigator.Controls.Add(new LiteralControl(_navigatorsign));

                                // Add Navigator Link
                                HyperLink hlink_PageLink = new HyperLink();
                                hlink_PageLink.Text = myNavigator[i].Menu_Title;

                                if (Request.QueryString["PageLink"] != "Disable")
                                {
                                    hlink_PageLink.NavigateUrl = myNavigator[i].NavigateUrl;
                                }

                                PlaceHolder_Navigator.Controls.Add(hlink_PageLink);
                            }
                        }
                    }
                }

                // Add Page Name
                if (myNavigator.Count > 0)
                {
                    // Add Navigator Sign
                    PlaceHolder_Navigator.Controls.Add(new LiteralControl(_navigatorsign));

                    // Add Current Page Name
                    Literal literal_PageName = new Literal();
                    literal_PageName.Text = myNavigator[myNavigator.Count - 1].Menu_Title;

                    PlaceHolder_Navigator.Controls.Add(literal_PageName);
                }

                if (_cssclass != "Disable" || DataEval.IsEmptyQuery(_cssclass))
                {
                    Panel_Navigator.CssClass = _cssclass;
                }
            }
        }