$answ["status"] = "err"; $answ["error"] = $c->lang->notAllowedByPrivilege; echo(json_encode($answ)); } } else if($c->action == $c->chartActions["rcvLegend"]) { if(in_array(User::$PRIVILEGE_VIEW_FLIGHTS, $c->_user->privilege)) { if(isset($c->data['flightId']) && isset($c->data['paramCodes'])) { $flightId = $c->data['flightId']; $paramCodes = $c->data['paramCodes']; $legend = $c->GetLegend($flightId, $paramCodes); echo json_encode($legend); } else { $answ["status"] = "err"; $answ["error"] = "Not all nessesary params sent. Post: ". json_encode($_POST) . ". Page chart.php"; echo(json_encode($answ)); } } else { $answ["status"] = "err"; $answ["error"] = $c->lang->notAllowedByPrivilege;