tvheadend/vendor/ext-3.4.1/examples/direct/php/api.php
Adam Sutton bafcfff42d webui: restructure webui/extjs source files
I want to keep the 3rd-party packages away from the main source
where possible.
2013-06-03 17:11:01 +01:00

31 lines
584 B
PHP

<?php
require('config.php');
header('Content-Type: text/javascript');
// convert API config to Ext.Direct spec
$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;
}
$cfg = array(
'url'=>'php/router.php',
'type'=>'remoting',
'actions'=>$actions
);
echo 'Ext.app.REMOTING_API = ';
echo json_encode($cfg);
echo ';';