From f060ad7663edb8441aca1c891d89abeaa3fa260f Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 20 Oct 2010 14:06:38 +0000 Subject: [PATCH] Updated json Rop and RPC again git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20105 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_jsonROP.inc | 33 ---------------------- gosa-core/include/class_jsonRPC.inc | 43 ++++++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/gosa-core/include/class_jsonROP.inc b/gosa-core/include/class_jsonROP.inc index f7008abcb..013ed7193 100644 --- a/gosa-core/include/class_jsonROP.inc +++ b/gosa-core/include/class_jsonROP.inc @@ -1,38 +1,5 @@ inspectJsonResult($return); return($return); } + + public function inspectJsonResult($result) + { + // Check for remove objects we've to create + if(isset($result['__jsonclass__']) && class_available('remoteObject')){ + + // Get all relevant class informations + $classDef = $result['__jsonclass__'][1]; + $type = $classDef[0]; + $ref_id = $classDef[1]; + $object_id = $classDef[2]; + $methods = $classDef[3]; + $properties = $classDef[4]; + + // Prepare values + $values = array(); + foreach($properties as $prop){ + $values[$prop] = NULL; + if(isset($res[$prop])) $values[$prop] = $res[$prop]; + } + + // Build up remote object + $object = new remoteObject($rpc, $type, $properties, $values, $methods, $object_id, $ref_id); + return($object); + } + return($result); + } + + + + + + + + + /*! \brief This method finally initiates the real RPC requests and handles * the result from the server. * @param string method The method to call -- 2.30.2