Пример #1
0
        /// <summary>
        /// Handles the loading of the module setting for this control
        /// </summary>
        public override void LoadSettings()
        {
            try {
                if (AJAX.IsInstalled())
                {
                    AJAX.RegisterScriptManager();
                }

                if (!IsPostBack)
                {
                    if (!Null.IsNull(Settings.EmployeeID))
                    {
                        comboEmployees.SelectByValue(Settings.EmployeeID);
                    }
                    else
                    {
                        comboEmployees.SelectedIndex = 0;
                    }

                    checkAutoTitle.Checked       = Settings.AutoTitle;
                    checkShowCurrentUser.Checked = Settings.ShowCurrentUser;
                    textPhotoWidth.Text          = Settings.PhotoWidth.ToString();
                }
            }
            catch (Exception ex) {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
Пример #2
0
        private void LoadUpdatePanel()
        {
            AJAX.RegisterScriptManager();
            ScriptManager scriptManager = AJAX.GetScriptManager(this.Page);

            if (scriptManager != null)
            {
                scriptManager.EnablePartialRendering = true;
            }
            UpdatePanel updatePanel = new UpdatePanel();

            updatePanel.UpdateMode = UpdatePanelUpdateMode.Conditional;
            updatePanel.ID         = _Control.ID + "_UP";
            Control objContentTemplateContainer = updatePanel.ContentTemplateContainer;

            InjectMessageControl(objContentTemplateContainer);
            objContentTemplateContainer.Controls.Add(_Control);
            InjectModuleContent(updatePanel);
            System.Web.UI.WebControls.Image objImage = new System.Web.UI.WebControls.Image();
            objImage.ImageUrl      = "~/images/progressbar.gif";
            objImage.AlternateText = "ProgressBar";

            UpdateProgress updateProgress = new UpdateProgress();

            updateProgress.AssociatedUpdatePanelID = updatePanel.ID;
            updateProgress.ID = updatePanel.ID + "_Prog";
            updateProgress.ProgressTemplate = new UI.WebControls.LiteralTemplate(objImage);
            this.Controls.Add(updateProgress);
        }
Пример #3
0
        protected override void OnInit(EventArgs e)
        {
            this.Load += this.Page_Load;

            // LoadControlType();
            base.OnInit(e);

            // System.InvalidOperationException: The EnableScriptGlobalization property cannot be changed during async postbacks or after the Init event.
            if (!this.IsPostBack && AJAX.IsInstalled())
            {
                AJAX.RegisterScriptManager();
                var scriptManager = AJAX.GetScriptManager(this.Page);
                scriptManager.EnableScriptGlobalization = true;
                scriptManager.EnableScriptLocalization  = true;
            }

            this.teDescription.Width  = this.ItemEditDescriptionWidth;
            this.teDescription.Height = this.ItemEditDescriptionHeight;

            if (Engage.Utility.HasValue(this.VersionInfoObject.Url))
            {
                this.ctlUrlSelection.Url     = this.VersionInfoObject.Url;
                this.chkNewWindow.Checked    = this.VersionInfoObject.NewWindow;
                this.pnlUrlSelection.Visible = true;
                this.chkUrlSelection.Checked = true;
                this.UseUrls = true;
            }

            // TODO: should we allow NewWindow to work even if the URL option isn't chosen
        }
Пример #4
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init"/> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param>
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            this.RegisterScripts();
            if (AJAX.IsInstalled())
            {
                AJAX.RegisterScriptManager();
            }
        }
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init"/> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param>
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            Load += Page_Load;
            btnConfigure.Click += BtnConfigureClick;
            ddlChooseDisplayType.SelectedIndexChanged += DdlChooseDisplayTypeSelectedIndexChanged;

            if (AJAX.IsInstalled())
            {
                AJAX.RegisterScriptManager();
            }
        }
