xmlsitemap_taxonomy.install 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * @file
  4. * Install and uninstall schema and functions for the xmlsitemap_taxonomy.
  5. */
  6. /**
  7. * Implements hook_uninstall().
  8. */
  9. function xmlsitemap_taxonomy_uninstall() {
  10. drupal_load('module', 'taxonomy');
  11. drupal_load('module', 'xmlsitemap');
  12. $vocabularies = taxonomy_get_vocabularies();
  13. foreach ($vocabularies as $vid => $vocabulary) {
  14. xmlsitemap_link_bundle_delete('taxonomy_term', $vocabulary->machine_name);
  15. }
  16. }
  17. /**
  18. * Implements hook_update_last_removed().
  19. */
  20. function xmlsitemap_taxonomy_update_last_removed() {
  21. return 6198;
  22. }
  23. /**
  24. * Cleanup variables.
  25. */
  26. function xmlsitemap_taxonomy_update_6200() {
  27. drupal_load('module', 'taxonomy');
  28. drupal_load('module', 'xmlsitemap');
  29. $vids = array_keys(taxonomy_get_vocabularies());
  30. foreach ($vids as $vid) {
  31. $settings = array(
  32. 'status' => variable_get('xmlsitemap_taxonomy_status_' . $vid, XMLSITEMAP_STATUS_DEFAULT),
  33. 'priority' => variable_get('xmlsitemap_taxonomy_priority_' . $vid, XMLSITEMAP_PRIORITY_DEFAULT),
  34. );
  35. variable_set('xmlsitemap_settings_taxonomy_term_' . $vid, $settings);
  36. variable_del('xmlsitemap_taxonomy_status_' . $vid);
  37. variable_del('xmlsitemap_taxonomy_priority_' . $vid);
  38. variable_del('xmlsitemap_taxonomy_calculate_priority_' . $vid);
  39. variable_del('xmlsitemap_taxonomy_include_empty_terms_' . $vid);
  40. }
  41. variable_del('xmlsitemap_taxonomy_include_empty_terms');
  42. variable_del('xmlsitemap_taxonomy_calculate_priority');
  43. }
  44. /**
  45. * Empty update.
  46. */
  47. function xmlsitemap_taxonomy_update_6201() {
  48. }
  49. /**
  50. * Change bundles on taxonomy terms from vid to $vocabulary->machine_name.
  51. */
  52. function xmlsitemap_taxonomy_update_7200() {
  53. drupal_load('module', 'taxonomy');
  54. drupal_load('module', 'xmlsitemap');
  55. $vocabularies = taxonomy_get_vocabularies();
  56. foreach ($vocabularies as $vid => $vocabulary) {
  57. xmlsitemap_link_bundle_rename('taxonomy_term', $vid, $vocabulary->machine_name);
  58. }
  59. }