}
/**
- * Various pre defined extensions for dynamic properties and groups.
+ * List of entities to present on the Custom Group form.
*
- * @return array
+ * Includes pseudo-entities for Participant, in order to present sub-types on the form.
*
+ * @return array
*/
public static function customGroupExtends() {
- $customGroupExtends = [
- 'Activity' => ts('Activities'),
- 'Relationship' => ts('Relationships'),
- 'Contribution' => ts('Contributions'),
- 'ContributionRecur' => ts('Recurring Contributions'),
- 'Group' => ts('Groups'),
- 'Membership' => ts('Memberships'),
- 'Event' => ts('Events'),
- 'Participant' => ts('Participants'),
- 'ParticipantRole' => ts('Participants (Role)'),
- 'ParticipantEventName' => ts('Participants (Event Name)'),
- 'ParticipantEventType' => ts('Participants (Event Type)'),
- 'Pledge' => ts('Pledges'),
- 'Grant' => ts('Grants'),
- 'Address' => ts('Addresses'),
- 'Campaign' => ts('Campaigns'),
- ];
- $contactTypes = ['Contact' => ts('Contacts')] + self::contactType();
- $extendObjs = CRM_Core_OptionGroup::values('cg_extend_objects');
- $customGroupExtends = array_merge($contactTypes, $customGroupExtends, $extendObjs);
- return $customGroupExtends;
+ $customGroupExtends = array_column(CRM_Core_BAO_CustomGroup::getCustomGroupExtendsOptions(), 'label', 'id');
+ // ParticipantRole, ParticipantEventName, etc.
+ $pseudoSelectors = CRM_Core_OptionGroup::values('custom_data_type', FALSE, FALSE, FALSE, NULL, 'label', TRUE, FALSE, 'name');
+ return array_merge($customGroupExtends, $pseudoSelectors);
}
/**