mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-09 19:51:57 -07:00
Sanity check before settings are saved #655 ⚙
This commit is contained in:
0
front/php/templates/language/es_es.json
Normal file → Executable file
0
front/php/templates/language/es_es.json
Normal file → Executable file
0
front/php/templates/language/it_it.json
Normal file → Executable file
0
front/php/templates/language/it_it.json
Normal file → Executable file
@@ -753,6 +753,21 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// console.log(settingsArray);
|
||||||
|
|
||||||
|
// sanity check to make sure settings were loaded & collected correctly
|
||||||
|
sanityCheck_notOK = true
|
||||||
|
$.each(settingsArray, function(index, value) {
|
||||||
|
// Do something with each element of the array
|
||||||
|
if(value[1] == "UI_LANG")
|
||||||
|
{
|
||||||
|
sanityCheck_notOK = isEmpty(value[3])
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
if(sanityCheck_notOK == false)
|
||||||
|
{
|
||||||
// trigger a save settings event in the backend
|
// trigger a save settings event in the backend
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@@ -772,6 +787,9 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else{
|
||||||
|
showModalOk('WARNING', "<?= lang("settings_missing_block")?>");
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user