transliteration.install 922 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * @file
  4. * Install, update, and uninstall functions for the transliteration module.
  5. */
  6. /**
  7. * Implements hook_install().
  8. */
  9. function transliteration_install() {
  10. module_load_include('inc', 'transliteration', 'transliteration.admin');
  11. if (!$query = transliteration_file_query()) {
  12. // Database not supported.
  13. return;
  14. }
  15. if (!$query->countQuery()->execute()->fetchColumn()) {
  16. // Don't bother if no files need to be fixed.
  17. return;
  18. }
  19. $t = get_t();
  20. drupal_set_message($t('Transliteration has been installed. <a href="@transliteration-url">Fix existing file names</a>.', array('@transliteration-url' => url('admin/config/media/file-system/transliteration'))));
  21. }
  22. /**
  23. * Implements hook_uninstall().
  24. */
  25. function transliteration_uninstall() {
  26. variable_del('transliteration_file_uploads');
  27. variable_del('transliteration_file_lowercase');
  28. variable_del('transliteration_search');
  29. }