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_install().
27 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_install
29 function search_civicrm_install() {
30 _search_civix_civicrm_install();
34 * Implements hook_civicrm_postInstall().
36 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postInstall
38 function search_civicrm_postInstall() {
39 _search_civix_civicrm_postInstall();
43 * Implements hook_civicrm_uninstall().
45 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_uninstall
47 function search_civicrm_uninstall() {
48 _search_civix_civicrm_uninstall();
52 * Implements hook_civicrm_enable().
54 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_enable
56 function search_civicrm_enable() {
57 _search_civix_civicrm_enable();
61 * Implements hook_civicrm_disable().
63 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_disable
65 function search_civicrm_disable() {
66 _search_civix_civicrm_disable();
70 * Implements hook_civicrm_upgrade().
72 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_upgrade
74 function search_civicrm_upgrade($op, CRM_Queue_Queue
$queue = NULL) {
75 return _search_civix_civicrm_upgrade($op, $queue);
79 * Implements hook_civicrm_managed().
81 * Generate a list of entities to create/deactivate/delete when this module
82 * is installed, disabled, uninstalled.
84 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_managed
86 function search_civicrm_managed(&$entities) {
87 _search_civix_civicrm_managed($entities);
91 * Implements hook_civicrm_angularModules().
93 * Generate a list of Angular modules.
95 * Note: This hook only runs in CiviCRM 4.5+. It may
96 * use features only available in v4.6+.
98 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules
100 function search_civicrm_angularModules(&$angularModules) {
101 _search_civix_civicrm_angularModules($angularModules);
105 * Implements hook_civicrm_alterSettingsFolders().
107 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterSettingsFolders
109 function search_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
110 _search_civix_civicrm_alterSettingsFolders($metaDataFolders);
114 * Implements hook_civicrm_entityTypes().
116 * Declare entity types provided by this module.
118 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_entityTypes
120 function search_civicrm_entityTypes(&$entityTypes) {
121 _search_civix_civicrm_entityTypes($entityTypes);
125 * Implements hook_civicrm_themes().
127 function search_civicrm_themes(&$themes) {
128 _search_civix_civicrm_themes($themes);
132 * Implements hook_civicrm_pre().
134 function search_civicrm_pre($op, $entity, $id, &$params) {
135 // Supply default name/label when creating new SearchDisplay
136 if ($entity === 'SearchDisplay' && $op === 'create') {
137 if (empty($params['label'])) {
138 $params['label'] = $params['name'];
140 elseif (empty($params['name'])) {
141 $params['name'] = \CRM_Utils_String
::munge($params['label']);