-
Notifications
You must be signed in to change notification settings - Fork 0
/
themeseditor_controler.php
41 lines (36 loc) · 1.07 KB
/
themeseditor_controler.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
<?php
require_once '../../../init.php';
$result = array();
if (ISLOGIN === false) {
$result["status"] = false;
$result["msg"] = "没有登陆!";
echo json_encode($result);
exit;
}
require_once 'themeseditor_function.php';
$action = Input::postStrVar('action');
if (empty($action)) {
$result["status"] = false;
$result["msg"] = "操作类型错误!";
} else {
if ($action == 'save') {
$themeName = $_POST['themeName'];
$fileName = $_POST['fileName'];
$content = $_POST['content'];
$status = saveThemFileContent($themeName, $fileName, $content);
if ($status) {
$result["status"] = true;
} else {
$result["status"] = false;
$result["msg"] = "保存失败!";
}
} elseif ($action == 'themesFileList') {
} elseif ($action == 'saveEditorThemes') {
$name = isset($_POST['name']) ? addslashes($_POST['name']) : '';
if (!empty($name)) {
themeseditor_setting_config(null, null, $name);
}
}
}
echo json_encode($result);
exit;