i18n_node.install 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * @file
  4. * Installation file for Internationalization (i18n) module.
  5. */
  6. /**
  7. * Implements hook_install().
  8. */
  9. function i18n_node_install() {
  10. // If updating from D6, module changed name
  11. if (variable_get('i18n_drupal6_update')) {
  12. i18n_node_update_7000();
  13. }
  14. }
  15. /**
  16. * Implements hook_uninstall().
  17. */
  18. function i18n_node_uninstall() {
  19. variable_del('i18n_hide_translation_links');
  20. variable_del('i18n_selection_mode');
  21. foreach (array_keys(node_type_get_types()) as $type) {
  22. variable_del('i18n_node_' . $type);
  23. }
  24. }
  25. /**
  26. * Implements hook_update_dependencies()
  27. */
  28. function i18n_node_update_dependencies() {
  29. $dependencies['i18n_node'][7000] = array(
  30. 'i18n_string' => 7001,
  31. );
  32. return $dependencies;
  33. }
  34. /**
  35. * Implements hook_i18n_update_drupal6().
  36. *
  37. * Update old string names
  38. */
  39. function i18n_node_update_7000() {
  40. // @todo Update from D6 i18n
  41. // Variables:
  42. // i18n_newnode_current, i18n_required_node, i18n_lock_node => i18n_node_options_[node_type]
  43. // i18n_node => 'i18n_node_extended_[node_type]'
  44. // Update string names
  45. // - nodetype:type:[type]:[property] -> node:type:[type]:[property]
  46. // - Property names: title -> title_label
  47. module_load_install('i18n_string');
  48. i18n_string_install_update_context('nodetype:type:*:*', 'node:type:*:*');
  49. i18n_string_install_update_context('node:type:*:title', 'node:type:*:title_label');
  50. }
  51. /**
  52. * Delete obsoleted variable for switch interface for translating.
  53. */
  54. /*
  55. function i18n_node_update_7001() {
  56. variable_del('i18n_node_translation_switch');
  57. }
  58. */