Exemple #1
0
        private void RegisterInitScripts()
        {
            this.RegisterLocalResources();

            ClientAPI.RegisterClientVariable(this.Page, "cem_loginurl", Globals.LoginURL(HttpContext.Current.Request.RawUrl, false), true);

            var          panes          = string.Join(",", this.PortalSettings.ActiveTab.Panes.Cast <string>());
            var          panesClientIds = this.GetPanesClientIds(this.GetPaneClientIdCollection());
            const string scriptFormat   = @"dnn.ContentEditorManager.init({{type: 'moduleManager', panes: '{0}', panesClientIds: '{2}', supportAjax: {1}}});";
            var          script         = string.Format(
                scriptFormat,
                panes,
                this.SupportAjax ? "true" : "false",
                panesClientIds);

            if (ScriptManager.GetCurrent(this.Page) != null)
            {
                // respect MS AJAX
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ContentEditorManager", script, true);
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "ContentEditorManager", script, true);
            }
        }