You are here

pdf_to_imagefield.install in PDF to ImageField 7

Same filename and directory in other branches
  1. 6.2 pdf_to_imagefield.install
  2. 6 pdf_to_imagefield.install

PDF to ImageField install and enable hooks.

File

pdf_to_imagefield.install
View source
<?php

/**
 * @file
 * PDF to ImageField install and enable hooks.
 */

/**
 * Implements hook_requirements().
 *
 * Complain if the imagemagic path doesn't work
 */
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/config/media/imageapi/config'),
        )),
      );
    }
    $requirements['pdf_to_imagefield']['title'] = t('PDF to ImageField');
  }
  return $requirements;
}

Functions