Exemplo n.º 1
0
        private void InjectControlPanel()
        {
            //if querystring dnnprintmode=true, controlpanel will not be shown
            if (Request.QueryString["dnnprintmode"] != "true" && Request.QueryString["popUp"] != "true" && Request.QueryString["hidecommandbar"] != "true")
            {
                if ((ControlPanelBase.IsPageAdminInternal() || ControlPanelBase.IsModuleAdminInternal()))
                {
                    //ControlPanel processing
                    var controlPanel = ControlUtilities.LoadControl <ControlPanelBase>(this, Host.ControlPanel);
                    var form         = (HtmlForm)Parent.FindControl("Form");

                    if (controlPanel.IncludeInControlHierarchy)
                    {
                        //inject ControlPanel control into skin
                        if (ControlPanel == null)
                        {
                            if (form != null)
                            {
                                form.Controls.AddAt(0, controlPanel);
                            }
                            else
                            {
                                Page.Controls.AddAt(0, controlPanel);
                            }
                        }
                        else
                        {
                            if (form != null)
                            {
                                if (Host.ControlPanel.ToLowerInvariant().EndsWith("controlbar.ascx"))
                                {
                                    form.Controls.AddAt(0, controlPanel);
                                }
                                else
                                {
                                    ControlPanel.Controls.Add(controlPanel);
                                }
                            }
                            else
                            {
                                if (Host.ControlPanel.ToLowerInvariant().EndsWith("controlbar.ascx"))
                                {
                                    Page.Controls.AddAt(0, controlPanel);
                                }
                                else
                                {
                                    ControlPanel.Controls.Add(controlPanel);
                                }
                            }
                        }

                        //register admin.css
                        ClientResourceManager.RegisterAdminStylesheet(Page, Globals.HostPath + "admin.css");
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void InjectControlPanel()
        {
            // if querystring dnnprintmode=true, controlpanel will not be shown
            if (this.Request.QueryString["dnnprintmode"] != "true" && !UrlUtils.InPopUp() && this.Request.QueryString["hidecommandbar"] != "true")
            {
                if (Host.AllowControlPanelToDetermineVisibility || (ControlPanelBase.IsPageAdminInternal() || ControlPanelBase.IsModuleAdminInternal()))
                {
                    // ControlPanel processing
                    var controlPanel = ControlUtilities.LoadControl <ControlPanelBase>(this, Host.ControlPanel);
                    var form         = (HtmlForm)this.Parent.FindControl("Form");

                    if (controlPanel.IncludeInControlHierarchy)
                    {
                        // inject ControlPanel control into skin
                        if (this.ControlPanel == null || HostController.Instance.GetBoolean("IgnoreControlPanelWrapper", false))
                        {
                            if (form != null)
                            {
                                form.Controls.AddAt(0, controlPanel);
                            }
                            else
                            {
                                this.Page.Controls.AddAt(0, controlPanel);
                            }
                        }
                        else
                        {
                            this.ControlPanel.Controls.Add(controlPanel);
                        }

                        // register admin.css
                        ClientResourceManager.RegisterAdminStylesheet(this.Page, Globals.HostPath + "admin.css");
                    }
                }
            }
        }