From b1aacb94ab41b7dbfe4bd040885bb6e27c5ec4cb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 17 Aug 2025 20:59:23 +0000 Subject: [PATCH] Fix appearance options flash message issue - show single success message Co-authored-by: magicbug <84308+magicbug@users.noreply.github.com> --- application/controllers/Options.php | 30 +++++++++---------- application/language/english/options_lang.php | 1 + 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/application/controllers/Options.php b/application/controllers/Options.php index a81a8865..9de5f0d2 100644 --- a/application/controllers/Options.php +++ b/application/controllers/Options.php @@ -83,44 +83,42 @@ class Options extends CI_Controller { } else { + // Track if any updates were successful + $any_update_successful = FALSE; + // Update theme choice within the options system $theme_update_status = $this->optionslib->update('theme', $this->input->post('theme'), 'yes'); - - // If theme update is complete set a flashsession with a success note if($theme_update_status == TRUE) { - $this->session->set_flashdata('success', $this->lang->line('options_theme_changed_to').$this->input->post('theme')); + $any_update_successful = TRUE; } - // Update theme choice within the options system + // Update global search within the options system $search_update_status = $this->optionslib->update('global_search', $this->input->post('globalSearch')); - - // If theme update is complete set a flashsession with a success note if($search_update_status == TRUE) { - $this->session->set_flashdata('success', $this->lang->line('options_global_search_changed_to').$this->input->post('globalSearch')); + $any_update_successful = TRUE; } // Update dashboard banner within the options system $dasboard_banner_update_status = $this->optionslib->update('dashboard_banner', $this->input->post('dashboardBanner'), 'yes'); - - // If dashboard banner update is complete set a flashsession with a success note if($dasboard_banner_update_status == TRUE) { - $this->session->set_flashdata('success', $this->lang->line('options_dashboard_banner_changed_to').$this->input->post('dashboardBanner')); + $any_update_successful = TRUE; } // Update dashboard map within the options system $dashboard_map_update_status = $this->optionslib->update('dashboard_map', $this->input->post('dashboardMap'), 'yes'); - - // If dashboard map update is complete set a flashsession with a success note if($dashboard_map_update_status == TRUE) { - $this->session->set_flashdata('success', $this->lang->line('options_dashboard_map_changed_to').$this->input->post('dashboardMap')); + $any_update_successful = TRUE; } // Update logbook map within the options system $logbook_map_update_status = $this->optionslib->update('logbook_map', $this->input->post('logbookMap'), 'yes'); - - // If logbook map update is complete set a flashsession with a success note if($logbook_map_update_status == TRUE) { - $this->session->set_flashdata('success', $this->lang->line('options_logbook_map_changed_to').$this->input->post('logbookMap')); + $any_update_successful = TRUE; + } + + // If any update was successful, show a single success message + if($any_update_successful == TRUE) { + $this->session->set_flashdata('success', $this->lang->line('options_appearance_settings_saved')); } // Update Lang choice within the options system diff --git a/application/language/english/options_lang.php b/application/language/english/options_lang.php index 64803a6e..2ba13d25 100644 --- a/application/language/english/options_lang.php +++ b/application/language/english/options_lang.php @@ -101,6 +101,7 @@ $lang['options_version_dialog_show_all_hint'] = "This will show the version dial $lang['options_version_dialog_hide_all_hint'] = "This will deactivate the automatic popup of the version dialog for all users."; $lang['options_save'] = 'Save'; +$lang['options_appearance_settings_saved'] = 'Appearance settings have been saved successfully.'; // Bands