function webform_test_message_custom_install in Webform 6.x
Same name and namespace in other branches
- 8.5 tests/modules/webform_test_message_custom/webform_test_message_custom.install \webform_test_message_custom_install()
Implements hook_uninstall().
File
- tests/
modules/ webform_test_message_custom/ webform_test_message_custom.install, line 11 - Install, update and uninstall functions for the Webform Test Message Custom module.
Code
function webform_test_message_custom_install() {
/** @var \Drupal\webform\WebformHelpManagerInterface $help_manager */
$help_manager = \Drupal::service('webform.help_manager');
// Add warning notification.
$help_manager
->addNotification('webform_test_message_custom_install_warning', t('This is a warning notification.'), 'warning');
// Add info notification.
$info = [
'#theme' => 'item_list',
'#title' => t('This is an info notification.'),
'#items' => [
t('One'),
t('Two'),
t('Three'),
],
];
$help_manager
->addNotification('webform_test_message_custom_install_info', $info, 'info');
}