CRM_Utils_JSON::output($groups);
}
else {
- $params = CRM_Core_Page_AJAX::defaultSortAndPagerParams();
-
- $optionalParameters = array(
+ $requiredParams = array();
+ $optionalParams = array(
+ 'title' => 'String',
+ 'created_by' => 'String',
+ 'group_type' => 'String',
+ 'visibility' => 'String',
+ 'status' => 'Integer',
'parentsOnly' => 'Integer',
'showOrgInfo' => 'Boolean',
+ // Ignore 'parent_id' as that case is handled above
);
- $params += CRM_Core_Page_AJAX::validateParams(array(), $optionalParameters);
+ $params = CRM_Core_Page_AJAX::defaultSortAndPagerParams();
+ $params += CRM_Core_Page_AJAX::validateParams($requiredParams, $optionalParams);
// get group list
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);