You are here

function print_pdf_requirements in Printer, email and PDF versions 5.3

Same name and namespace in other branches
  1. 5.4 print_pdf/print_pdf.module \print_pdf_requirements()
  2. 6 print_pdf/print_pdf.module \print_pdf_requirements()
  3. 7.2 print_pdf/print_pdf.install \print_pdf_requirements()
  4. 7 print_pdf/print_pdf.module \print_pdf_requirements()
  5. 5.x print_pdf/print_pdf.module \print_pdf_requirements()

Implementation of hook_requirements().

File

print_pdf/print_pdf.module, line 60

Code

function print_pdf_requirements($phase) {
  $requirements = array();
  $t = get_t();
  switch ($phase) {

    // At runtime, make sure that a PDF generation tool is selected
    case 'runtime':
      $print_pdf_pdf_tool = variable_get('print_pdf_pdf_tool', PRINT_PDF_PDF_TOOL_DEFAULT);
      if (empty($print_pdf_pdf_tool)) {
        $requirements['print_pdf_tool'] = array(
          'title' => $t('Print PDF'),
          'value' => $t('No PDF tool selected. Please configure it in the <a href="@url">PDF settings page</a>.', array(
            '@url' => url('admin/settings/print/pdf'),
          )),
          'severity' => REQUIREMENT_ERROR,
        );
      }
      break;
  }
  return $requirements;
}