Index: index.php =================================================================== RCS file: /cvsroot/phpgroupware/phpgroupware/index.php,v retrieving revision 1.127 diff -u -r1.127 index.php --- index.php 16 Aug 2006 02:47:52 -0000 1.127 +++ index.php 16 Aug 2006 03:41:46 -0000 @@ -76,7 +76,16 @@ && $GLOBALS[$class]->public_functions[$method] ) { - $GLOBALS[$class]->$method(); + if ( isset($_GET['phpgw_return_as']) && $_GET['phpgw_return_as'] == 'json' ) + { + $return_data = $GLOBALS[$class]->$method(); + echo execMethod('phpgwapi.Services_JSON.encode', $return_data); + $GLOBALS['phpgw_info']['nofooter'] = true; + } + else + { + $GLOBALS[$class]->$method(); + } unset($app); unset($class); unset($method);