You are here

function opigno_moxtra_install in Opigno Moxtra 3.x

Same name and namespace in other branches
  1. 8 opigno_moxtra.install \opigno_moxtra_install()

Implements hook_install().

File

./opigno_moxtra.install, line 20
Install, update and uninstall functions for the Opigno Moxtra module.

Code

function opigno_moxtra_install($is_syncing) {

  // Creates the collaborative workspace field in a training groups.
  if ($is_syncing) {
    return;
  }
  $config_path = drupal_get_path('module', 'opigno_moxtra') . '/config/install';
  $storage = new FileStorage($config_path);
  $data = $storage
    ->read('field.storage.group.field_workspace');
  if (!FieldStorageConfig::loadByName($data['entity_type'], $data['field_name'])) {
    FieldStorageConfig::create($data)
      ->save();
  }
  $data = $storage
    ->read('field.field.group.learning_path.field_workspace');
  if (!FieldConfig::loadByName($data['entity_type'], $data['bundle'], $data['field_name'])) {
    FieldConfig::create($data)
      ->save();
  }
  _opigno_moxtra_set_meeting_permissions();
}