Refactoring

This commit is contained in:
Szymon Porwolik
2025-11-07 19:25:32 +01:00
parent 7389f067e9
commit a4a7bf67c9
2 changed files with 21 additions and 11 deletions

View File

@@ -74,15 +74,22 @@ class Bandmap extends CI_Controller {
// Get user's favorite bands and modes (active ones)
function get_user_favorites() {
session_write_close();
$this->load->model('bands');
$this->load->model('usermodes');
// Get active bands
$activeBands = $this->bands->get_user_bands_for_qso_entry(false); // false = only active
$bandList = [];
foreach ($activeBands as $group => $bands) {
foreach ($bands as $band) {
$bandList[] = $band;
if (is_array($activeBands)) {
foreach ($activeBands as $group => $bands) {
if (is_array($bands)) {
foreach ($bands as $band) {
$bandList[] = $band;
}
}
}
}
@@ -94,14 +101,16 @@ class Bandmap extends CI_Controller {
'digi' => false
];
foreach ($activeModes as $mode) {
$qrgmode = strtoupper($mode->qrgmode ?? '');
if ($qrgmode === 'CW') {
$modeCategories['cw'] = true;
} elseif ($qrgmode === 'SSB') {
$modeCategories['phone'] = true;
} elseif ($qrgmode === 'DATA') {
$modeCategories['digi'] = true;
if ($activeModes) {
foreach ($activeModes as $mode) {
$qrgmode = strtoupper($mode->qrgmode ?? '');
if ($qrgmode === 'CW') {
$modeCategories['cw'] = true;
} elseif ($qrgmode === 'SSB') {
$modeCategories['phone'] = true;
} elseif ($qrgmode === 'DATA') {
$modeCategories['digi'] = true;
}
}
}

View File

@@ -58,6 +58,7 @@
var lang_general_word_please_wait = "<?= __("Please Wait ..."); ?>";
var lang_general_states_deprecated = "<?= _pgettext("Word for country states that are deprecated but kept for legacy reasons.", "deprecated"); ?>";
var lang_gen_hamradio_sat_info = "<?= __("Satellite Information"); ?>";
var lang_notes_error_loading = "<?= __("Error loading notes"); ?>";
var lang_notes_sort = "<?= __("Sorting"); ?>";
var lang_notes_duplication_disabled = "<?= __("Duplication is disabled for Contacts notes"); ?>";