]> git.proxmox.com Git - extjs.git/blob - extjs/examples/kitchensink/data/direct/config.php
add extjs 6.0.1 sources
[extjs.git] / extjs / examples / kitchensink / data / direct / config.php
1 <?php
2
3 function get_extdirect_api($caller) {
4 $TEST_API = array(
5 'TestAction'=>array(
6 'methods'=>array(
7 'doEcho'=>array(
8 'len'=>1
9 ),
10 'multiply'=>array(
11 'len'=>1
12 ),
13 'getTree'=>array(
14 'len'=>1
15 ),
16 'getGrid'=>array(
17 'len'=>1,
18 'metadata' => array(
19 'params' => array('table')
20 )
21 ),
22 'showDetails'=>array(
23 'params'=>array(
24 'firstName',
25 'lastName',
26 'age'
27 )
28 )
29 )
30 )
31 );
32
33 $FORM_API = array(
34 'Profile' => array(
35 'methods'=>array(
36 'getBasicInfo'=>array(
37 'len'=>2
38 ),
39 'getPhoneInfo'=>array(
40 'len'=>1
41 ),
42 'getLocationInfo'=>array(
43 'len'=>1
44 ),
45 'updateBasicInfo'=>array(
46 'len'=>0,
47 'formHandler'=>true
48 )
49 )
50 )
51 );
52
53 $api = null;
54
55 # This demonstrates dynamic API generation based on what the client side
56 # has requested from the server. In the client, we will use separate
57 # Providers that handle Profile form requests and TestAction class methods.
58 # Note that we only do that when called from aph.php; Router will need
59 # the full API array to handle all requests.
60 if ($caller == 'api') {
61 if (isset($_GET['form'])) {
62 $api = $FORM_API;
63 }
64 else {
65 $api = $TEST_API;
66 }
67 }
68 else {
69 $api = array_merge($TEST_API, $FORM_API);
70 }
71
72 return $api;
73 }
74
75 ?>