Пример #1
0
        /// <summary>
        /// UpdateSettings is called when the 'update' button is clicked on the interface.
        /// This should take any values from the page, and set the individual properties on the
        /// instance of the module provider.
        /// </summary>
        /// <param name="provider"></param>
        public void UpdateSettings(iFinity.DNN.Modules.UrlMaster.ModuleFriendlyUrlProvider provider)
        {
            //check type safety before cast
            if (provider.GetType() == typeof(ActiveForumsModuleProvider))
            {
                //take values from the page and set values on provider
                ActiveForumsModuleProvider moduleProvider = (ActiveForumsModuleProvider)provider;

                moduleProvider.UrlPath = txtUrlPath.Text;

                string rawTabId = ddlNoDnnPagePathTab.SelectedValue;
                int    selTabId;
                if (int.TryParse(rawTabId, out selTabId))
                {
                    if (selTabId > 0)
                    {
                        moduleProvider.NoDnnPagePathTabId = selTabId;
                    }
                    else
                    {
                        moduleProvider.NoDnnPagePathTabId = 0;
                    }
                }
            }
        }
Пример #2
0
        /// <summary>
        /// LoadSettings is called when the module control is first loaded onto the page
        /// </summary>
        /// <remarks>
        /// This method shoudl read all the custom properties of the provider and set the controls
        /// of the page to reflect the current settings of the provider.
        /// </remarks>
        /// <param name="provider"></param>
        public void LoadSettings(iFinity.DNN.Modules.UrlMaster.ModuleFriendlyUrlProvider provider)
        {
            //build list of controls
            if (!IsPostBack)
            {
                LocalizeControls();
            }
            //take all the values from the provider and show on page
            //check type safety before cast
            if (provider.GetType() == typeof(ActiveForumsModuleProvider))
            {
                ActiveForumsModuleProvider moduleProvider = (ActiveForumsModuleProvider)provider;

                txtUrlPath.Text = moduleProvider.UrlPath;

                string selTabId = moduleProvider.NoDnnPagePathTabId.ToString();
                ddlNoDnnPagePathTab.SelectedValue = selTabId;
                if (ddlNoDnnPagePathTab.SelectedIndex == -1) //not found
                {
                    ddlNoDnnPagePathTab.SelectedIndex = 0;   //first item
                }
            }
        }