function opigno_messaging_install in Opigno messaging 3.x
Same name and namespace in other branches
- 8 opigno_messaging.install \opigno_messaging_install()
Implements hook_install().
File
- ./
opigno_messaging.install, line 19 - Install, update and uninstall functions for the Opigno Messaging module.
Code
function opigno_messaging_install($is_syncing) {
if ($is_syncing) {
return;
}
// Alter private_messages module configuration..
$config = \Drupal::configFactory()
->getEditable('core.entity_view_display.private_message_thread.private_message_thread.default');
$cfg = $config
->get();
$cfg['content']['field_pm_subject'] = [
'label' => 'above',
'region' => 'content',
'weight' => -99,
'type' => 'string',
'third_party_settings' => [],
'settings' => [
'link_to_entity' => FALSE,
],
];
unset($cfg['hidden']['field_pm_subject']);
$cfg['content']['delete_link']['weight'] = -100;
$cfg['content']['members']['label'] = 'hidden';
$cfg['content']['private_messages']['label'] = 'hidden';
$config
->setData($cfg)
->save();
// private_message.
$config = \Drupal::configFactory()
->getEditable('core.entity_view_display.private_message.private_message.default');
$cfg = $config
->get();
$cfg['content']['owner']['label'] = 'hidden';
$cfg['hidden']['created'] = TRUE;
unset($cfg['content']['created']);
$config
->setData($cfg)
->save();
}