You are here

function og_requirements in Organic groups 6.2

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

File

./og.install, line 497

Code

function og_requirements($phase) {

  // Need og_readme() function.
  include_once dirname(__FILE__) . '/og.module';
  $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_file and the content types fieldset at top of <a href="!settings">OG settings</a>.', array(
          '!readme_file' => 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 <a href="@modules">modules page</a>.', array(
          '@modules' => url('admin/build/modules'),
        )),
        'severity' => REQUIREMENT_INFO,
      );
    }
  }
  return $requirements;
}