You are here

function pdf_to_imagefield_check_file in PDF to ImageField 6

Same name and namespace in other branches
  1. 6.2 pdf_to_imagefield.module \pdf_to_imagefield_check_file()
  2. 7 pdf_to_imagefield.module \pdf_to_imagefield_check_file()

Helper funtion to check if file is good to convert pages

1 call to pdf_to_imagefield_check_file()
pdf_to_imagefield_file_insert in ./pdf_to_imagefield.module
Implementation of hook_file_insert().

File

./pdf_to_imagefield.module, line 269
PDF to ImageField core hooks and menu callbacks.

Code

function pdf_to_imagefield_check_file($file) {

  // check if variables are in place
  if (!isset($file->field['widget']['module']) && !isset($file->field['widget']['target_imagefield']) && !isset($file->field['multiple'])) {
    return FALSE;
  }

  // check if variables are good
  if ($file->field['widget']['module'] != 'pdf_to_imagefield' && $file->field['widget']['target_imagefield'] == 0 && $file->field['multiple'] == 1) {
    return FALSE;
  }

  // return TRUE if TRUE
  return TRUE;
}