You are here

function pdf_to_imagefield_requirements in PDF to ImageField 6.2

Same name and namespace in other branches
  1. 7 pdf_to_imagefield.install \pdf_to_imagefield_requirements()

Implementation of hook_requirements().

Complain if the imagemagic path doesn't work

File

./pdf_to_imagefield.install, line 46
PDF to ImageField install and enable hooks.

Code

function pdf_to_imagefield_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {

    // Make sure we've got a working toolkit
    if (pdf_to_imagefield_check_imagemagick(NULL)) {
      $requirements['pdf_to_imagefield'] = array(
        'value' => t('The imagemagick conversion toolkit seems to be working.'),
        'severity' => REQUIREMENT_OK,
      );
    }
    else {
      $requirements['pdf_to_imagefield'] = array(
        'value' => t('Problem with the imagemagick conversion toolkit.'),
        'severity' => REQUIREMENT_ERROR,
        'description' => t('Failed to convert a test PDF. Check the <a href="@link">imagemagick settings</a> are correct, and then see the pdf_to_imagefield INSTALL for instructions if it still doesn\'t work.', array(
          '@link' => url('admin/settings/imageapi/config'),
        )),
      );
    }
    $requirements['pdf_to_imagefield']['title'] = t('PDF to ImageField');
  }
  return $requirements;
}