-
Notifications
You must be signed in to change notification settings - Fork 0
/
editor.php
115 lines (99 loc) · 3.61 KB
/
editor.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
/**
* Editor
*
* Edit web pages
*/
// site data
require 'hw-includes/site/load.php';
$data = new site();
$pages = new pages();
if (isset($_GET['page_name'])) {
$page_name = $_GET['page_name'];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Editor</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="keywords" content="">
<link rel="icon" href="" type="image/x-icon">
<!-- css -->
<link rel="stylesheet" href="hw-includes/assets/css/bootstrap.min.css" />
<link rel="stylesheet" href="hw-includes/assets/css/swiffy-slider.min.css" />
<link rel="stylesheet" href="hw-includes/assets/css/style.css" />
<?php
// theme js
$css = $data->css();
?>
<!--icons-->
<link rel="stylesheet" href="hw-includes/assets/fontawesome/css/fontawesome.css" />
<link rel="stylesheet" href="hw-includes/assets/fontawesome/css/solid.css" />
<link rel="stylesheet" href="hw-includes/assets/fontawesome/css/brands.css" />
<script src="hw-includes/assets/js/jquery-3.1.0.min.js"></script>
<script src="hw-includes/assets/js/bootstrap.bundle.min.js"></script>
<script src="hw-includes/assets/js/swiffy-slider.min.js"></script>
<script src="hw-includes/assets/js/swiffy-slider-extensions.js"></script>
<script src="hw-content/plugins/vvveb/js/main.js"></script>
<?php
// theme js
$js = $data->js();
?>
<style>
html,
body {
width: 100%;
height: 100%;
}
</style>
<style id="vvvebjs-styles"></style>
</head>
<body>
<?php
$theme = file_get_contents('hw-includes/setting/site/theme.json');
$theme_data = json_decode($theme);
if ($theme_data->theme_url == true) {
$file = glob($theme_data->theme_url . '/*.*');
foreach ($file as $key => $page) {
$supported_file = array(
'html',
'php'
);
$ext = strtolower(pathinfo($page, PATHINFO_EXTENSION));
$path_parts = pathinfo($page, PATHINFO_EXTENSION);
$pathInfo = pathinfo($page);
$filename = $pathInfo['filename'];
if (in_array($ext, $supported_file)) {
if ($filename == $page_name) {
$url = $theme_data->theme_url.'/'.$filename.'.'.$path_parts;
require $url;
}
}
}
}else{
$file = glob("hw-includes/pages/*.*");
foreach ($file as $key => $page) {
$supported_file = array(
'html',
'php'
);
$ext = strtolower(pathinfo($page, PATHINFO_EXTENSION));
$path_parts = pathinfo($page, PATHINFO_EXTENSION);
$pathInfo = pathinfo($page);
$filename = $pathInfo['filename'];
if (in_array($ext, $supported_file)) {
if ($filename == $page_name) {
$url ='hw-includes/pages/'.$filename.'.'.$path_parts;
require $url;
}
}
}
}
?>
</body>
</html>
<?php
}
?>