Merge remote-tracking branch 'upstream/4.5' into 4.5-master-2015-03-09-21-44-34
[civicrm-core.git] / CRM / Group / Page / AJAX.php
index c8b00438268f011c3d8bc98fd2bdc4d7aea6a7f3..ce150a1422aa140ef1f41c01ed147134165ba779 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * This class contains the functions that are called using AJAX (jQuery)
  */
 class CRM_Group_Page_AJAX {
+  /**
+   * Get list of groups.
+   *
+   * @return array
+   */
   public static function getGroupList() {
     $params = $_REQUEST;
 
@@ -107,8 +112,10 @@ class CRM_Group_Page_AJAX {
       if (!empty($params['is_unit_test'])) {
         return array($groups, $iFilteredTotal);
       }
+      header('Content-Type: application/json');
       echo CRM_Utils_JSON::encodeDataTableSelector($groups, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
       CRM_Utils_System::civiExit();
     }
   }
+
 }