list; if ($_POST['value'] == "true") { if (array_search($_POST['element'], $array) === false) { array_push($array, $_POST['element']); } } if ($_POST['value'] == "false") { if (array_search($_POST['element'], $array) !== false) { unset($array[array_search($_POST['element'], $array)]); sort($array); } } $settings->list = $array; file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/widgets.json", json_encode($settings, JSON_PRETTY_PRINT)); require $_SERVER['DOCUMENT_ROOT'] . "/api/admin/cache_content_reset.php"; require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("ok");