Blame view

php/api.php 619 Bytes
16035364   Benjamin Renard   First commit
1
2
<?php

1340621c   Elena.Budnik   error msg when up...
3
4
	require('config.php');
	header('Content-Type: text/javascript');
16035364   Benjamin Renard   First commit
5

1340621c   Elena.Budnik   error msg when up...
6
7
8
9
10
11
12
13
14
15
16
17
18
19
	$actions = array();
	foreach($API as $aname => &$a){
		$methods = array();
		foreach($a['methods'] as $mname => &$m){
			$md = array(
				'name'=>$mname,
				'len'=>$m['len']
			);
			if(isset($m['formHandler']) && $m['formHandler']){
				$md['formHandler'] = true;
			}
			$methods[] = $md;
		}
		$actions[$aname] = $methods;
16035364   Benjamin Renard   First commit
20
	}
16035364   Benjamin Renard   First commit
21

1340621c   Elena.Budnik   error msg when up...
22
23
24
25
26
27
28
	$cfg = array(
		'url'=>'php/router.php',
		'type'=>'remoting',
		'id' => 'amda-provider',
		'maxRetries' => 0,
		'actions'=>$actions
	);
16035364   Benjamin Renard   First commit
29

1340621c   Elena.Budnik   error msg when up...
30
	echo 'Ext.app.REMOTING_API = ';
16035364   Benjamin Renard   First commit
31

1340621c   Elena.Budnik   error msg when up...
32
33
	echo json_encode($cfg);
	echo ';';
16035364   Benjamin Renard   First commit
34
?>