ssdfdsf
This commit is contained in:
@@ -8,6 +8,18 @@ $baseSkinProfile = $desktopPayload['meta']['base_skin_profile'];
|
||||
$skinProfile = $desktopPayload['meta']['skin_profile'];
|
||||
$wallpaper = $desktopPayload['desktop']['wallpaper'];
|
||||
|
||||
$assetVersion = static function (string $publicPath): string {
|
||||
$filesystemPath = dirname(__DIR__, 2) . '/public' . $publicPath;
|
||||
|
||||
if (!is_file($filesystemPath)) {
|
||||
return $publicPath;
|
||||
}
|
||||
|
||||
$mtime = filemtime($filesystemPath);
|
||||
|
||||
return $mtime === false ? $publicPath : $publicPath . '?v=' . $mtime;
|
||||
};
|
||||
|
||||
$renderStartIcon = static function (array $profile): string {
|
||||
$style = (string) ($profile['taskbar_icon_style'] ?? 'label');
|
||||
|
||||
@@ -24,12 +36,12 @@ $renderStartIcon = static function (array $profile): string {
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?= htmlspecialchars($desktopPayload['meta']['title'], ENT_QUOTES) ?></title>
|
||||
<link rel="stylesheet" href="/assets/desktop/desktop.css">
|
||||
<link rel="stylesheet" href="<?= htmlspecialchars($assetVersion('/assets/desktop/desktop.css'), ENT_QUOTES) ?>">
|
||||
<?php if (!empty($baseSkinProfile['css_path'])): ?>
|
||||
<link rel="stylesheet" href="<?= htmlspecialchars((string) $baseSkinProfile['css_path'], ENT_QUOTES) ?>">
|
||||
<link rel="stylesheet" href="<?= htmlspecialchars($assetVersion((string) $baseSkinProfile['css_path']), ENT_QUOTES) ?>">
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($skinProfile['css_path']) && $skinProfile['css_path'] !== $baseSkinProfile['css_path']): ?>
|
||||
<link rel="stylesheet" href="<?= htmlspecialchars((string) $skinProfile['css_path'], ENT_QUOTES) ?>">
|
||||
<link rel="stylesheet" href="<?= htmlspecialchars($assetVersion((string) $skinProfile['css_path']), ENT_QUOTES) ?>">
|
||||
<?php endif; ?>
|
||||
</head>
|
||||
<body
|
||||
@@ -123,12 +135,12 @@ $renderStartIcon = static function (array $profile): string {
|
||||
</div>
|
||||
|
||||
<script id="desktop-payload" type="application/json"><?= $payloadJson ?></script>
|
||||
<script src="/assets/desktop/desktop.js"></script>
|
||||
<script src="<?= htmlspecialchars($assetVersion('/assets/desktop/desktop.js'), ENT_QUOTES) ?>"></script>
|
||||
<?php if (!empty($baseSkinProfile['js_path'])): ?>
|
||||
<script src="<?= htmlspecialchars((string) $baseSkinProfile['js_path'], ENT_QUOTES) ?>"></script>
|
||||
<script src="<?= htmlspecialchars($assetVersion((string) $baseSkinProfile['js_path']), ENT_QUOTES) ?>"></script>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($skinProfile['js_path']) && $skinProfile['js_path'] !== $baseSkinProfile['js_path']): ?>
|
||||
<script src="<?= htmlspecialchars((string) $skinProfile['js_path'], ENT_QUOTES) ?>"></script>
|
||||
<script src="<?= htmlspecialchars($assetVersion((string) $skinProfile['js_path']), ENT_QUOTES) ?>"></script>
|
||||
<?php endif; ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user