private void Control_Init()
        {
            if (DataEval.IsEmptyQuery(_webusercontrolid))
            {
                MultiView_Content.SetActiveView(View_New);
            }
            else
            {
                if (Request.QueryString["PageLink"] != "Disable")
                {
                    if (File.Exists(HttpContext.Current.Server.MapPath(_path)))
                    {
                        Control myUserControl = Page.LoadControl(_path);
                        PlaceHolder_UserControl.Controls.Add(myUserControl);
                        MultiView_Content.SetActiveView(View_Show);
                    }
                    else
                    {
                        MultiView_Content.SetActiveView(View_New);
                    }
                }
                else
                {
                    if (File.Exists(HttpContext.Current.Server.MapPath(_path)))
                    {
                        Literal_TextContent.Text = string.Format("Customer Control: {0}", _path);
                    }
                    else
                    {
                        Literal_TextContent.Text = string.Format("Customer Control load fialed: {0}", _path);
                    }

                    MultiView_Content.SetActiveView(View_New);
                }
            }
        }
Esempio n. 2
0
        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;
                }
            }
        }
Esempio n. 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;
                }
            }
        }
Esempio n. 4
0
        private void Control_Init()
        {
            if (DataEval.IsEmptyQuery(_imageid))
            {
                MultiView_Content.SetActiveView(View_New);
            }
            else
            {
                MultiView_Content.SetActiveView(View_Show);

                HtmlImage myHtmlImage = new HtmlImage();

                if (_isshared)
                {
                    Lib.ImageMgr myImageMgr = new Lib.ImageMgr();
                    Lib.Image    myImage    = myImageMgr.Get_Image_Content(_contentid);

                    _imageurl      = myImage.ImageURL;
                    _alternatetext = myImage.AlternateText;
                    _linkurl       = myImage.LinkURL;
                    _link_target   = myImage.Link_Target;
                }

                // ImageURL

                myHtmlImage.Src = _imageurl;

                // AlternateText
                myHtmlImage.Alt = _alternatetext;

                // Image Height
                if (_height > 0)
                {
                    myHtmlImage.Height = _height;
                }

                // Image Width
                if (_width > 0)
                {
                    myHtmlImage.Width = _width;
                }

                // Image Border
                myHtmlImage.Border = _border;


                if (Request.QueryString["PageLink"] == "Disable")
                {
                    PlaceHolder_Content.Controls.Add(myHtmlImage);
                }
                else
                {
                    if (!DataEval.IsEmptyQuery(_linkurl))
                    {
                        HtmlGenericControl myLink = new HtmlGenericControl("a");
                        myLink.Attributes.Add("href", _linkurl);

                        if (!DataEval.IsEmptyQuery(_link_target))
                        {
                            myLink.Attributes.Add("target", _link_target);
                        }

                        myLink.Controls.Add(myHtmlImage);
                        PlaceHolder_Content.Controls.Add(myLink);
                    }
                    else
                    {
                        PlaceHolder_Content.Controls.Add(myHtmlImage);
                    }
                }
            }
        }