api.php 619 Bytes
<?php

	require('config.php');
	header('Content-Type: text/javascript');

	$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',
		'id' => 'amda-provider',
		'maxRetries' => 0,
		'actions'=>$actions
	);

	echo 'Ext.app.REMOTING_API = ';

	echo json_encode($cfg);
	echo ';';
?>