Changeset View
Changeset View
Standalone View
Standalone View
src/app/Utils.php
Show First 20 Lines • Show All 381 Lines • ▼ Show 20 Lines | public static function uiEnv(): array | ||||
if ($req_domain == "admin.$sys_domain") { | if ($req_domain == "admin.$sys_domain") { | ||||
$env['jsapp'] = 'admin.js'; | $env['jsapp'] = 'admin.js'; | ||||
} | } | ||||
$env['paymentProvider'] = \config('services.payment_provider'); | $env['paymentProvider'] = \config('services.payment_provider'); | ||||
$env['stripePK'] = \config('services.stripe.public_key'); | $env['stripePK'] = \config('services.stripe.public_key'); | ||||
$theme_file = resource_path("themes/{$env['app.theme']}/theme.json"); | $env['languages'] = \App\Http\Controllers\ContentController::locales(); | ||||
$menu = []; | $env['menu'] = \App\Http\Controllers\ContentController::menu(); | ||||
if (file_exists($theme_file)) { | |||||
$theme = json_decode(file_get_contents($theme_file), true); | |||||
if (json_last_error() != JSON_ERROR_NONE) { | |||||
\Log::error("Failed to parse $theme_file: " . json_last_error_msg()); | |||||
} elseif (!empty($theme['menu'])) { | |||||
$menu = $theme['menu']; | |||||
} | |||||
} | |||||
$env['menu'] = $menu; | |||||
return $env; | return $env; | ||||
} | } | ||||
} | } |