bootstrap_site_alert.install in Bootstrap Site Alert 8.2
Same filename and directory in other branches
The bootstrap_site_alert install file.
File
bootstrap_site_alert.installView source
<?php
/**
* @file
* The bootstrap_site_alert install file.
*/
use Drupal\user\RoleInterface;
/**
* Implements hook_install().
*/
function bootstrap_site_alert_install() {
// Add default permissions for viewing.
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, [
'view bootstrap site alerts',
]);
user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, [
'view bootstrap site alerts',
]);
// Need to use due to allowed_values_function in one of the configs.
drupal_flush_all_caches();
}
/**
* Implements hook_uninstall().
*/
function bootstrap_site_alert_uninstall() {
\Drupal::service('config.factory')
->getEditable('bootstrap_site_alert.config')
->delete();
}
Functions
Name![]() |
Description |
---|---|
bootstrap_site_alert_install | Implements hook_install(). |
bootstrap_site_alert_uninstall | Implements hook_uninstall(). |