You are here

function fpdf_requirements in FPDF 7

Implements hook_requirements()

File

./fpdf.module, line 6

Code

function fpdf_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {
    $t = get_t();
    if ($path = libraries_get_path('fpdf')) {
      if (file_exists($path . '/fpdf.php')) {
        $requirements['fpdf'] = array(
          'title' => $t('FPDF'),
          'value' => $t('fpdf.php found under !path', array(
            '!path' => $path . '/fpdf.php',
          )),
          'severity' => REQUIREMENT_OK,
        );
        return $requirements;
      }
    }
    $requirements['fpdf'] = array(
      'title' => $t('FPDF'),
      'value' => $t('FPDF library was not found. !download the library and place in under sites/all/libraries/fpdf, so that the library can be found at sites/all/libraries/fpdf/fpdf.php.', array(
        '!download' => l(t('Download'), 'http://www.fpdf.org/'),
      )),
      'severity' => REQUIREMENT_ERROR,
    );
  }
  return $requirements;
}