You are here

oa_config.install in Open Atrium Core 7.2

Provides update and install hooks for oa_config.

File

modules/oa_config/oa_config.install
View source
<?php

/**
 * @file
 * Provides update and install hooks for oa_config.
 */

/**
 * Implements hook_install().
 */
function oa_config_install() {
  $private_path = variable_get('file_private_path', FALSE);
  if (!$private_path) {
    $private_path = variable_get('file_public_path', conf_path() . '/files') . '/private';
    variable_set('file_private_path', $private_path);
  }
  if (!empty($private_path) && !is_dir($private_path)) {
    mkdir($private_path, 0775, TRUE);
  }
  oa_config_ensure_default_group_rids();
}
function oa_config_ensure_default_group_rids() {
  foreach (array(
    'oa_space',
    'oa_group',
  ) as $bundle) {
    if ($roles = og_roles('node', $bundle)) {
      if ($rid = array_search(OG_ADMINISTRATOR_ROLE, $roles)) {
        variable_set('og_group_manager_default_rids_node_' . $bundle, array(
          $rid => $rid,
        ));
      }
    }
  }
}

/**
 * Fix the default rids.
 */
function oa_config_update_7101() {
  oa_config_ensure_default_group_rids();
}

/**
 * Enable the oa_wysiwyg module
 */
function oa_config_update_7201() {
  module_enable(array(
    'oa_wysiwyg',
  ));
}

Functions

Namesort descending Description
oa_config_ensure_default_group_rids
oa_config_install Implements hook_install().
oa_config_update_7101 Fix the default rids.
oa_config_update_7201 Enable the oa_wysiwyg module