convert to php array $subtarget = json_decode($_REQUEST['subtarget'], TRUE); if ($subtarget['object'] > 0) { // object is NOT undefined $structure = Factory::getObjectByID($subtarget['object']); // default object $defaultobject = array(); // read the data for the object $defaultobject['data'] = $structure->getDisplayData(); // read the data for the object's regions such as city name etc $defaultobject['regions'] = $structure->getDisplayRegions(); } } if (isset($subtarget['type'])) { // type of the pick object call has been set } else { // type has not been set $subtarget['type'] = ""; } if ($subtarget['type'] == "fileconnection" && $subtarget['fileid'] > 0) { // a file is connected to an object // get file classes require_once CROOT."/midware/File.class.php"; require_once CROOT."/midware/GenerateURL.class.php"; // loading basic info for the file $fileid = intval($subtarget['fileid']); $file = new File($fileid); $data = $file->getData(); // get the access rights of the current user for the given file $content_vars['access'] = Tools::checkAccessrights( array( "type" => "file", "id" => $fileid, "currentaccountid" => $_SESSION['account_id'], "setupaccountid" => $data['setupaccountid'] ) ); } ?>