Upgrade to ExtJS 3.3.1 - Released 11/30/2010
[extjs.git] / examples / image-organizer / php / api.php
1 <?php
2 require('config.php');
3 header('Content-Type: text/javascript');
4
5 // convert API config to Ext.Direct spec
6 $actions = array();
7 foreach($API as $aname=>&$a){
8         $methods = array();
9         foreach($a['methods'] as $mname=>&$m){
10                 $md = array(
11                         'name'=>$mname,
12                         'len'=>$m['len']
13                 );
14                 if(isset($m['formHandler'])){
15                         $md['formHandler'] = true;
16                 }
17                 $methods[] = $md;
18         }
19         $actions[$aname] = $methods;
20 }
21
22 $cfg = array(
23     'url'=>'php/router.php',
24     'type'=>'remoting',
25         'actions'=>$actions,
26     'namespace'=>'Imgorg.ss'
27 );
28
29 echo 'Imgorg.REMOTING_API = ';
30
31 echo json_encode($cfg);
32 echo ';';