/// <summary> /// cmdUpdate_Click runs when the Update LinkButton is clicked. /// It saves the current Site Settings /// </summary> /// <history> /// [cnurse] 10/18/2004 documented /// [cnurse] 10/19/2004 modified to support custm module specific settings /// </history> protected void cmdUpdate_Click( object Sender, EventArgs e ) { try { if( Page.IsValid ) { ModuleController objModules = new ModuleController(); bool AllTabsChanged = false; // tab administrators can only manage their own tab if( PortalSecurity.IsInRoles( PortalSettings.AdministratorRoleName ) == false ) { chkAllTabs.Enabled = false; chkDefault.Enabled = false; chkAllModules.Enabled = false; cboTab.Enabled = false; } // update module ModuleInfo objModule = objModules.GetModule( moduleId, TabId, false ); objModule.ModuleID = moduleId; objModule.ModuleTitle = txtTitle.Text; objModule.Alignment = cboAlign.SelectedItem.Value; objModule.Color = txtColor.Text; objModule.Border = txtBorder.Text; objModule.IconFile = ctlIcon.Url; if( !String.IsNullOrEmpty( txtCacheTime.Text ) ) { objModule.CacheTime = int.Parse( txtCacheTime.Text ); } else { objModule.CacheTime = 0; } objModule.TabID = TabId; if( objModule.AllTabs != chkAllTabs.Checked ) { AllTabsChanged = true; } objModule.AllTabs = chkAllTabs.Checked; switch( int.Parse( cboVisibility.SelectedItem.Value ) ) { case 0: objModule.Visibility = VisibilityState.Maximized; break; case 1: objModule.Visibility = VisibilityState.Minimized; break; case 2: objModule.Visibility = VisibilityState.None; break; } objModule.IsDeleted = false; objModule.Header = txtHeader.Text; objModule.Footer = txtFooter.Text; if( !String.IsNullOrEmpty( txtStartDate.Text ) ) { objModule.StartDate = Convert.ToDateTime( txtStartDate.Text ); } else { objModule.StartDate = Null.NullDate; } if( !String.IsNullOrEmpty( txtEndDate.Text ) ) { objModule.EndDate = Convert.ToDateTime( txtEndDate.Text ); } else { objModule.EndDate = Null.NullDate; } objModule.ContainerSrc = ctlModuleContainer.SkinSrc; objModule.ModulePermissions = dgPermissions.Permissions; objModule.InheritViewPermissions = chkInheritPermissions.Checked; objModule.DisplayTitle = chkDisplayTitle.Checked; objModule.DisplayPrint = chkDisplayPrint.Checked; objModule.DisplaySyndicate = chkDisplaySyndicate.Checked; objModule.IsDefaultModule = chkDefault.Checked; objModule.AllModules = chkAllModules.Checked; objModules.UpdateModule( objModule ); //Update Custom Settings if( ctlSpecific != null ) { ctlSpecific.UpdateSettings(); } //These Module Copy/Move statements must be //at the end of the Update as the Controller code assumes all the //Updates to the Module have been carried out. //Check if the Module is to be Moved to a new Tab if( ! chkAllTabs.Checked ) { int newTabId = int.Parse( cboTab.SelectedItem.Value ); if( TabId != newTabId ) { objModules.MoveModule( moduleId, TabId, newTabId, "" ); } } //'Check if Module is to be Added/Removed from all Tabs if( AllTabsChanged ) { ArrayList arrTabs = Globals.GetPortalTabs( PortalSettings.DesktopTabs, false, true ); if( chkAllTabs.Checked ) { objModules.CopyModule( moduleId, TabId, arrTabs, true ); } else { objModules.DeleteAllModules( moduleId, TabId, arrTabs, false, false ); } } // Navigate back to admin page Response.Redirect( Globals.NavigateURL(), true ); } } catch( Exception exc ) //Module failed to load { Exceptions.ProcessModuleLoadException( this, exc ); } }