You are here

function imagefield_crop_requirements in Imagefield Crop 6

Implementation of hook_requirements().

File

./imagefield_crop.install, line 26

Code

function imagefield_crop_requirements($phase) {
  $requirements = array();
  $t = get_t();
  if ($phase == 'runtime') {
    if (count(imageapi_get_available_toolkits()) == 0) {
      $requirements['imagefield_crop_toolkits'] = array(
        'title' => $t('Imagefield crop Toolkit'),
        'value' => $t('No ImageAPI toolkits available'),
        'severity' => REQUIREMENT_ERROR,
        'description' => $t('Imagefield crop requires a Toolkit such as ImageAPI GD or ImageAPI ImageMagick to function. Go to !modules and enable one of them.', array(
          '!modules' => l('admin/build/modules', 'admin/build/modules'),
        )),
      );
    }
  }
  return $requirements;
}