-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathajax_config.php
31 lines (27 loc) · 1015 Bytes
/
ajax_config.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
<?php
// mode (josn)
$error_mode = "json";
// libraries & acl
require_once "common.php";
// query
$q = (isset($_REQUEST["q"])) ? $_REQUEST["q"] : "";
// decide what to do
switch ($q) {
case "save":
$result = array("status" => "false");
if (isset($_REQUEST["config_data"]) AND is_array($_REQUEST["config_data"]) AND count($_REQUEST["config_data"]) > 0) {
// serialize and encode config data
$config_data = base64_encode(serialize((object) $_REQUEST["config_data"]));
// update config
$check = set_field("block_instance", "configdata", $config_data, "id", $srv_data->block_instance_id);
if ($check !== false) {
$result["status"] = "true";
}
}
break;
default:
break;
}
// send response
echo json_encode($result);
?>