Merge remote-tracking branch 'upstream/4.5' into 4.5-master-2014-12-30-00-43-32
[civicrm-core.git] / CRM / Mailing / Page / AJAX.php
index 4ae393f0086638b79819eccca60af32e549a4bcd..27ce9e96d90ebb0b3f4bda72c4c01076a0a460af 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -39,7 +39,7 @@
 class CRM_Mailing_Page_AJAX {
 
   /**
-   * Function to fetch the template text/html messages
+   * Fetch the template text/html messages
    */
   public static function template() {
     $templateId = CRM_Utils_Type::escape($_POST['tid'], 'Integer');
@@ -56,12 +56,11 @@ class CRM_Mailing_Page_AJAX {
       'pdf_format_id' => $messageTemplate->pdf_format_id,
     );
 
-    echo json_encode($messages);
-    CRM_Utils_System::civiExit();
+    CRM_Utils_JSON::output($messages);
   }
 
   /**
-   * Function to retrieve contact mailings
+   * Retrieve contact mailings
    */
   public static function getContactMailings() {
     $contactID = CRM_Utils_Type::escape($_GET['contact_id'], 'Integer');