-
Notifications
You must be signed in to change notification settings - Fork 1
/
!template.php
95 lines (51 loc) · 1.68 KB
/
!template.php
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php # maxsim.tech — MIT License — Copyright (c) 2005 Javier González González <[email protected]>
global $template;
$echo = ob_get_contents();
ob_end_clean();
?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="data:,">
<title><?=($template['title'] ?? ucwords(trim(str_replace(['_', '/'], ' ', $maxsim['app_url'] ?? ''))))?></title>
<meta name="description" content="<?=$template['description'] ?? ''?>" />
<?php
echo $template['head'] ?? '';
foreach ($maxsim['autoload'] ?? [] AS $file)
if (substr($file,-4) === '.css')
echo '<link rel="stylesheet" enctype="text/css" href="/'.$file.'" media="all" />'."\n";
if (isset($template['css']))
echo '<style type="text/css">'.$template['css'].'</style>';
if (isset($template['js_array'])) {
echo '<script type="text/javascript">';
foreach ($template['js_array'] AS $key => $value)
echo $key.' = "'.str_replace('"', '\"', $value).'";'."\n";
echo '</script>';
}
?>
</head>
<body>
<div id="content_left">
</div>
<div id="content_right">
<div id="top_right">
<?=$template['top_right'] ?? ''?>
<span id="print_login"></span>
</div>
<div id="content">
<?=$echo?>
</div>
<div id="footer" style="color:#777;">
</div>
</div>
<?php
foreach ($maxsim['autoload'] ?? [] AS $file)
if (substr($file,-3)==='.js')
echo '<script src="/'.$file.'"></script>'."\n";
if (isset($template['js']))
echo '<script type="text/javascript">'.implode("\n", (array) $template['js']).'</script>';
?>
</body>
</html>