$contactList[] = array('id' => $value['id'], 'text' => implode(' :: ', $view));
}
- CRM_Utils_System::civiExit(json_encode($contactList));
+ CRM_Utils_JSON::output($contactList);
}
/**
}
static function groupTree() {
+ header('Content-Type: application/json');
$gids = CRM_Utils_Type::escape($_GET['gids'], 'String');
echo CRM_Contact_BAO_GroupNestingCache::json($gids);
CRM_Utils_System::civiExit();
}
if ($json) {
- echo json_encode($elements);
+ CRM_Utils_JSON::output($elements);
}
CRM_Utils_System::civiExit();
}
|| !$signer->validate($_REQUEST['sig'], $_REQUEST)
) {
$user = array('name' => 'error');
- echo json_encode($user);
- CRM_Utils_System::civiExit();
+ CRM_Utils_JSON::output($user);
}
$config = CRM_Core_Config::singleton();
if (isset($errors['cms_name']) || isset($errors['name'])) {
//user name is not availble
$user = array('name' => 'no');
- echo json_encode($user);
+ CRM_Utils_JSON::output($user);
}
else {
//user name is available
$user = array('name' => 'yes');
- echo json_encode($user);
+ CRM_Utils_JSON::output($user);
}
+
+ // Not reachable: JSON::output() above exits.
CRM_Utils_System::civiExit();
}
}
}
if ($result) {
- echo json_encode($result);
+ CRM_Utils_JSON::output($result);
}
}
}
}
if ($result) {
- echo json_encode($result);
+ CRM_Utils_JSON::output($result);
}
CRM_Utils_System::civiExit();
}