concrete5/concrete5 — pull request #783 by mlocati (2012-12-12 15:59:27+00:00)
Title: Add ajax helper

When using ajax requests, it's often helpful to have a helper that manages the results, sending data to client in json format.
This helper offers two methods, `sendResult` and `sendError`, which sends the result or the error message to the client and ends the execution.

Usage on server side:
```php
Loader::helper('ajax')->sendResult(...);
Loader::helper('ajax')->sendError('Error message.');
```
On the server site you can have a javascript like this:
```javascript
$.ajax({
url: ...,
dataType: "json",
success: function(data) {
},
error: function(xhr) {
alert(xhr.responseText);
}
});
```