<?PHP
/**
 * This file generates a web manifest based on the settings.
 *
 * @author Joshua Ramon Enslin <joshua@jrenslin.de>
 */

// Include functions and settings.

require_once __DIR__ . "/inc/functions.php";

// Ensure working environment for frontend.

ensureEnvironment();

// Fill output array

$data = [];

$data["name"] = $data['short_name'] = $settings['pageTitle'];
$data["start_url"] = "/";
$data["display"] = "standalone";
$data["background_color"] = "#000";
$data["theme_color"] = "#AFB42B";
$data["description"] = "Website of " . $settings['pageTitle'];

/*
$data['icons'] = [
    "src"  => $settings['logo'],
    "type" => mime_content_type(__DIR__ . $settings['logo'])
];
 */

// Return JSON-encoded data.

header('Content-Type: application/json');
echo json_encode($data, JSON_PRETTY_PRINT);

?>