1 field_group.install field_group_requirements($phase)

Implements hook_requirements().

File

core/modules/field_group/field_group.install, line 10
Field group module install file.

Code

function field_group_requirements($phase) {
  $requirements = array();
  // Ensure translations don't break during installation.
  $t = get_t();

  if ($phase == 'runtime') {
    list($extras_module, $extras_enabled) = _field_group_extra_status();

    if ($extras_enabled && !$extras_module) {
      if ($extras_module === FALSE) {
        // Module not found.
        $message = $t('The <em>Accordion</em>, <em>Div</em>, <em>Horizontal tabs</em>, or <em>Multipage</em> field group types are used on this site. The contrib module %module should be enabled to ensure the existing field groups continue to work properly. Alternatively, update those field groups to use other group types.', array(
          '!module' => l('Field Group Extra', 'https://backdropcms.org/project/field_group_extra'),
        ));
      }
      elseif (!$extras_module) {
        // Module exists but isn't enabled.
        $message = $t('The <em>Accordion</em>, <em>Div</em>, <em>Horizontal tabs</em>, or <em>Multipage</em> field group types are used on this site. Enable the contrib module %module to ensure the existing field groups continue to work properly. Alternatively, update those field groups to use other group types.', array(
          '%module' => 'Field Group Extra',
        ));
      }
      $requirements['field_group_extra'] = array(
        'title' => $t('Field Group Extra'),
        'value' => $message,
        'severity' => REQUIREMENT_ERROR,
      );
    }
  }

  return $requirements;
}