You are here

function spaces_og_requirements in Spaces 6

Same name and namespace in other branches
  1. 5.2 spaces_og.module \spaces_og_requirements()

Implementation of hook_requirements().

File

spaces_og/spaces_og.module, line 946

Code

function spaces_og_requirements($phase) {
  $requirements = array();
  $t = get_t();
  switch ($phase) {
    case 'runtime':

      // Check that existing node types are og enabled
      $types = spaces_content_types();
      $existing_types = node_get_types();
      foreach ($types as $type => $feature) {
        if (og_is_omitted_type($type) && array_key_exists($type, $existing_types)) {
          $requirements['spaces'] = array(
            'title' => $t('Spaces OG configuration'),
            'description' => $t('The !type content type appear to be misconfigured.', array(
              '!type' => l($type, 'admin/content/types/' . $type),
            )),
            'severity' => REQUIREMENT_ERROR,
            'value' => $t('OG Misconfiguration'),
          );
          return $requirements;
        }
      }
      $requirements['spaces'] = array(
        'title' => $t('Spaces OG configuration'),
        'description' => t('The spaces og module is installed and configured properly'),
        'severity' => REQUIREMENT_OK,
        'value' => $t('Installed correctly'),
      );
  }
  return $requirements;
}