You are here

function disclaimer_requirements in Disclaimer 7

Same name and namespace in other branches
  1. 6 disclaimer.install \disclaimer_requirements()

Implements hook_requirements().

File

./disclaimer.install, line 31
Install and Uninstall processes for disclaimer.

Code

function disclaimer_requirements($phase) {
  $requirements = array();
  $t = get_t();
  $current_theme = variable_get('theme_default', NULL);
  $regions = system_region_list($current_theme, REGIONS_VISIBLE);
  if ($phase == 'install' && isset($regions['footer'])) {
    variable_set('disclaimer_region', 'footer');
  }
  elseif ($phase == 'runtime' && !isset($regions[variable_get('disclaimer_region', NULL)])) {
    $requirements['disclaimer'] = array(
      'title' => $t('Disclaimer content'),
      'description' => $t('Please <a href="!url">select a theme region</a> to handle disclaimer content.', array(
        '!url' => url('admin/config/system/disclaimer'),
      )),
      'value' => $t('Region footer missing'),
      'severity' => REQUIREMENT_ERROR,
    );
  }
  return $requirements;
}