summaryrefslogtreecommitdiff
path: root/includes/ajax.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-09-21 07:56:09 +0000
committerDries Buytaert <dries@buytaert.net>2009-09-21 07:56:09 +0000
commitef33d44f66202a8d558fbefcb9346ed5752f92c4 (patch)
treeaef126a57132f100a82f03565ebf1146842b0e10 /includes/ajax.inc
parenta32c8ecfffb62cdb70f23a7a094c64a2b9503802 (diff)
downloadbrdo-ef33d44f66202a8d558fbefcb9346ed5752f92c4.tar.gz
brdo-ef33d44f66202a8d558fbefcb9346ed5752f92c4.tar.bz2
- Patch #556018 by Damien Tournoud, dereine | sun: rename drupal_to_js() and drupal_json() for consistency and readability.
Diffstat (limited to 'includes/ajax.inc')
-rw-r--r--includes/ajax.inc16
1 files changed, 8 insertions, 8 deletions
diff --git a/includes/ajax.inc b/includes/ajax.inc
index 6bfd86d77..dca3cc76e 100644
--- a/includes/ajax.inc
+++ b/includes/ajax.inc
@@ -105,8 +105,8 @@
* A list of macro commands generated by the use of ajax_command_*()
* functions.
* @param $header
- * If set to FALSE the 'text/javascript' header used by drupal_json() will
- * not be used, which is necessary when using an IFRAME. If set to
+ * If set to FALSE the 'text/javascript' header used by drupal_json_output()
+ * will not be used, which is necessary when using an IFRAME. If set to
* 'multipart' the output will be wrapped in a textarea, which can also be
* used as an alternative method when uploading files.
*/
@@ -123,17 +123,17 @@ function ajax_render($commands = array(), $header = TRUE) {
// Use === here so that bool TRUE doesn't match 'multipart'.
if ($header === 'multipart') {
- // We do not use drupal_json() here because the header is not true. We are
- // not really returning JSON, strictly-speaking, but rather JSON content
- // wrapped in a textarea as per the "file uploads" example here:
+ // We do not use drupal_json_output() here because the header is not true.
+ // We are not really returning JSON, strictly-speaking, but rather JSON
+ // content wrapped in a textarea as per the "file uploads" example here:
// http://malsup.com/jquery/form/#code-samples
- print '<textarea>' . drupal_to_js($commands) . '</textarea>';
+ print '<textarea>' . drupal_json_encode($commands) . '</textarea>';
}
else if ($header) {
- drupal_json($commands);
+ drupal_json_output($commands);
}
else {
- print drupal_to_js($commands);
+ print drupal_json_encode($commands);
}
exit;
}