1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Install, update and uninstall functions for the print_epub_phpepub module.
|
6
|
*
|
7
|
* @ingroup print
|
8
|
*/
|
9
|
|
10
|
/**
|
11
|
* Implements hook_requirements().
|
12
|
*/
|
13
|
function print_epub_phpepub_requirements($phase) {
|
14
|
$requirements = array();
|
15
|
$t = get_t();
|
16
|
switch ($phase) {
|
17
|
// At runtime, make sure that a EPUB generation tool is selected.
|
18
|
case 'runtime':
|
19
|
$print_epub_epub_tool = variable_get('print_epub_epub_tool', PRINT_EPUB_EPUB_TOOL_DEFAULT);
|
20
|
|
21
|
if (!empty($print_epub_epub_tool)) {
|
22
|
$tool = explode('|', $print_epub_epub_tool);
|
23
|
|
24
|
if (is_file($tool[1]) && is_readable($tool[1])) {
|
25
|
if (basename($tool[1]) == 'EPub.php') {
|
26
|
$version = _print_epub_phpepub_version($tool[1]);
|
27
|
|
28
|
$requirements['print_epub_tool_version'] = array(
|
29
|
'title' => $t('Printer, email and EPUB versions - EPUB generation library'),
|
30
|
'value' => $t('PHPePub') . ' ' . $version,
|
31
|
);
|
32
|
}
|
33
|
}
|
34
|
}
|
35
|
break;
|
36
|
}
|
37
|
return $requirements;
|
38
|
}
|