-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbt_crm.install
39 lines (34 loc) · 1.04 KB
/
bt_crm.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* @file
* Install, update and uninstall functions for bt_crm.
*/
/**
* Implements hook_install().
*/
function bt_crm_install() {
// Remove redhen menu items from admin menu.
$items = [
'entity.redhen_contact.collection',
'entity.redhen_org.collection',
'entity.redhen_connection.collection',
'redhen.dashboard',
];
foreach ($items as $item) {
$menu_link_manager = \Drupal::service('plugin.manager.menu.link');
$def['enabled'] = 0;
$menu_link_manager->updateDefinition($item, $def);
}
// Add create_redhen_contact handler to webform contact form.
$webform_contacto = \Drupal::configFactory()->getEditable('webform.webform.contact');
$handlers = $webform_contacto->get('handlers');
$handlers['create_a_redhen_contact'] = [
'id' => 'create_redhen_contact',
'label' => t('Create a contact of type prospect client'),
'handler_id' => 'create_a_redhen_contact',
'status' => TRUE,
'weight' => 1,
'settings' => [],
];
$webform_contacto->set('handlers', $handlers)->save(TRUE);
}