-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathindex.php
More file actions
76 lines (65 loc) · 2.71 KB
/
Copy pathindex.php
File metadata and controls
76 lines (65 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* index.php
*/
if (!file_exists('settings/config.php')) {
// install
header('Location: install/index.php');
exit;
}
$cfg = include 'settings/config.php';
// ค่าเหล่านี้มาจาก config ของ tenant ที่ init() merge ให้แล้ว (ไม่ใช่ค่ากลาง)
$reversion = rawurlencode((string) $cfg['reversion'] ?? '');
$webTitle = (string) ($cfg['web_title'] ?? 'Admin System');
$webDescription = (string) ($cfg['web_description'] ?? 'Admin panel to manage site contents and settings.');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo htmlspecialchars($webTitle, ENT_QUOTES); ?></title>
<meta name="description" content="<?php echo htmlspecialchars($webDescription, ENT_QUOTES); ?>">
<!-- Framework CSS -->
<link rel="stylesheet" href="Now/dist/now.core.min.css?v=<?php echo $reversion; ?>">
<link rel="stylesheet" href="Now/css/fonts.css?v=<?php echo $reversion; ?>">
<!-- Custom CSS -->
<link rel="stylesheet" href="css/styles.css?v=<?php echo $reversion; ?>">
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap" rel="stylesheet">
</head>
<body>
<main id="main" role="main">
<!-- Main Content -->
</main>
<!-- Framework Scripts -->
<script src="Now/dist/now.core.min.js?v=<?php echo $reversion; ?>"></script>
<script src="Now/dist/now.table.min.js?v=<?php echo $reversion; ?>"></script>
<script src="Now/dist/now.graph.min.js?v=<?php echo $reversion; ?>"></script>
<!-- App Scripts -->
<?php
$skipModules = ['index'];
foreach (['modules'] as $dir) {
$path = __DIR__.'/'.$dir;
if (is_dir($path)) {
foreach (scandir($path) as $name) {
if ($name[0] !== '.' && !in_array($name, $skipModules, true)) {
if (is_file($path.'/'.$name.'/admin.js')) {
echo '<script src="'.$dir.'/'.$name.'/admin.js?v='.$reversion.'"></script>'."\n";
}
if (is_file($path.'/'.$name.'/styles.css')) {
echo '<link rel="stylesheet" href="'.$dir.'/'.$name.'/styles.css?v='.$reversion.'">'."\n";
}
if (is_file('templates/'.$name.'/styles.css')) {
echo '<link rel="stylesheet" href="templates/'.$name.'/styles.css?v='.$reversion.'">'."\n";
}
}
}
}
}
?>
<!-- App Scripts -->
<script src="js/main.js?v=<?php echo $reversion; ?>"></script>
<script src="js/global.js?v=<?php echo $reversion; ?>"></script>
</body>
</html>