3 require_once 'search.civix.php';
6 * Implements hook_civicrm_config().
8 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_config/
10 function search_civicrm_config(&$config) {
11 _search_civix_civicrm_config($config);
12 Civi
::dispatcher()->addListener('hook_civicrm_alterAngular', ['\Civi\Search\AfformSearchMetadataInjector', 'preprocess'], 1000);
16 * Implements hook_civicrm_xmlMenu().
18 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_xmlMenu
20 function search_civicrm_xmlMenu(&$files) {
21 _search_civix_civicrm_xmlMenu($files);
25 * Implements hook_civicrm_managed().
27 * Generate a list of entities to create/deactivate/delete when this module
28 * is installed, disabled, uninstalled.
30 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_managed
32 function search_civicrm_managed(&$entities) {
33 _search_civix_civicrm_managed($entities);
37 * Implements hook_civicrm_angularModules().
39 * Generate a list of Angular modules.
41 * Note: This hook only runs in CiviCRM 4.5+. It may
42 * use features only available in v4.6+.
44 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules
46 function search_civicrm_angularModules(&$angularModules) {
47 _search_civix_civicrm_angularModules($angularModules);
51 * Implements hook_civicrm_alterSettingsFolders().
53 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterSettingsFolders
55 function search_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
56 _search_civix_civicrm_alterSettingsFolders($metaDataFolders);
60 * Implements hook_civicrm_entityTypes().
62 * Declare entity types provided by this module.
64 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_entityTypes
66 function search_civicrm_entityTypes(&$entityTypes) {
67 _search_civix_civicrm_entityTypes($entityTypes);
71 * Implements hook_civicrm_themes().
73 function search_civicrm_themes(&$themes) {
74 _search_civix_civicrm_themes($themes);
78 * Implements hook_civicrm_pre().
80 function search_civicrm_pre($op, $entity, $id, &$params) {
81 // Supply default name/label when creating new SearchDisplay
82 if ($entity === 'SearchDisplay' && $op === 'create') {
83 if (empty($params['label'])) {
84 $params['label'] = $params['name'];
86 elseif (empty($params['name'])) {
87 $params['name'] = \CRM_Utils_String
::munge($params['label']);