-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcdm_server.php
45 lines (39 loc) · 1.18 KB
/
cdm_server.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
<?
require_once('cdm_ajax_config.php');
require_once('item.php');
include(CDMConfiguration::root_path.'/dmscripts/DMSystem.php');
include(CDMConfiguration::root_path.'/cdm4/config.php');
include('JSON.php');
$command = $_POST['command'];
$json = new Services_JSON();
$params = $json->decode(stripslashes($_POST['params']));
if($params->test_stubs) {
include('stubs.php');
}
$results = '';
switch($command) {
case 'dmQuery':
include('api/dm_query.php');
$results = dm_query($params);
break;
case 'dmGetCollectionList':
$results = dmGetCollectionList();
break;
case 'get_collections_with_meta_data':
include('api/get_collections_with_meta_data.php');
$results = get_collections_with_meta_data();
break;
case 'collection_info':
include('api/collection_info.php');
$results = collection_info($params->alias);
break;
case 'featured_items_for_collection':
include('api/featured_items_for_collection.php');
$results = featured_items_for_collection($params->alias);
break;
default:
$results = array( 'error' => 'invalid operation requested: '.$_POST['command'] );
}
header('Content-Type: application/json');
echo $json->encode($results);
?>