24header(
'Content-Type: application/json');
30if ($_SERVER[
'REQUEST_METHOD'] ===
'POST') {
38 $newValue = isset($_POST[
'value']) ? intval($_POST[
'value']) : null;
41 if ($newValue ===
null) {
42 $newValue = $currentValue == 1 ? 0 : 1;
46 if ($newValue !== 0 && $newValue !== 1) {
47 $response = [
'error' =>
'Invalid value. Must be 0 or 1.'];
52 Util::logInfo(
'EnhancedQuickPick setting changed from ' . $currentValue .
' to ' . $newValue);
56 'message' =>
'EnhancedQuickPick setting updated successfully',
57 'previousValue' => $currentValue,
58 'newValue' => $newValue,
59 'mode' => $newValue == 1 ?
'enhanced' :
'standard'
63 }
catch (Exception $e) {
64 $response = [
'error' =>
'Exception: ' . $e->getMessage()];
65 error_log(
'Exception in toggle EnhancedQuickPick: ' . $e->getMessage());
68 $response = [
'error' =>
'Invalid request method.'];
static logInfo($data, $file=null)