From 529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105 Mon Sep 17 00:00:00 2001 From: Minteck Date: Tue, 24 Aug 2021 15:38:16 +0200 Subject: Update --- Neutron-trunk/api/admin/widgets.php | 64 +++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Neutron-trunk/api/admin/widgets.php (limited to 'Neutron-trunk/api/admin/widgets.php') diff --git a/Neutron-trunk/api/admin/widgets.php b/Neutron-trunk/api/admin/widgets.php new file mode 100644 index 0000000..231543f --- /dev/null +++ b/Neutron-trunk/api/admin/widgets.php @@ -0,0 +1,64 @@ + +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"); \ No newline at end of file -- cgit