public void btGo_Click(object sender, EventArgs e) { //Setup Child Page - Main View/Activity TabInfo tab = CreatePage(PortalSettings.ActiveTab, PortalId, TabId, "Group Activity", false); //Add Module to Child Page int groupViewModuleId = AddModule(tab, PortalId, "Social Groups", "ContentPaneProfile"); int journalModuleId = AddModule(tab, PortalId, "Journal", "ContentPaneProfile"); int consoleId = AddModule(tab, PortalId, "Console", "RightPaneProfile"); var mc = new ModuleController(); ModuleInfo groupConsoleModule = mc.GetModule(consoleId, tab.TabID); TabInfo memberTab = CreatePage(PortalSettings.ActiveTab, PortalId, tab.TabID, "Members", false); mc.CopyModule(groupConsoleModule, memberTab, "RightPaneProfile", true); ModuleInfo groupViewModule = mc.GetModule(groupViewModuleId, tab.TabID); mc.CopyModule(groupViewModule, memberTab, "ContentPaneProfile", true); AddModule(memberTab, PortalId, "DotNetNuke.Modules.MemberDirectory", "ContentPaneProfile"); //List Settings var modules = new ModuleController(); modules.UpdateTabModuleSetting(TabModuleId, Constants.GroupLoadView, GroupMode.List.ToString()); modules.UpdateTabModuleSetting(TabModuleId, Constants.GroupViewPage, tab.TabID.ToString(CultureInfo.InvariantCulture)); Response.Redirect(Request.RawUrl); }
public override void UpdateSettings() { try { ModuleController controller = new ModuleController(); controller.UpdateTabModuleSetting(TabModuleId, "TokenProvider", ddlTokens.SelectedValue); foreach (TokenConfigurator conf in phConfigurator.Controls) { var sets = conf.SaveSettings(); foreach (DictionaryEntry set in sets) { controller.UpdateTabModuleSetting(TabModuleId, (string)set.Key, (string)set.Value); } if (conf.Visible) { controller.UpdateTabModuleSetting(TabModuleId, "Token", conf.getToken()); } } } catch (Exception exc) // Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
public override void UpdateSettings() { //save the new setting var modules = new ModuleController(); modules.UpdateTabModuleSetting(TabModuleId, "cfCategoryId", ddlCategoryList.SelectedValue); modules.UpdateTabModuleSetting(TabModuleId, "cfDisplayOption", ddlViewOptions.SelectedValue); modules.UpdateTabModuleSetting(TabModuleId, "cfEnableRss", chkEnableRss.Checked.ToString()); modules.UpdateTabModuleSetting(TabModuleId, "cfRandomize", chkRandomize.Checked.ToString()); }
public bool Save(int tabModuleId) { var modules = new ModuleController(); modules.UpdateTabModuleSetting(tabModuleId, "RepoOwner", RepoOwner == null ? string.Empty : RepoOwner.Trim()); modules.UpdateTabModuleSetting(tabModuleId, "RepoName", RepoName == null ? string.Empty : RepoName.Trim()); modules.UpdateTabModuleSetting(tabModuleId, "Releases", ((int)ReleaseType).ToString()); modules.UpdateTabModuleSetting(tabModuleId, "PreReleases", ((int)PreReleaseType).ToString()); modules.UpdateTabModuleSetting(tabModuleId, "EnableDownloadCounts", EnableDownloadCounts ? "1" : "0"); return true; }
public override void UpdateSettings() { try { var objModules = new ModuleController(); objModules.UpdateTabModuleSetting(TabModuleId, "ProfileTemplate", txtTemplate.Text); objModules.UpdateTabModuleSetting(TabModuleId, "IncludeButton", IncludeButton.Checked.ToString(CultureInfo.InvariantCulture)); } catch (Exception exc) { //Module failed to load Exceptions.ProcessModuleLoadException(this, exc); } }
public static void AddAdminPages(string tabName, string description, string tabIconFile, string tabIconFileLarge, bool isVisible, int moduleDefId, string moduleTitle, string moduleIconFile, bool inheritPermissions) { var portalController = new PortalController(); ArrayList portals = portalController.GetPortals(); //Add Page to Admin Menu of all configured Portals for (int intPortal = 0; intPortal <= portals.Count - 1; intPortal++) { var portal = (PortalInfo)portals[intPortal]; //Create New Admin Page (or get existing one) TabInfo newPage = Upgrade.AddAdminPage(portal, tabName, description, tabIconFile, tabIconFileLarge, isVisible); //Add Module To Page Upgrade.AddModuleToPage(newPage, moduleDefId, moduleTitle, moduleIconFile, inheritPermissions); var moduleController = new ModuleController(); if (newPage != null) { foreach (var module in moduleController.GetTabModules(newPage.TabID).Values) { moduleController.UpdateTabModuleSetting(module.TabModuleID, "hideadminborder", "true"); } } } }
/// <summary> /// Saves the modified settings to the Database /// </summary> public override void UpdateSettings() { try { var objModules = new ModuleController(); objModules.UpdateTabModuleSetting(this.TabModuleId, "chkEnablePublish", this.EnablePublishCheckBox.Checked.ToString()); objModules.UpdateTabModuleSetting(this.TabModuleId, "lowerTabId", this.LowerTabIdTextBox.Text); objModules.UpdateTabModuleSetting(this.TabModuleId, "upperTabId", this.UpperTabIdTextBox.Text); } catch (Exception exc) { // Module failed to load Exceptions.ProcessModuleLoadException(this, exc); } }
public void btGo_Click(object sender, EventArgs e) { //Setup Child Page - Main View/Activity TabInfo tab = CreatePage(PortalSettings.ActiveTab, PortalId, TabId, "Group Activity", false); //Add Module to Child Page int groupViewModuleId = AddModule(tab, PortalId, "Social Groups", "ContentPane"); int journalModuleId = AddModule(tab, PortalId, "Journal", "ContentPane"); int consoleId = AddModule(tab, PortalId, "Console", "RightPane"); var mc = new ModuleController(); ModuleInfo groupConsoleModule = mc.GetModule(consoleId, tab.TabID); TabInfo memberTab = CreatePage(PortalSettings.ActiveTab, PortalId, tab.TabID, "Members", false); mc.CopyModule(groupConsoleModule, memberTab, "RightPane", true); ModuleInfo groupViewModule = mc.GetModule(groupViewModuleId, tab.TabID); mc.CopyModule(groupViewModule, memberTab, "ContentPane", true); AddModule(memberTab, PortalId, "DotNetNuke.Modules.MemberDirectory", "ContentPane"); //List Settings var modules = new ModuleController(); modules.UpdateTabModuleSetting(TabModuleId, Constants.GroupLoadView, GroupMode.List.ToString()); modules.UpdateTabModuleSetting(TabModuleId, Constants.GroupViewPage, tab.TabID.ToString(CultureInfo.InvariantCulture)); //Default Social Groups var defaultGroup = RoleController.GetRoleGroupByName(PortalId, Constants.DefaultGroupName); var groupId = -2; if (defaultGroup != null) { groupId = defaultGroup.RoleGroupID; } else { var groupInfo = new RoleGroupInfo(); groupInfo.PortalID = PortalId; groupInfo.RoleGroupName = Constants.DefaultGroupName; groupInfo.Description = Constants.DefaultGroupName; groupId = RoleController.AddRoleGroup(groupInfo); } modules.UpdateTabModuleSetting(TabModuleId, Constants.DefaultRoleGroupSetting, groupId.ToString()); Response.Redirect(Request.RawUrl); }
/// ----------------------------------------------------------------------------- /// <summary> /// UpdateSettings saves the modified settings to the Database /// </summary> /// <remarks> /// </remarks> /// <history> /// </history> /// ----------------------------------------------------------------------------- public override void UpdateSettings() { try { DotNetNuke.Entities.Modules.ModuleController objModules = new DotNetNuke.Entities.Modules.ModuleController(); if (UserInfo.IsSuperUser) { objModules.UpdateTabModuleSetting(TabModuleId, "includeHost", this.cbIncludeHostUser.Checked.ToString()); } objModules.UpdateTabModuleSetting(TabModuleId, "useAjax", this.cbUseAjax.Checked.ToString()); objModules.UpdateTabModuleSetting(TabModuleId, "sortBy", rbSortBy.SelectedValue); // refresh cache ModuleController.SynchronizeModule(ModuleId); } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
public override void UpdateSettings() { try { ModuleController controller = new ModuleController(); controller.UpdateTabModuleSetting(TabModuleId, "field", txtField.Text); } catch (Exception exc) // Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
public override void UpdateSettings() { try { var modules = new ModuleController(); modules.UpdateTabModuleSetting(TabModuleId, "Template", txtTemplate.Text.Trim()); } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } }
/// <summary> /// handles updating the module settings for this control /// </summary> public override void UpdateSettings() { try { ModuleController controller = new ModuleController(); controller.UpdateTabModuleSetting(this.TabModuleId, "template", txtTemplate.Text); } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
public override void UpdateSettings() { try { var objModules = new ModuleController(); objModules.UpdateTabModuleSetting(TabModuleId, "ProfileTemplate", txtTemplate.Text); } catch (Exception exc) { //Module failed to load Exceptions.ProcessModuleLoadException(this, exc); } }
public override void UpdateSettings() { try { ModuleController objModules = new ModuleController(); objModules.UpdateTabModuleSetting(TabModuleId, "template", tx.Text); //refresh cache SynchronizeModule(); } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
public void SaveSettings(int ModuleId, int TabModuleId) { _ModuleId = ModuleId; _TabModuleID = TabModuleId; DotNetNuke.Entities.Modules.ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController(); mc.UpdateTabModuleSetting(TabModuleId, "SelectBy", _SelectBy.ToString()); mc.UpdateTabModuleSetting(TabModuleId, "MultipleHandling", _MultipleHandling.ToString()); mc.UpdateModuleSetting(ModuleId, "Interval", _Interval.ToString()); mc.UpdateModuleSetting(ModuleId, "EnableUserTimeConversion", _EnableUserTimeConversion.ToString()); mc.UpdateTabModuleSetting(TabModuleId, "CategoryID", _CategoryID.ToString()); mc.UpdateTabModuleSetting(TabModuleId, "ProfilePropertyName", _ProfilePropertyName); mc.UpdateTabModuleSetting(TabModuleId, "IncludeDisabled", _IncludeDisabled.ToString()); mc.UpdateTabModuleSetting(TabModuleId, "HideWhenNoContent", _HideWhenNoContent.ToString()); mc.UpdateTabModuleSetting(TabModuleId, "ReplaceTitle", _ReplaceTitle.ToString()); mc.UpdateTabModuleSetting(TabModuleId, "ReplaceTokens", _ReplaceTokens.ToString()); DataCache.RemoveCache(string.Format(Consts.ConfigurationCacheKey, TabModuleId)); //Invalidate the tab modules's configuration cache }
public override void UpdateSettings() { try { if (Page.IsValid) { Entities.Modules.ModuleController objModules = new Entities.Modules.ModuleController(); objModules.UpdateTabModuleSetting(TabModuleId, "RequireSSL", chkRequireSSL.Checked.ToString()); } } catch(Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
public override void UpdateSettings() { try { ModuleController modules = new ModuleController(); // modules.UpdateModuleSetting(ModuleId, "VariableName", txtVariableName.Text); modules.UpdateTabModuleSetting(TabModuleId, "VariableName", txtVariableName.Text); } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
private void UpdateDisplaySearchSettings() { var moduleController = new ModuleController(); var portalController = new PortalController(); foreach (PortalInfo portal in portalController.GetPortals()) { foreach (ModuleInfo module in moduleController.GetModulesByDefinition(portal.PortalID, "Member Directory")) { foreach (ModuleInfo tabModule in moduleController.GetAllTabsModulesByModuleID(module.ModuleID)) { if (tabModule.TabModuleSettings.ContainsKey("DisplaySearch")) { var oldValue = bool.Parse(tabModule.TabModuleSettings["DisplaySearch"].ToString()); moduleController.UpdateTabModuleSetting(tabModule.TabModuleID, "DisplaySearch", oldValue ? "Both" : "None"); } } } } }
/// ----------------------------------------------------------------------------- /// <summary> /// UpdateSettings saves the modified settings to the Database /// </summary> /// ----------------------------------------------------------------------------- public override void UpdateSettings() { try { var modules = new ModuleController(); modules.UpdateTabModuleSetting(this.TabModuleId, Constants.DefaultRoleGroupSetting, drpRoleGroup.SelectedItem.Value); modules.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupViewPage, drpGroupViewPage.SelectedItem.Value); modules.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListTemplate, txtListTemplate.Text); modules.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupViewTemplate, txtViewTemplate.Text); modules.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupModerationEnabled, chkGroupModeration.Checked.ToString()); modules.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupLoadView, drpViewMode.SelectedItem.Value); modules.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListPageSize, txtPageSize.Text); modules.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListSearchEnabled, chkEnableSearch.Checked.ToString()); modules.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListSortField, lstSortField.SelectedItem.Value); modules.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListSortDirection, radSortDirection.SelectedItem.Value); modules.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListUserGroupsOnly, chkUserGroups.Checked.ToString()); } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
/// ----------------------------------------------------------------------------- /// <summary> /// UpdateSettings saves the modified settings to the Database /// </summary> /// <remarks> /// </remarks> /// <history> /// </history> /// ----------------------------------------------------------------------------- public override void UpdateSettings() { try { ModuleController objModules = new ModuleController(); objModules.UpdateTabModuleSetting(TabModuleId, "LandingPage", txtLandingPage.Text); objModules.UpdateTabModuleSetting(TabModuleId, "BlogUrl", txtBlogUrl.Text); objModules.UpdateTabModuleSetting(TabModuleId, "SalesPhone", txtSalesPhone.Text); //objModules.UpdateTabModuleSetting(TabModuleId, "template", txtTemplate.Text); //refresh cache ModuleController.SynchronizeModule(this.ModuleId); } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
protected void btnSubmit_Click(object sender, EventArgs e) { var articleName = new StringBuilder(255); //replace name with the Page Name and Module Name var mc = new ModuleController(); ModuleInfo mi = mc.GetModule(ModuleId, TabId); articleName.Append(mi.ModuleTitle); if (articleName.Length < 1) {//check to see if the moduletitle was set as the title for the article, otherwise use the following articleName.Append("TabId-"); articleName.Append(TabId.ToString()); articleName.Append("ModuleId-"); articleName.Append(ModuleId.ToString()); } //string articleDescription = String.Format(Localization.GetString("description", LocalResourceFile), DateTime.Now.ToString(CultureInfo.CurrentCulture)); string articleText = teArticleText.Text; string description = DotNetNuke.Common.Utilities.HtmlUtils.StripTags(articleText, false); string articleDescription = Utility.TrimDescription(3997, description) + "...";// description + "..."; //save article //if the article id (itemid) already exists in the module settings let's update, otherwise create new if (Settings.Contains("ItemId")) { Article a = Article.GetArticle(Convert.ToInt32(Settings["ItemId"]), PortalId, true, true,true); a.ArticleText = teArticleText.Text; a.Description = articleDescription; //trim the content entered for a description a.DisplayTabId = TabId; //force display on specific page Setting setting = Setting.ArticleSettingForceDisplay; var itemVersionSetting = new ItemVersionSetting(setting); a.VersionSettings[itemVersionSetting].PropertyValue = "true"; a.ModuleId = ModuleId; a.ApprovalStatusId = UseApprovals ? epApprovals.ApprovalStatusId : ApprovalStatus.Approved.GetId(); a.Save(UserId); //this is likely unneccesary as we already have the itemid set in the settings mc.UpdateTabModuleSetting(TabModuleId, "ItemId", a.ItemId.ToString()); mc.UpdateTabModuleSetting(TabModuleId, "DisplayType", "texthtml"); } else { Article a = Article.Create(articleName.ToString(), articleDescription, teArticleText.Text, UserId, DefaultTextHtmlCategory, ModuleId, PortalId); a.DisplayTabId = TabId; //force display on specific page Setting setting = Setting.ArticleSettingForceDisplay; var itemVersionSetting = new ItemVersionSetting(setting); a.VersionSettings[itemVersionSetting].PropertyValue = "true"; a.ModuleId = ModuleId; a.ApprovalStatusId = UseApprovals ? epApprovals.ApprovalStatusId : ApprovalStatus.Approved.GetId(); a.Save(UserId); mc.UpdateTabModuleSetting(TabModuleId, "ItemId", a.ItemId.ToString()); mc.UpdateTabModuleSetting(TabModuleId, "DisplayType", "texthtml"); } Response.Redirect(DotNetNuke.Common.Globals.NavigateURL()); }
/// ----------------------------------------------------------------------------- /// <summary> /// UpdateSettings saves the modified settings to the Database /// </summary> /// ----------------------------------------------------------------------------- public override void UpdateSettings() { try { var modules = new ModuleController(); //the following are two sample Module Settings, using the text boxes that are commented out in the ASCX file. //module settings //modules.UpdateModuleSetting(ModuleId, "Setting1", txtSetting1.Text); //modules.UpdateModuleSetting(ModuleId, "Setting2", txtSetting2.Text); //tab module settings modules.UpdateTabModuleSetting(TabModuleId, SettingNames.RedirectAddress, pageDropDown.SelectedValue); modules.UpdateTabModuleSetting(TabModuleId, SettingNames.SubscriptionLists, txtSubscriptionLists.Text); modules.UpdateTabModuleSetting(TabModuleId, SettingNames.ValidationServiceEndpoint, txtValidationEndpoint.Text); } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
/// ----------------------------------------------------------------------------- /// <summary> /// UpdateSettings saves the modified settings to the Database /// </summary> /// <remarks> /// </remarks> /// <history> /// [cnurse] 11/11/2004 created /// </history> /// ----------------------------------------------------------------------------- public override void UpdateSettings() { try { if (Page.IsValid) { var objModules = new ModuleController(); objModules.UpdateTabModuleSetting(TabModuleId, "maxresults", txtresults.Text); objModules.UpdateTabModuleSetting(TabModuleId, "perpage", txtPage.Text); objModules.UpdateTabModuleSetting(TabModuleId, "titlelength", txtTitle.Text); objModules.UpdateTabModuleSetting(TabModuleId, "descriptionlength", txtdescription.Text); objModules.UpdateTabModuleSetting(TabModuleId, "showdescription", chkDescription.Checked ? "Y" : "N"); } } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } }
/// ----------------------------------------------------------------------------- /// <summary> /// UpdateSettings saves the modified settings to the Database /// </summary> /// ----------------------------------------------------------------------------- public override void UpdateSettings() { try { var ctlModule = new ModuleController(); var sec = new PortalSecurity(); var template = sec.InputFilter(txtTemplate.Text.Trim(), PortalSecurity.FilterFlag.NoSQL); if (chkTemplateScope.Checked) { ctlModule.UpdateTabModuleSetting(TabModuleId, DNNHangoutController.SETTINGS_TEMPLATE, template); } else { ctlModule.UpdateModuleSetting(ModuleId, DNNHangoutController.SETTINGS_TEMPLATE, template); } // clear any cached hangouts DataCache.ClearCache("WillStrohl.DNNHangout"); // synchronize the module settings ModuleController.SynchronizeModule(ModuleId); } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
private int AddModule(TabInfo tab, int portalId, string moduleName, string pane) { int id = -1; var mc = new ModuleController(); int desktopModuleId = GetDesktopModuleId(portalId, moduleName); int moduleId = -1; if (desktopModuleId > -1) { if (moduleId <= 0) { moduleId = AddNewModule(tab, string.Empty, desktopModuleId, pane, 0, string.Empty); } id = moduleId; ModuleInfo mi = mc.GetModule(moduleId, tab.TabID); if (moduleName == "Social Groups") { mc.UpdateTabModuleSetting(mi.TabModuleID, Constants.GroupLoadView, GroupMode.View.ToString()); mc.UpdateTabModuleSetting(mi.TabModuleID, Constants.GroupListPage, tab.TabID.ToString(CultureInfo.InvariantCulture)); } if (moduleName == "Console") { mc.UpdateModuleSetting(mi.ModuleID, "AllowSizeChange", "False"); mc.UpdateModuleSetting(mi.ModuleID, "AllowViewChange", "False"); mc.UpdateModuleSetting(mi.ModuleID, "IncludeParent", "True"); mc.UpdateModuleSetting(mi.ModuleID, "Mode", "Group"); mc.UpdateModuleSetting(mi.ModuleID, "DefaultSize", "IconNone"); mc.UpdateModuleSetting(mi.ModuleID, "ParentTabID", tab.TabID.ToString(CultureInfo.InvariantCulture)); } if (moduleName == "DotNetNuke.Modules.MemberDirectory") { mc.UpdateModuleSetting(mi.ModuleID, "FilterBy", "Group"); mc.UpdateModuleSetting(mi.ModuleID, "FilterPropertyValue", ""); mc.UpdateModuleSetting(mi.ModuleID, "FilterValue", "-1"); mc.UpdateTabModuleSetting(mi.TabModuleID, "DisplaySearch", "False"); } } return id; }
void UpdateSettings(string fileWithPath) { var moduleController = new ModuleController(); if (IsTrackingEmailMode) { moduleController.UpdateTabModuleSetting(ModuleContext.TabModuleId, SettingName.TrackingScript, fileWithPath); } else { moduleController.UpdateTabModuleSetting(ModuleContext.TabModuleId, SettingName.RenderingMethod, RenderingMethod.UserdefinedXSL); moduleController.UpdateTabModuleSetting(ModuleContext.TabModuleId, SettingName.XslUserDefinedStyleSheet, fileWithPath); } }
/// <summary> /// Updates the settings. /// </summary> public override void UpdateSettings() { if (!this.Page.IsValid) { return; } try { ModuleController objModules = new ModuleController(); objModules.UpdateTabModuleSetting(this.TabModuleId, "SearchTitle", this.txtSearchTitle.Text); objModules.UpdateTabModuleSetting(this.TabModuleId, "Country", this.SearchRestrictionsRadioButtonList.Items.FindByValue("Country").Selected.ToString(CultureInfo.InvariantCulture)); objModules.UpdateTabModuleSetting(this.TabModuleId, "Radius", this.SearchRestrictionsRadioButtonList.Items.FindByValue("Radius").Selected.ToString(CultureInfo.InvariantCulture)); objModules.UpdateTabModuleSetting(this.TabModuleId, "DisplayProvider", this.ProviderTypeRadioButtonList.SelectedItem.Text); objModules.UpdateTabModuleSetting(this.TabModuleId, this.ProviderTypeRadioButtonList.SelectedValue + ".ApiKey", this.txtApiKey.Text); objModules.UpdateTabModuleSetting(this.TabModuleId, "DefaultCountry", this.ddlLocatorCountry.SelectedValue); objModules.UpdateTabModuleSetting(this.TabModuleId, "MapType", this.rblMapDisplayType.SelectedValue); objModules.UpdateTabModuleSetting(this.TabModuleId, "LocationsPerPage", int.Parse(this.LocationsPerPageTextBox.Text, CultureInfo.CurrentCulture).ToString(CultureInfo.InvariantCulture)); objModules.UpdateTabModuleSetting(this.TabModuleId, "DisplayTypes", this.GetLocationTypeList()); objModules.UpdateTabModuleSetting(this.TabModuleId, "ShowDefaultDisplay", this.rbDisplayAll.Checked.ToString(CultureInfo.InvariantCulture)); objModules.UpdateTabModuleSetting(this.TabModuleId, "ShowMapDefaultDisplay", this.rbShowMap.Checked.ToString(CultureInfo.InvariantCulture)); objModules.UpdateTabModuleSetting(this.TabModuleId, "AlwaysShowSearch", this.AlwaysShowSearchCheckBox.Checked.ToString(CultureInfo.InvariantCulture)); objModules.UpdateTabModuleSetting(this.TabModuleId, "SearchAddress", this.chkAddress.Checked.ToString(CultureInfo.InvariantCulture)); objModules.UpdateTabModuleSetting(this.TabModuleId, "SearchCityRegion", this.chkCityRegion.Checked.ToString(CultureInfo.InvariantCulture)); objModules.UpdateTabModuleSetting(this.TabModuleId, "SearchPostalCode", this.chkPostalCode.Checked.ToString(CultureInfo.InvariantCulture)); objModules.UpdateTabModuleSetting(this.TabModuleId, "SearchCountry", this.chkCountry.Checked.ToString(CultureInfo.InvariantCulture)); objModules.UpdateTabModuleSetting(this.TabModuleId, "IncludeUnlimitedMilesRadius", this.IncludeUnlimitedMilesRadiusCheckBox.Checked.ToString(CultureInfo.InvariantCulture)); objModules.UpdateTabModuleSetting(this.TabModuleId, "DefaultRadius", this.DefaultRadiusDropDownList.SelectedValue.ToString(CultureInfo.InvariantCulture)); if (this.NoLocationDetailsRadioButton.Checked) { objModules.UpdateTabModuleSetting(this.TabModuleId, "ShowLocationDetails", "NoDetails"); } else if (this.LocationDetailsSamePageRadioButton.Checked) { objModules.UpdateTabModuleSetting(this.TabModuleId, "ShowLocationDetails", "SamePage"); } else if (this.LocationDetailSeparatePageRadioButton.Checked) { objModules.UpdateTabModuleSetting(this.TabModuleId, "ShowLocationDetails", "DetailsPage"); } HostSettingsController hsc = new HostSettingsController(); hsc.UpdateHostSetting("LocatorAllowSubmissions" + this.PortalId.ToString(CultureInfo.InvariantCulture), this.AllowLocationSubmissionsCheckBox.Checked.ToString(CultureInfo.InvariantCulture)); hsc.UpdateHostSetting("LocatorSubmissionModeration" + this.PortalId.ToString(CultureInfo.InvariantCulture), this.chkModerateLocations.Checked.ToString(CultureInfo.InvariantCulture)); hsc.UpdateHostSetting("LocatorAllowRatings" + this.PortalId.ToString(CultureInfo.InvariantCulture), this.AllowRatingsCheckBox.Checked.ToString(CultureInfo.InvariantCulture)); hsc.UpdateHostSetting("LocatorAllowComments" + this.PortalId.ToString(CultureInfo.InvariantCulture), this.AllowCommentsCheckBox.Checked.ToString(CultureInfo.InvariantCulture)); hsc.UpdateHostSetting("LocatorCommentModeration" + this.PortalId.ToString(CultureInfo.InvariantCulture), this.ModerateCommentsCheckBox.Checked.ToString(CultureInfo.InvariantCulture)); foreach (GridViewRow dr in this.gvTabModules.Rows) { RadioButton locatorModuleRadioButton = (RadioButton)dr.FindControl("LocatorModuleRadioButton"); Label lblTabId = (Label)dr.FindControl("lblTabId"); if (locatorModuleRadioButton.Checked) { objModules.UpdateTabModuleSetting(this.TabModuleId, "DisplayResultsTabId", lblTabId.Text); break; } } } catch (Exception exc) { // Module failed to load Exceptions.ProcessModuleLoadException(this, exc); } }
/// ----------------------------------------------------------------------------- /// <summary> /// UpdateSettings saves the modified settings to the Database /// </summary> /// <remarks> /// </remarks> /// <history> /// </history> /// ----------------------------------------------------------------------------- public override void UpdateSettings() { try { ModuleController objModules = new ModuleController(); objModules.UpdateTabModuleSetting(TabModuleId, "Configure", Convert.ToString(ddlConfigure.SelectedValue)); //refresh cache ModuleController.SynchronizeModule(this.ModuleId); } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
private static void UpgradeToVersion621() { //update administrators' role description. var portalController = new PortalController(); var moduleController = new ModuleController(); foreach (PortalInfo portal in portalController.GetPortals()) { //update about me's template var myProfileTabId = TabController.GetTabByTabPath(portal.PortalID, "//ActivityFeed//MyProfile", string.Empty); if (myProfileTabId != Null.NullInteger) { var tabModules = moduleController.GetTabModules(myProfileTabId); foreach (var module in tabModules.Values) { var settings = moduleController.GetTabModuleSettings(module.TabModuleID); if (settings.ContainsKey("ProfileTemplate") && settings["ProfileTemplate"].ToString().Contains("<div class=\"pBio\">")) { var template = @"<div class=""pBio""> <h3 data-bind=""text: AboutMeText""></h3> <span data-bind=""text: EmptyAboutMeText, visible: Biography().length==0""></span> <p data-bind=""html: Biography""></p> </div> <div class=""pAddress""> <h3 data-bind=""text: LocationText""></h3> <span data-bind=""text: EmptyLocationText, visible: Street().length=0 && Location().length==0 && Country().length==0 && PostalCode().length==0""></span> <p><span data-bind=""text: Street()""></span><span data-bind=""visible: Street().length > 0""><br/></span> <span data-bind=""text: Location()""></span><span data-bind=""visible: Location().length > 0""><br/></span> <span data-bind=""text: Country()""></span><span data-bind=""visible: Country().length > 0""><br/></span> <span data-bind=""text: PostalCode()""></span> </p> </div> <div class=""pContact""> <h3 data-bind=""text: GetInTouchText""></h3> <span data-bind=""text: EmptyGetInTouchText, visible: Telephone().length==0 && Email().length==0 && Website().length==0 && IM().length==0""></span> <ul> <li data-bind=""visible: Telephone().length > 0""><strong><span data-bind=""text: TelephoneText"">:</span></strong> <span data-bind=""text: Telephone()""></span></li> <li data-bind=""visible: Email().length > 0""><strong><span data-bind=""text: EmailText"">:</span></strong> <span data-bind=""text: Email()""></span></li> <li data-bind=""visible: Website().length > 0""><strong><span data-bind=""text: WebsiteText"">:</span></strong> <span data-bind=""text: Website()""></span></li> <li data-bind=""visible: IM().length > 0""><strong><span data-bind=""text: IMText"">:</span></strong> <span data-bind=""text: IM()""></span></li> </ul> </div> <div class=""dnnClear""></div>"; moduleController.UpdateTabModuleSetting(module.TabModuleID, "ProfileTemplate", template); } } } } }
private static void UpgradeToVersion600() { var tabController = new TabController(); var hostPages = tabController.GetTabsByPortal(Null.NullInteger); //This ensures that all host pages have a tab path. //so they can be found later. (DNNPRO-17129) foreach (var hostPage in hostPages.Values) { hostPage.TabPath = Globals.GenerateTabPath(hostPage.ParentId, hostPage.TabName); tabController.UpdateTab(hostPage); } var settings = PortalController.GetCurrentPortalSettings(); var moduleController = new ModuleController(); if (settings != null) { var hostTab = tabController.GetTab(settings.SuperTabId, Null.NullInteger, false); hostTab.IsVisible = false; tabController.UpdateTab(hostTab); foreach (var module in moduleController.GetTabModules(settings.SuperTabId).Values) { moduleController.UpdateTabModuleSetting(module.TabModuleID, "hideadminborder", "true"); } } //remove timezone editor int moduleDefId = GetModuleDefinition("Languages", "Languages"); RemoveModuleControl(moduleDefId, "TimeZone"); //6.0 requires the old TimeZone property to be marked as Deleted - Delete for Host ProfilePropertyDefinition ppdHostTimeZone = ProfileController.GetPropertyDefinitionByName(Null.NullInteger, "TimeZone"); if (ppdHostTimeZone != null) { ProfileController.DeletePropertyDefinition(ppdHostTimeZone); } var portalController = new PortalController(); foreach (PortalInfo portal in portalController.GetPortals()) { //update timezoneinfo #pragma warning disable 612,618 TimeZoneInfo timeZoneInfo = Localization.Localization.ConvertLegacyTimeZoneOffsetToTimeZoneInfo(portal.TimeZoneOffset); #pragma warning restore 612,618 PortalController.UpdatePortalSetting(portal.PortalID, "TimeZone", timeZoneInfo.Id, false); //6.0 requires the old TimeZone property to be marked as Deleted - Delete for Portals ProfilePropertyDefinition ppdTimeZone = ProfileController.GetPropertyDefinitionByName(portal.PortalID, "TimeZone"); if (ppdTimeZone != null) { ProfileController.DeletePropertyDefinition(ppdTimeZone); } var adminTab = tabController.GetTab(portal.AdminTabId, portal.PortalID, false); adminTab.IsVisible = false; tabController.UpdateTab(adminTab); foreach (var module in moduleController.GetTabModules(portal.AdminTabId).Values) { moduleController.UpdateTabModuleSetting(module.TabModuleID, "hideadminborder", "true"); } } //Ensure that Display Beta Notice setting is present var displayBetaNotice = Host.DisplayBetaNotice; HostController.Instance.Update("DisplayBetaNotice", displayBetaNotice ? "Y": "N"); moduleDefId = GetModuleDefinition("Languages", "Languages"); AddModuleControl(moduleDefId, "EnableContent", "Enable Localized Content", "DesktopModules/Admin/Languages/EnableLocalizedContent.ascx", "", SecurityAccessLevel.Host, 0, null, false); AddProfessionalPreviewPages(); AddDefaultModuleIcons(); AddIconToAllowedFiles(); FavIconsToPortalSettings(); var tab = tabController.GetTabByName("Host", Null.NullInteger, Null.NullInteger); if (tab != null) { RemoveModule("Extensions", "Module Definitions", tab.TabID, true); RemoveModule("Marketplace", "Marketplace", tab.TabID, true); } }
public void Update() { var objModules = new ModuleController(); objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.History, History.ToString(CultureInfo.InvariantCulture)); objModules.UpdateModuleSetting(_moduleId, SettingName.DescriptionLength, DescriptionLength.ToString(CultureInfo.InvariantCulture)); objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.EditorHeight, EditorHeight.ToString(CultureInfo.InvariantCulture)); objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.RepeatTemplate, RepeatTemplate.ToString(CultureInfo.InvariantCulture)); objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.DefaultViewType, Utilities.ViewTypeToString(DefaultViewType)); objModules.UpdateModuleSetting(_moduleId, SettingName.Legacy, Legacy.ToString(CultureInfo.InvariantCulture)); objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.TemplateType, TemplateType); objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.TemplateName, TemplateName); objModules.UpdateTabModuleSetting(_tabModuleId, SettingName.TemplateLocation, TemplateLocation); ModuleController.SynchronizeModule(_moduleId); DataCache.RemoveCache(ModuleController.CacheKey(_moduleId) + "_viewType"); DataCache.RemoveCache(CacheConstants.SettingsCacheKeyFormat(_moduleId, _tabModuleId)); }
public override void UpdateSettings() { //save the new setting var modules = new ModuleController(); modules.UpdateTabModuleSetting(TabModuleId, "csMaxResults", txtResults.Text); modules.UpdateTabModuleSetting(TabModuleId, "csPerPage", txtPage.Text); modules.UpdateTabModuleSetting(TabModuleId, "csTitleLength", txtTitle.Text); modules.UpdateTabModuleSetting(TabModuleId, "csDescriptionLength", txtDescription.Text); modules.UpdateTabModuleSetting(TabModuleId, "csCategoryId", ddlCategorySearchList.SelectedValue); modules.UpdateTabModuleSetting(TabModuleId, "csSearchEmptyRedirectUrl", txtSearchUrl.Text.Trim()); modules.UpdateTabModuleSetting(TabModuleId, "csShowDescription", (chkDescription.Checked ? "Y" : "N")); modules.UpdateTabModuleSetting(TabModuleId, "csAllowCategorySelection", (chkAllowCategorySelection.Checked ? "Y" : "N")); }