print_epub_phpepub.install 1.0 KB

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