xmlsitemap_menu.install 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * @file
  4. * Install and uninstall schema and functions for the xmlsitemap_menu module.
  5. */
  6. /**
  7. * Implements hook_uninstall().
  8. */
  9. function xmlsitemap_menu_uninstall() {
  10. drupal_load('module', 'menu');
  11. drupal_load('module', 'xmlsitemap');
  12. $menus = array_keys(menu_get_menus());
  13. foreach ($menus as $menu) {
  14. xmlsitemap_link_bundle_delete('menu_link', $menu);
  15. }
  16. }
  17. /**
  18. * Cleanup variables.
  19. */
  20. function xmlsitemap_menu_update_6200() {
  21. drupal_load('module', 'menu');
  22. drupal_load('module', 'xmlsitemap');
  23. $menus = array_keys(menu_get_menus());
  24. foreach ($menus as $menu) {
  25. $settings = array(
  26. 'status' => variable_get('xmlsitemap_menu_status_' . $menu, XMLSITEMAP_STATUS_DEFAULT),
  27. 'priority' => variable_get('xmlsitemap_menu_priority_' . $menu, XMLSITEMAP_PRIORITY_DEFAULT),
  28. );
  29. variable_set('xmlsitemap_settings_menu_' . $menu, $settings);
  30. variable_del('xmlsitemap_menu_status_' . $menu);
  31. variable_del('xmlsitemap_menu_priority_' . $menu);
  32. variable_del('xmlsitemap_menu_calculate_priority_' . $menu);
  33. }
  34. variable_del('xmlsitemap_menu_menus');
  35. variable_del('xmlsitemap_menu_calculate_priority');
  36. }
  37. /**
  38. * Rename the menu type to 'menu_link'.
  39. */
  40. function xmlsitemap_menu_update_6201() {
  41. drupal_load('module', 'xmlsitemap');
  42. xmlsitemap_link_type_rename('menu', 'menu_link');
  43. }