Пример #6
0
        /// <summary>
        /// Handles the Page_Load event.
        /// </summary>
        /// <param name="e">Event arguments.</param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (EnableAjax && AJAX.IsInstalled())
            {
                AJAX.RegisterScriptManager();
            }

            try
            {
                if (!IsPostBack)
                {
                    // load the data into the control the first time we hit this page

                    // check we have an item to lookup
                    if (ItemId != null)
                    {
                        // load the item
                        var item = GetItemWithDependencies(ItemId.Value);

                        if (item != null && CanEditItem(item))
                        {
                            ButtonDelete.Visible = CanDeleteItem(item);
                            LoadItem(item);
                        }
                        else
                        {
                            Response.Redirect(Globals.NavigateURL(), true);
                        }
                    }
                    else
                    {
                        ButtonDelete.Visible = false;
                        if (ModuleAuditControl != null)
                        {
                            ModuleAuditControl.Visible = false;
                        }

                        LoadNewItem();
                    }
                }
                else
                {
                    PostBack();
                }
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
        public static void RegisterScripts(Page page, Control ctl)
        {
            const string scriptKey = "initTriState";

            if (!ClientAPI.IsClientScriptBlockRegistered(page, scriptKey))
            {
                AJAX.RegisterScriptManager();
                JavaScript.RequestRegistration(CommonJs.jQuery);
                ClientAPI.RegisterClientScriptBlock(page, "dnn.permissiontristate.js");

                ClientAPI.RegisterStartUpScript(page, scriptKey, "<script type='text/javascript'>" + GetInitScript(ctl) + "</script>");
            }
        }
Пример #8
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            this.Load += this.ItemDisplayOptionsLoad;

            var moduleCssUrl = this.ResolveUrl("Module.css");

            PageBase.RegisterStyleSheet(this.Page, moduleCssUrl, true);

            if (AJAX.IsInstalled())
            {
                AJAX.RegisterScriptManager();
            }
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            languagesComboBox.ModeChanged        += languagesComboBox_ModeChanged;
            languagesGrid.ItemDataBound          += languagesGrid_ItemDataBound;
            languagesGrid.PreRender              += languagesGrid_PreRender;
            updateButton.Click                   += updateButton_Click;
            cmdDisableLocalization.Click         += cmdDisableLocalization_Click;
            cmdEnableLocalizedContent.NavigateUrl = ModuleContext.NavigateUrl(ModuleContext.TabId, "EnableContent", false, "mid=" + ModuleContext.ModuleId);

            AJAX.RegisterScriptManager();
            JavaScript.RequestRegistration(CommonJs.jQuery);
        }
Пример #10
0
        /// <summary>
        /// LoadUpdatePanel optionally loads an AJAX Update Panel
        /// </summary>
        /// <history>
        ///     [cnurse]	12/16/2007	Created
        /// </history>
        /// -----------------------------------------------------------------------------
        private void LoadUpdatePanel()
        {
            //register AJAX
            AJAX.RegisterScriptManager();

            //enable Partial Rendering
            var scriptManager = AJAX.GetScriptManager(Page);

            if (scriptManager != null)
            {
                scriptManager.EnablePartialRendering = true;
            }

            //create update panel
            var updatePanel = new UpdatePanel
            {
                UpdateMode = UpdatePanelUpdateMode.Conditional,
                ID         = _control.ID + "_UP"
            };

            //get update panel content template
            var templateContainer = updatePanel.ContentTemplateContainer;

            //inject a message placeholder for common module messaging - UI.Skins.Skin.AddModuleMessage
            InjectMessageControl(templateContainer);

            //inject module into update panel content template
            templateContainer.Controls.Add(_control);

            //inject the update panel into the panel
            InjectModuleContent(updatePanel);

            //create image for update progress control
            var image = new Image
            {
                ImageUrl      = "~/images/progressbar.gif",            //hardcoded
                AlternateText = "ProgressBar"
            };

            //inject updateprogress into the panel
            var updateProgress = new UpdateProgress
            {
                AssociatedUpdatePanelID = updatePanel.ID,
                ID = updatePanel.ID + "_Prog",
                ProgressTemplate = new LiteralTemplate(image)
            };

            Controls.Add(updateProgress);
        }
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init"/> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param>
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            this.Load += this.Page_Load;
            this.btnConfigure.Click += this.BtnConfigureClick;
            this.ddlChooseDisplayType.SelectedIndexChanged += this.DdlChooseDisplayTypeSelectedIndexChanged;

            var moduleCssUrl = this.ResolveUrl("Module.css");

            PageBase.RegisterStyleSheet(this.Page, moduleCssUrl, true);

            if (AJAX.IsInstalled())
            {
                AJAX.RegisterScriptManager();
            }
        }
Пример #12
0
        /// <summary>
        /// LoadUpdatePanel optionally loads an AJAX Update Panel
        /// </summary>
        private void LoadUpdatePanel()
        {
            //register AJAX
            AJAX.RegisterScriptManager();

            //enable Partial Rendering
            var scriptManager = AJAX.GetScriptManager(Page);

            if (scriptManager != null)
            {
                scriptManager.EnablePartialRendering = true;
            }

            //create update panel
            var updatePanel = new UpdatePanel
            {
                UpdateMode = UpdatePanelUpdateMode.Conditional,
                ID         = _control.ID + "_UP"
            };

            //get update panel content template
            var templateContainer = updatePanel.ContentTemplateContainer;

            //inject a message placeholder for common module messaging - UI.Skins.Skin.AddModuleMessage
            InjectMessageControl(templateContainer);

            //inject module into update panel content template
            templateContainer.Controls.Add(_control);

            //inject the update panel into the panel
            InjectModuleContent(updatePanel);

            //create image for update progress control
            var progressTemplate = "<div class=\"dnnLoading dnnPanelLoading\"></div>";

            //inject updateprogress into the panel
            var updateProgress = new UpdateProgress
            {
                AssociatedUpdatePanelID = updatePanel.ID,
                ID = updatePanel.ID + "_Prog",

                ProgressTemplate = new LiteralTemplate(progressTemplate)
            };

            Controls.Add(updateProgress);
        }
