~cdparra/gelee/trunk

« back to all changes in this revision

Viewing changes to webui/ecosystem/workspace/extjs/examples/direct/php/api.php

  • Committer: parra
  • Date: 2010-03-15 15:56:56 UTC
  • Revision ID: svn-v4:ac5bba68-f036-4e09-846e-8f32731cc928:trunk/gelee:1448
merged gelee at svn

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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']) && $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
);
 
27
 
 
28
echo 'Ext.app.REMOTING_API = ';
 
29
 
 
30
echo json_encode($cfg);
 
31
echo ';';