You are here

function og_requirements in Organic groups 5.3

Same name and namespace in other branches
  1. 5.8 og.module \og_requirements()
  2. 5 og.module \og_requirements()
  3. 5.7 og.module \og_requirements()
  4. 6.2 og.install \og_requirements()
  5. 6 og.install \og_requirements()

File

./og.module, line 2744

Code

function og_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break at install time
  $t = get_t();
  if ($phase == 'runtime') {
    $og_types = og_get_types('group');
    $all_types = array_keys(node_get_types('types'));
    if (!count(array_intersect($og_types, $all_types))) {
      $requirements['og_group_types'] = array(
        'title' => $t('Organic groups group type'),
        'value' => $t('You have no node types which are acting as groups. See the Notes section of the !readme and the Content types fieldset at top of <a href="!settings">OG settings</a>.', array(
          '!readme' => og_readme(),
          '!settings' => url('admin/og/og'),
        )),
        'severity' => REQUIREMENT_ERROR,
      );
    }
    if (!module_exists('og_access')) {
      $requirements['og_access'] = array(
        'title' => $t('Organic groups access control'),
        'value' => $t('Organic groups access control module is disabled. See the !modules', array(
          '!modules' => l($t('modules page'), 'admin/build/modules'),
        )),
        'severity' => REQUIREMENT_INFO,
      );
    }
  }
  return $requirements;
}