webform_test_message_custom.install in Webform 6.x
Same filename and directory in other branches
Install, update and uninstall functions for the Webform Test Message Custom module.
File
tests/modules/webform_test_message_custom/webform_test_message_custom.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the Webform Test Message Custom module.
*/
/**
* Implements hook_uninstall().
*/
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');
}
/**
* Implements hook_uninstall().
*/
function webform_test_message_custom_uninstall() {
\Drupal::state()
->delete('webform_test_message_custom');
}
Functions
Name | Description |
---|---|
webform_test_message_custom_install | Implements hook_uninstall(). |
webform_test_message_custom_uninstall | Implements hook_uninstall(). |