Пример #13
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            jQuery.RequestRegistration();
            AJAX.RegisterScriptManager();

            cboSearchEngine.SelectedIndexChanged += OnSearchEngineIndexChanged;
            grdProviders.UpdateCommand           += ProvidersUpdateCommand;
            grdProviders.ItemCommand             += ProvidersItemCommand;
            lnkResetCache.Click   += OnResetCacheClick;
            lnkSaveAll.Click      += OnSaveAllClick;
            cmdVerification.Click += OnVerifyClick;
            try
            {
                if (Page.IsPostBack == false)
                {
                    LoadConfiguration();

                    if (IsChildPortal(PortalSettings, Context))
                    {
                        lnkSiteMapUrl.Text = Globals.AddHTTP(Globals.GetDomainName(Request)) + @"/SiteMap.aspx?portalid=" + PortalId;
                    }
                    else
                    {
                        lnkSiteMapUrl.Text = Globals.AddHTTP(PortalSettings.PortalAlias.HTTPAlias) + @"/SiteMap.aspx";
                    }

                    lnkSiteMapUrl.NavigateUrl = lnkSiteMapUrl.Text;

                    BindProviders();
                    SetSearchEngineSubmissionURL();
                }

                GrdProvidersNeedDataSorce();

                grdProviders.NeedDataSource += OnGridNeedDataSource;
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            JavaScript.RequestRegistration(CommonJs.jQuery);
            AJAX.RegisterScriptManager();

            cboSearchEngine.SelectedIndexChanged += OnSearchEngineIndexChanged;
            grdProviders.UpdateCommand           += ProvidersUpdateCommand;
            grdProviders.ItemCommand             += ProvidersItemCommand;
            lnkResetCache.Click   += OnResetCacheClick;
            lnkSaveAll.Click      += OnSaveAllClick;
            cmdVerification.Click += OnVerifyClick;
            try
            {
                if (Page.IsPostBack == false)
                {
                    LoadConfiguration();

                    string portalAlias = !String.IsNullOrEmpty(PortalSettings.DefaultPortalAlias)
                                        ? PortalSettings.DefaultPortalAlias
                                        : PortalSettings.PortalAlias.HTTPAlias;
                    lnkSiteMapUrl.Text = Globals.AddHTTP(portalAlias) + @"/SiteMap.aspx";

                    lnkSiteMapUrl.NavigateUrl = lnkSiteMapUrl.Text;

                    BindProviders();
                    SetSearchEngineSubmissionURL();
                }

                GrdProvidersNeedDataSorce();

                grdProviders.NeedDataSource += OnGridNeedDataSource;
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Пример #15
0
        /// <summary>
        /// The initialize component.
        /// </summary>
        private void InitializeComponent()
        {
            if (AJAX.IsInstalled())
            {
                AJAX.RegisterScriptManager();
            }

            this.forum1 = new Forum();

            this.pnlModuleContent.Controls.Add(this.forum1);

            this.Load += this.DotNetNukeModule_Load;
            this.forum1.PageTitleSet += this.Forum1_PageTitleSet;

            // This will create an error if there is no setting for forumboardid
            if (this.Settings["forumboardid"] != null)
            {
                this.forum1.BoardID = this.Settings["forumboardid"].ToType <int>();

                var boardSettingsTabId = YafContext.Current.BoardSettings != null &&
                                         YafContext.Current.BoardSettings.BoardID.Equals(this.forum1.BoardID)
                                             ? YafContext.Current.BoardSettings.DNNPageTab
                                             : new YafLoadBoardSettings(this.forum1.BoardID).DNNPageTab;

                if (boardSettingsTabId.Equals(-1) || !boardSettingsTabId.Equals(this.TabId) && !this.CurrentPortalSettings.ContentLocalizationEnabled)
                {
                    if (HttpContext.Current.User.Identity.IsAuthenticated &&
                        UserController.GetCurrentUserInfo().IsSuperUser)
                    {
                        this.Response.Redirect(
                            this.ResolveUrl(
                                "~/tabid/{0}/ctl/Edit/mid/{1}/Default.aspx".FormatWith(
                                    this.PortalSettings.ActiveTab.TabID,
                                    this.ModuleId)));
                    }

                    /*else
                     * {
                     *  boardSettings.DNNPageTab = this.TabId;
                     *
                     *  // save the settings to the database
                     *  boardSettings.SaveRegistry();
                     *
                     *  // Reload forum settings
                     *  YafContext.Current.BoardSettings = null;
                     * }*/
                }

                if (YafContext.Current.BoardSettings.DNNPortalId.Equals(-1))
                {
                    var boardSettings = new YafLoadBoardSettings(this.forum1.BoardID)
                    {
                        DNNPageTab =
                            this.TabId,
                        DNNPortalId =
                            this.PortalId
                    };

                    // save the settings to the database
                    boardSettings.SaveRegistry();
                }

                // Inherit Language from Dnn?
                var ineritDnnLanguage = true;

                if (this.Settings["InheritDnnLanguage"] != null)
                {
                    ineritDnnLanguage = this.Settings["InheritDnnLanguage"].ToType <bool>();
                }

                if (ineritDnnLanguage)
                {
                    SetDnnLangToYaf();
                }
            }
            else
            {
                if (HttpContext.Current.User.Identity.IsAuthenticated && UserController.GetCurrentUserInfo().IsSuperUser)
                {
                    this.Response.Redirect(
                        this.ResolveUrl(
                            "~/tabid/{0}/ctl/Edit/mid/{1}/Default.aspx".FormatWith(
                                this.PortalSettings.ActiveTab.TabID,
                                this.ModuleId)));
                }
                else
                {
                    this.pnlModuleContent.Controls.Clear();

                    this.pnlModuleContent.Controls.Add(
                        new Literal
                    {
                        Text =
                            "<div class=\"dnnFormMessage dnnFormInfo\">Please login as Superuser (host) and Setup the forum first.</div>"
                    });
                }
            }
        }
Пример #16
0
        /// <summary>
        /// The initialize component.
        /// </summary>
        private void InitializeComponent()
        {
            if (AJAX.IsInstalled())
            {
                AJAX.RegisterScriptManager();
            }

            this.InitializeForumIfNotExist();

            this.forum1 = new Forum();

            this.pnlModuleContent.Controls.Add(this.forum1);

            this.Load += this.DotNetNukeModuleLoad;
            this.forum1.PageTitleSet += this.Forum1_PageTitleSet;

            // This will create an error if there is no setting for forumboardid
            if (this.Settings["forumboardid"] != null)
            {
                this.forum1.BoardID = this.Settings["forumboardid"].ToType <int>();

                var boardSettingsTabId = BoardContext.Current.BoardSettings != null &&
                                         this.PageContext().BoardSettings.BoardID.Equals(this.forum1.BoardID)
                                             ? this.PageContext().BoardSettings.DNNPageTab
                                             : new LoadBoardSettings(this.forum1.BoardID).DNNPageTab;

                if (!boardSettingsTabId.Equals(this.TabId) && boardSettingsTabId > -1)
                {
                    if (HttpContext.Current.User.Identity.IsAuthenticated &&
                        UserController.Instance.GetCurrentUserInfo().IsSuperUser)
                    {
                        this.Response.Redirect(
                            this.ResolveUrl(
                                $"~/tabid/{this.PortalSettings.ActiveTab.TabID}/ctl/Edit/mid/{this.ModuleId}/Default.aspx"));
                    }
                }

                if (this.PageContext().BoardSettings.DNNPortalId.Equals(-1))
                {
                    var boardSettings = new LoadBoardSettings(this.forum1.BoardID)
                    {
                        DNNPageTab  = this.TabId,
                        DNNPortalId = this.PortalId
                    };

                    // save the settings to the database
                    boardSettings.SaveRegistry();
                }

                // Inherit Language from Dnn?
                var inheritDnnLanguage = true;

                if (this.Settings["InheritDnnLanguage"] != null)
                {
                    inheritDnnLanguage = this.Settings["InheritDnnLanguage"].ToType <bool>();
                }

                if (inheritDnnLanguage)
                {
                    this.OverrideLanguage();
                }
            }
            else
            {
                if (HttpContext.Current.User.Identity.IsAuthenticated &&
                    UserController.Instance.GetCurrentUserInfo().IsSuperUser)
                {
                    this.Response.Redirect(
                        this.ResolveUrl(
                            $"~/tabid/{this.PortalSettings.ActiveTab.TabID}/ctl/Edit/mid/{this.ModuleId}/Default.aspx"));
                }
                else
                {
                    this.pnlModuleContent.Controls.Clear();

                    this.pnlModuleContent.Controls.Add(
                        new Literal
                    {
                        Text =
                            "<div class=\"dnnFormMessage dnnFormInfo\">Please login as Superuser (host) and Setup the forum first.</div>"
                    });
                }
            }
        }