} } if (!$done) { Header("Content-Type: text/html; charset=" . $charset); $spDisplay = " Agent: " . $agent->getMinimalName(); pageheader($agent); $am = new AgentManager(); if ($am->isAgentEditor()) { echo "<div id='commandDiv'><span class='link' id='editLink'>Edit</span> <span class='link' id='viewLink'>View</span> <span class='link' id='createLink'>New</span></div>"; echo "\n <script type='text/javascript'>\n \$('#editLink').click(function () {\n \$.ajax({\n type: 'GET',\n url: '{$clientRoot}/agents/rpc/handler.php',\n data: 'mode=edit&table=Agent&agentid=" . $agent->getagentid() . "',\n dataType : 'html',\n success: function(data){\n \$('#agentDetailDiv" . $agent->getagentid() . "').html(data);\n },\n error: function( xhr, status, errorThrown ) {\n \$('#statusDiv').html('Error. ' + errorThrown);\n console.log( 'Error: ' + errorThrown );\n console.log( 'Status: ' + status );\n console.dir( xhr );\n }\n });\n return false; \n });\n \$('#viewLink').click(function () {\n \$.ajax({\n type: 'GET',\n url: '{$clientRoot}/agents/rpc/handler.php',\n data: 'mode=show&table=Agent&agentid=" . $agent->getagentid() . "',\n dataType : 'html',\n success: function(data){\n \$('#agentDetailDiv" . $agent->getagentid() . "').html(data);\n },\n error: function( xhr, status, errorThrown ) {\n \$('#statusDiv').html('Error. ' + errorThrown);\n console.log( 'Error: ' + errorThrown );\n console.log( 'Status: ' + status );\n console.dir( xhr );\n }\n });\n return false; \n });\n \$('#createLink').click(function () {\n \$.ajax({\n type: 'GET',\n url: '{$clientRoot}/agents/rpc/handler.php',\n data: 'mode=create&table=Agent',\n dataType : 'html',\n success: function(data){\n \$('#agentDetailDiv" . $agent->getagentid() . "').html(data);\n },\n error: function( xhr, status, errorThrown ) {\n \$('#statusDiv').html('Error. ' + errorThrown);\n console.log( 'Error: ' + errorThrown );\n console.log( 'Status: ' + status );\n console.dir( xhr );\n }\n });\n return false; \n });\n </script>\n "; } echo "<div id='agentDetailDiv" . $agent->getagentid() . "'>"; echo $agentview->getDetailsView(); echo "</div>"; if ($findobjects == 1) { echo $am->getPrettyListOfCollectionObjectsForCollector($agent->getagentid()); } footer(); } /** * Return the requested agent as RDF in a turtle serialization. */ function deliverTurtle() { global $agent, $agentview, $charset; Header("Content-Type: text/turtle; charset=" . $charset); echo $agentview->getAsTurtle(); } function deliverRdfXml() { global $agent, $agentview, $charset;