Add branding feature with form, route, and object implementations

Introduced a new branding functionality, including a `branding_o` object, `create_branding_f` form, and associated routes in `BrandingRoute`. Refactored the forms directory for better organization and added support for branding in departments. Extended validation, object handling, and response handling to accommodate this new feature.
This commit is contained in:
Jepp9350
2025-03-26 11:04:12 +01:00
parent 6f36dc230a
commit 4deef9dc09
11 changed files with 495 additions and 24 deletions
+7 -1
View File
@@ -31,7 +31,13 @@ class response implements response_i
}
// If the data isn't an array, convert it to an array
if (!is_array($data) && !is_object($data)) {
$data = ['message' => $data];
// Check if the variable is a valid JSON string
if (is_string($data) && json_decode($data) !== null) {
$data = json_decode($data, true);
} else {
// If the variable is not a valid JSON string, convert it to an array
$data = ['message' => $data];
}
}
// If the debug mode is enabled, add the debug data to the response
if ($DEBUG) {