diff --git a/app/pages/config.php b/app/pages/config.php index 7b83583..a3e739f 100644 --- a/app/pages/config.php +++ b/app/pages/config.php @@ -35,13 +35,18 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { // Get raw input $jsonData = file_get_contents('php://input'); +//DEBUG error_log("Received JSON data: " . $jsonData); + $postData = json_decode($jsonData, true); if (json_last_error() !== JSON_ERROR_NONE) { - Messages::flash('ERROR', 'DEFAULT', 'Invalid JSON data received', true); + $error = json_last_error_msg(); +//DEBUG error_log("JSON decode error: " . $error); + + Messages::flash('ERROR', 'DEFAULT', 'Invalid JSON data received: ' . $error, true); echo json_encode([ 'success' => false, - 'message' => 'Invalid JSON data received' + 'message' => 'Invalid JSON data received: ' . $error ]); exit; } @@ -50,12 +55,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $result = $configObject->editConfigFile($postData, $config_file); if ($result === true) { $messageData = Messages::getMessageData('NOTICE', 'DEFAULT', 'Config file updated successfully', true); +//DEBUG error_log("Config updated successfully"); echo json_encode([ 'success' => true, 'message' => 'Config file updated successfully', 'messageData' => $messageData ]); } else { +//DEBUG error_log("Config update error: " . $result); $messageData = Messages::getMessageData('ERROR', 'DEFAULT', "Error updating config file: $result", true); echo json_encode([ 'success' => false, diff --git a/app/templates/config.php b/app/templates/config.php index 6902ce8..f21645b 100644 --- a/app/templates/config.php +++ b/app/templates/config.php @@ -1,39 +1,42 @@
+
-
+

Configuration

- + Jilo Web configuration file + - + +
+
+ +
+
+
+ + Jilo Web app configuration +
+hasRight($user_id, 'edit config file')) { ?> +
+ +
+ + +
+
+
-
-
-
- - Jilo Web app configuration -
-hasRight($user_id, 'edit config file')) { ?> -
- -
- - -
-
- -
- -
-
+
+ "; - echo "\n\t\t\t\t\t\t\t\t\t\t
" . htmlspecialchars($displayName) . '
'; - echo "\n\t\t\t\t\t\t\t\t\t\t
\n"; - foreach ($value as $subKey => $subValue) { - renderConfigItem($subKey, $subValue, $fullPath); - } - echo "\t\t\t\t\t\t\t\t\t\t
\n"; + echo "\t\t\t\t\t\t\t\t
"; + echo "\n\t\t\t\t\t\t\t\t\t
" . htmlspecialchars($displayName) . '
'; + echo "\n\t\t\t\t\t\t\t\t\t
\n"; + foreach ($value as $subKey => $subValue) { + renderConfigItem($subKey, $subValue, $fullPath); + } echo "\t\t\t\t\t\t\t\t\t
\n"; + echo "\t\t\t\t\t\t\t\t
\n"; } else { ?> -
-
- -
-
-
+
+
+ +
+
+
- + - + - blank + blank - + -
-
+
+
-
- > -
- - - - - +
+ >
+ + + + +
+
$value) { renderConfigItem($key, $value); } ?> - -
+
- +
+ diff --git a/app/templates/page-header.php b/app/templates/page-header.php index 2d78941..6f35d5d 100644 --- a/app/templates/page-header.php +++ b/app/templates/page-header.php @@ -11,7 +11,7 @@ - + @@ -49,4 +49,3 @@
-