function lightning_layout_modules_installed in Lightning Layout 8.2
Same name and namespace in other branches
- 8 lightning_layout.module \lightning_layout_modules_installed()
Implements hook_modules_installed().
1 call to lightning_layout_modules_installed()
- lightning_layout_install in ./
lightning_layout.install - Implements hook_install().
File
- ./
lightning_layout.module, line 20 - Contains layout functionality for Lightning.
Code
function lightning_layout_modules_installed(array $modules) {
// Don't do anything during config sync.
if (Drupal::isConfigSyncing()) {
return;
}
if (in_array('lightning_roles', $modules, TRUE)) {
Drupal::service('lightning.content_roles')
->grantPermissions('creator', [
'configure any layout',
]);
}
// Install Entity Browser Block if Lightning Media is enabled so that the
// Media Library Entity Browser is available from the Layout Builder.
if (in_array('lightning_media', $modules, TRUE)) {
Drupal::service('module_installer')
->install([
'entity_browser_block',
]);
}
}