50 session_write_close();
51 header(
'Connection: close');
54 $query =&
$app->getQuery();
58 if ( !is_array($ids) ) $ids = array($ids);
60 foreach ($ids as $id){
61 if ( preg_match(
'/^'.preg_quote(
$table,
'/').
'\?/', $id) ){
63 $rec = df_get_record_by_id($id);
65 }
else if ( strpos($id,
'=') !==
false ){
67 $rec = df_get_record(
$table, $q);
70 $q = array(
$keys[0] =>
'='. $id);
71 $rec = df_get_record(
$table, $q);
76 header(
'Content-type: text/html; charset='.
$app->_conf[
'oe']);
77 if ( $rec->checkPermission(
'view') ){
78 switch (strval(@$query[
'-text'])){
82 $out[] = $rec->getTitle();
86 $out[] = array_merge($rec->strvals(), array(
'__id__'=>$rec->getId()));
89 $out[] = $rec->display($query[
'-text']);
101 if ( count(
$out) < 2 and !is_array($query[
'-id']) and @$query[
'-return-type'] !=
'array' ){
102 if ( @$query[
'-text'] ==
'__json__' ){
103 header(
"Content-type: application/json; charset=".
$app->_conf[
'oe']);
104 echo json_encode(
$out[0]);
109 header(
"Content-type: application/json; charset=".
$app->_conf[
'oe']);
110 echo json_encode(
$out);