//This is a more accurate way of updating to false the checkboxes and radios the settings
//var_dump($settings);exit;
/*
foreach ($values as $key => $value) {
if (in_array($key, $settings_to_avoid)) { continue; }
if ($key == 'search_field' or $key == 'submit_fixed_in_bottom') { continue; }
$key = Database::escape_string($key);
$sql = "UPDATE $table_settings_current SET selected_value = 'false' WHERE variable = '".$key."' AND access_url = ".intval($url_id)." AND type IN ('checkbox', 'radio') ";
$res = Database::query($sql);
}*/
foreach ($settings as $item) {
$key = $item['variable'];
if (in_array($key, $settings_to_avoid)) {
@ -239,7 +219,10 @@ if (!empty($_GET['category']) &&
$key = Database::escape_string($key);
$sql = "UPDATE $table_settings_current
SET selected_value = 'false'
WHERE variable = '".$key."' AND access_url = ".intval($url_id)." AND type IN ('checkbox', 'radio') ";
WHERE
variable = '".$key."' AND
access_url = ".intval($url_id)." AND
type IN ('checkbox', 'radio') ";
$res = Database::query($sql);
}
@ -254,7 +237,7 @@ if (!empty($_GET['category']) &&
continue;
}
// Avoid form elements which have nothing to do with settings
if ($key == 'search_field' or $key == 'submit_fixed_in_bottom') {
if ($key == 'search_field' || $key == 'submit_fixed_in_bottom') {
continue;
}
@ -271,9 +254,9 @@ if (!empty($_GET['category']) &&