You are here

function hook_print_epub_available_libs_alter in Printer, email and PDF versions 7.2

Alters the list of available EPUB libraries.

During the configuration of the EPUB 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 $epub_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

1 function implements hook_print_epub_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_epub_phpepub_print_epub_available_libs_alter in print_epub/lib_handlers/print_epub_phpepub/print_epub_phpepub.module
Implements hook_print_epub_available_libs_alter().
1 invocation of hook_print_epub_available_libs_alter()
print_epub_settings in print_epub/print_epub.admin.inc
Form constructor for the EPUB version module settings form.

File

print_epub/print_epub.api.php, line 66
Hooks provided by the EPUB version module.

Code

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