social_event_managers.install in Open Social 8.4
Same filename and directory in other branches
- 8.9 modules/social_features/social_event/modules/social_event_managers/social_event_managers.install
- 8 modules/social_features/social_event/modules/social_event_managers/social_event_managers.install
- 8.2 modules/social_features/social_event/modules/social_event_managers/social_event_managers.install
- 8.3 modules/social_features/social_event/modules/social_event_managers/social_event_managers.install
- 8.5 modules/social_features/social_event/modules/social_event_managers/social_event_managers.install
- 8.6 modules/social_features/social_event/modules/social_event_managers/social_event_managers.install
- 8.7 modules/social_features/social_event/modules/social_event_managers/social_event_managers.install
- 8.8 modules/social_features/social_event/modules/social_event_managers/social_event_managers.install
- 10.3.x modules/social_features/social_event/modules/social_event_managers/social_event_managers.install
- 10.0.x modules/social_features/social_event/modules/social_event_managers/social_event_managers.install
- 10.1.x modules/social_features/social_event/modules/social_event_managers/social_event_managers.install
- 10.2.x modules/social_features/social_event/modules/social_event_managers/social_event_managers.install
Install, update and uninstall functions for the social_event_managers module.
File
modules/social_features/social_event/modules/social_event_managers/social_event_managers.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the social_event_managers module.
*/
use Drupal\user\Entity\Role;
/**
* Implements hook_install().
*
* Perform actions related to the installation of social_event_managers.
*/
function social_event_managers_install() {
// Fetch site manager role.
$role = Role::load('sitemanager');
// Set permission for site manager.
if ($role instanceof Role) {
// Set permission.
$role
->grantPermission('set social event managers settings');
$role
->trustData()
->save();
}
// Set default event managers settings.
$config = \Drupal::configFactory()
->getEditable('social_event_managers.settings');
$config
->set('author_as_manager', FALSE);
$config
->save();
}
/**
* Perform actions related to the installation of social_event_managers.
*/
function social_event_managers_update_8001() {
social_event_managers_install();
}
Functions
Name | Description |
---|---|
social_event_managers_install | Implements hook_install(). |
social_event_managers_update_8001 | Perform actions related to the installation of social_event_managers. |