You are here

function hook_print_pdf_available_libs_alter in Printer, email and PDF versions 7.2

Alters the list of available PDF libraries.

During the configuration of the PDF library to be used, the module needs to discover and display the available libraries. This function should use the internal _print_scan_libs() function which will scan both the module and the libraries directory in search of the unique file pattern that can be used to identify the library location.

Parameters

array $pdf_tools: An associative array using as key the format 'module|path', and as value a string describing the discovered library, where:

  • module: the machine name of the module that handles this library.
  • path: the path where the library is installed, relative to DRUPAL_ROOT. If the recommended path is used, it begins with sites/all/libraries.

As a recommendation, the value should contain in parantheses the path where the library was found, to allow the user to distinguish between multiple install paths of the same library version.

Related topics

4 functions implement hook_print_pdf_available_libs_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

print_pdf_dompdf_print_pdf_available_libs_alter in print_pdf/lib_handlers/print_pdf_dompdf/print_pdf_dompdf.module
Implements hook_print_pdf_available_libs_alter().
print_pdf_mpdf_print_pdf_available_libs_alter in print_pdf/lib_handlers/print_pdf_mpdf/print_pdf_mpdf.module
Implements hook_print_pdf_available_libs_alter().
print_pdf_tcpdf_print_pdf_available_libs_alter in print_pdf/lib_handlers/print_pdf_tcpdf/print_pdf_tcpdf.module
Implements hook_print_pdf_available_libs_alter().
print_pdf_wkhtmltopdf_print_pdf_available_libs_alter in print_pdf/lib_handlers/print_pdf_wkhtmltopdf/print_pdf_wkhtmltopdf.module
Implements hook_print_pdf_available_libs_alter().
1 invocation of hook_print_pdf_available_libs_alter()
print_pdf_settings in print_pdf/print_pdf.admin.inc
Form constructor for the PDF version module settings form.

File

print_pdf/print_pdf.api.php, line 114
Hooks provided by the PDF version module.

Code

function hook_print_pdf_available_libs_alter(&$pdf_tools) {
  module_load_include('inc', 'print', 'includes/print');
  $tools = _print_scan_libs('foo', '!^foo.php$!');
  foreach ($tools as $tool) {
    $pdf_tools['print_pdf_foo|' . $tool] = 'foo (' . dirname($tool) . ')';
  }
}