You are here

function _opigno_lms_install_og_settings in Opigno LMS 7

Helper function to set default OG settings.

1 call to _opigno_lms_install_og_settings()
opigno_lms_install in ./opigno_lms.install
Implements hook_install().

File

./opigno_lms.install, line 301
Install, update and uninstall functions for the Opigno LMS installation profile.

Code

function _opigno_lms_install_og_settings() {

  // Set OG context handling.
  variable_set('og_context_negotiation_group_context', array(
    'opigno_tool' => array(),
    'opigno_entity_reference' => array(),
    'opigno_quiz_app_question_add' => array(),
    'tft' => array(),
    'url' => array(),
    'node' => array(),
    'og_forum' => array(),
  ));
  variable_set('og_context_providers_weight_group_context', array(
    'opigno_tool' => -10,
    'opigno_entity_reference' => -5,
    'opigno_quiz_app_question_add' => -3,
    'tft' => -1,
    'url' => 0,
    'node' => 5,
    'user-view' => 10,
    'comment' => 15,
    'og_forum' => 20,
    'user-edit' => 25,
  ));

  // Don't give full permissions to OG group manager.
  variable_set('og_group_manager_full_access', 0);

  // Remove roles that are enabled by default.
  foreach (array(
    'course' => array(
      'forum administrator',
      'administrator member',
    ),
    'class' => array(
      'forum administrator',
      'administrator member',
    ),
  ) as $type => $roles) {
    foreach ($roles as $role_name) {
      $rid = _opigno_lms_install_get_role_by_name($role_name, $type);
      if ($rid) {
        og_role_delete($rid);
      }
    }
  }
}