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 5482b3f52be178fa0627fc6f9e827f0c2aa750ff..ce150a1422aa140ef1f41c01ed147134165ba779 100644 (file)
  * 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,6 +112,7 @@ 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();
     }