metatag_hreflang.install 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * @file
  4. * Various update scripts for Metatag:hrelang.
  5. */
  6. /**
  7. * Implements hook_requirements().
  8. */
  9. function metatag_hreflang_requirements($phase) {
  10. $requirements = array();
  11. // Ensure translations don't break during installation.
  12. $t = get_t();
  13. if ($phase == 'runtime') {
  14. // Check if the Alternative Hreflang module is present.
  15. if (module_exists('hreflang')) {
  16. $requirements['metatag_hreflang'] = array(
  17. 'severity' => REQUIREMENT_ERROR,
  18. 'title' => 'Metatag',
  19. 'value' => $t('The Metatag:hreflang module should not be used at the same time as the hreflang module.'),
  20. 'description' => $t('If both the Metatag:hreflang module and the Alternative Hreflang (hreflang) module are used at the same time it is likely that they will output duplicate meta tags. As a result, it is recommended to only use one at a time.'),
  21. );
  22. }
  23. }
  24. return $requirements;
  25. }
  26. /**
  27. * Implements hook_uninstall().
  28. */
  29. function metatag_hreflang_uninstall() {
  30. // Delete any custom variables that are used.
  31. variable_del('metatag_hreflang_allow_dupe');
  32. }