1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Generate a EPUB for the print_epub module using the PHPePub library.
|
6
|
*
|
7
|
* @ingroup print
|
8
|
*/
|
9
|
|
10
|
/**
|
11
|
* Find out the version of the PHPePub library.
|
12
|
*
|
13
|
* @param string $epub_tool
|
14
|
* Filename of the tool to be analysed.
|
15
|
*
|
16
|
* @return string
|
17
|
* version number of the library
|
18
|
*/
|
19
|
function _print_epub_phpepub_version($epub_tool) {
|
20
|
if (file_exists(DRUPAL_ROOT . '/' . $epub_tool)) {
|
21
|
include_once DRUPAL_ROOT . '/' . $epub_tool;
|
22
|
|
23
|
if (class_exists('EPub')) {
|
24
|
return EPub::VERSION;
|
25
|
}
|
26
|
}
|
27
|
}
|
28
|
|
29
|
/**
|
30
|
* Implements hook_print_epub_available_libs_alter().
|
31
|
*/
|
32
|
function print_epub_phpepub_print_epub_available_libs_alter(&$epub_tools) {
|
33
|
module_load_include('inc', 'print', 'includes/print');
|
34
|
$tools = _print_scan_libs('phpepub', '!^EPub.php$!');
|
35
|
|
36
|
foreach ($tools as $tool) {
|
37
|
$epub_tools['print_epub_phpepub|' . $tool] = 'PHPePub (' . dirname($tool) . ')';
|
38
|
}
|
39
|
}
|