Restructure: move all files from Public HTML/ to root for Hostinger deployment
This commit is contained in:
Executable
+46
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Public Site Settings API (safe subset only)
|
||||
*/
|
||||
|
||||
require_once 'config.php';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] !== 'GET') {
|
||||
jsonResponse(['success' => false, 'message' => 'Method not allowed'], 405);
|
||||
}
|
||||
|
||||
$all = getSettingsMap();
|
||||
|
||||
$allowedKeys = [
|
||||
'site_name',
|
||||
'site_tagline',
|
||||
'site_description',
|
||||
'contact_email',
|
||||
'contact_phone',
|
||||
'contact_address',
|
||||
'business_hours',
|
||||
'support_hours',
|
||||
'maps_url',
|
||||
'social_facebook',
|
||||
'social_linkedin',
|
||||
'social_twitter',
|
||||
'social_instagram',
|
||||
'social_youtube',
|
||||
'social_github',
|
||||
'primary_color',
|
||||
'secondary_color',
|
||||
'accent_color'
|
||||
];
|
||||
|
||||
$data = [];
|
||||
foreach ($allowedKeys as $key) {
|
||||
if (isset($all[$key]) && $all[$key] !== '') {
|
||||
$data[$key] = $all[$key];
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($data['contact_email']) || $data['contact_email'] === '') {
|
||||
$data['contact_email'] = ADMIN_EMAIL;
|
||||
}
|
||||
|
||||
jsonResponse(['success' => true, 'data' => $data]);
|
||||
Reference in New Issue
Block a user